Home / allbbwdating / Updating oracle table from a join

Updating oracle table from a join

# ————————————————————————— if [ “$RSTAT” = “0” ] then LOGMSG=”ended successfully” else LOGMSG=”ended in error” fi echo $RMAN_LOG_FILE # ————————————————————————— # Stop and start the database after cold backup # This step is required, as $ORACLE_HOME/bin/srvctl start database -d TESTDB -o open # does not open the database, if it is already mounted # ————————————————————————— $ORACLE_HOME/bin/srvctl stop database -d TESTDB $ORACLE_HOME/bin/srvctl start database -d TESTDB # ————————————————————————— # Start the services based on database # ————————————————————————— $ORACLE_HOME/bin/srvctl start service -s MSOG -d TESTDB -i TESTDB1 $ORACLE_HOME/bin/srvctl start service -s MSOG -d TESTDB -i TESTDB2 $ORACLE_HOME/bin/srvctl start service -s MSOG -d TESTDB -i TESTDB3 exit $RSTAT DG 2008-02-27- 0 2 0 Dumping property lsbymaxeventsrecorded DG 2008-02-27- 0 2 0 Property type CONFIGURABLE, Value type INT DG 2008-02-27- 0 2 0 Value = 5000 DG 2008-02-27- 0 2 0 RSM set LProp: stop Apply engine DG 2008-02-27- 0 2 0 Executing SQL [alter database stop logical standby apply] DG 2008-02-27- 0 2 0 SQL [alter database stop logical standby apply] Executed successfully DG 2008-02-27- 0 2 0 RSM Logical Apply Engine: (rfrlawad) epscn is NULL DG 2008-02-27- 0 2 0 RSM Logical Apply Engine: Wait for apply engine to shutdown..DG 2008-02-27- 0 2 0 RSM Logical Apply Engine: Apply offline already!CREATE TABLE `stock` ( `STOCK_ID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `STOCK_CODE` VARCHAR(10) NOT NULL, `STOCK_NAME` VARCHAR(20) NOT NULL, PRIMARY KEY (`STOCK_ID`) USING BTREE, UNIQUE KEY `UNI_STOCK_NAME` (`STOCK_NAME`), UNIQUE KEY `UNI_STOCK_ID` (`STOCK_CODE`) USING BTREE ) CREATE TABLE `category` ( `CATEGORY_ID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `NAME` VARCHAR(10) NOT NULL, `DESC` VARCHAR(255) NOT NULL, PRIMARY KEY (`CATEGORY_ID`) USING BTREE ) CREATE TABLE `stock_category` ( `STOCK_ID` INT(10) UNSIGNED NOT NULL, `CATEGORY_ID` INT(10) UNSIGNED NOT NULL, `CREATED_DATE` DATE NOT NULL, `CREATED_BY` VARCHAR(10) NOT NULL, PRIMARY KEY (`STOCK_ID`,`CATEGORY_ID`), CONSTRAINT `FK_CATEGORY_ID` FOREIGN KEY (`CATEGORY_ID`) REFERENCES `category` (`CATEGORY_ID`), CONSTRAINT `FK_STOCK_ID` FOREIGN KEY (`STOCK_ID`) REFERENCES `stock` (`STOCK_ID`) ) package com.mkyong.stock; import Unique Constraint; @Entity @Table(name = "stock", catalog = "mkyongdb", unique Constraints = ) public class Stock implements While this is happening database will be restarted in the background.Once the configuration has successfully completed, we can start using the Database vault GUI.Typical URL will be https://hostname:/dva/Here it will be using the same port, which is currently being used for Database Console.

# ————————————————————————— RMAN_LOG_FILE=/database_backup/log/testdb_# ————————————————————————— # Delete Old backup log file # ————————————————————————— if [ -f “$RMAN_LOG_FILE” ] then rm -f “$RMAN_LOG_FILE” fi # —————————————————————– # Initialize the log file.So in a 2-node cluster, if we connect to an instance & physical data file (TEST. Use an OS level Cluster file system, visible from all nodes.TXT in our example) is present on other node, we’ll get ORA-29913 error. Create physical directories on all the nodes of cluster. This is normally an expensive option, as additional license will be required. While presenting the storage from SAN / NAS, we can present it as NFS. Hibernate: insert into mkyongdb.stock_category (CREATED_BY, CREATED_DATE, CATEGORY_ID, STOCK_ID) values (? NAME as NAME1_0_ from mkyongdb.category category0_ where category0_. Hibernate: insert into mkyongdb.stock (STOCK_CODE, STOCK_NAME) values (? CATEGORY_ID as CATEGORY1_1_0_, category0_.`DESC` as DESC2_1_0_, category0_. But in logical data guard without a Grid Control configuration, it is difficult to keep the optimizer statistics updated.So a small job to refresh the statistics will be helpful.# ————————————————————————— echo $RMAN_LOG_FILE # ————————————————————————— # Stop and mount the database for cold backup # ————————————————————————— $ORACLE_HOME/bin/srvctl stop database -d TESTDB $ORACLE_HOME/bin/srvctl start database -d TESTDB -o mount # ————————————————————————— # Script for database backup # ————————————————————————— CMD_STR=” ORACLE_HOME=$ORACLE_HOME export ORACLE_HOME ORACLE_SID=$ORACLE_SID export ORACLE_SID $RMAN target=$TARGET_CONNECT_STR nocatalog log=$RMAN_LOG_FILE append $RMAN_LOG_FILE RSTAT=$?fi # ————————————————————————— # Log the completion of this script. Transient; @Entity @Table(name = "stock_category", catalog = "mkyongdb") @Association Overrides() public class Stock Category implements Serializable session.begin Transaction(); Stock stock = new Stock(); Stock Code("7052"); Stock Name("PADINI"); Category category1 = new Category("CONSUMER", "CONSUMER COMPANY"); //new category, need save to get the id first session.save(category1); Stock Category stock Category = new Stock Category(); stock Stock(stock); stock Category(category1); stock Created Date(new Date()); //extra column stock Created By("system"); //extra column Stock Categories().add(stock Category); session.save(stock); Transaction().commit(); Hibernate: insert into mkyongdb.category (`DESC`, NAME) values (? ) Hibernate: insert into mkyongdb.stock (STOCK_CODE, STOCK_NAME) values (?

322 comments

  1. Apr 23, 2008 Oracle DBA Blog. +Current state of Logical standby SELECT INST_ID, SESSION_ID, STATE FROM GV$LOGSTDBY_STATE

  2. In this tutorial, we show you how to use Hibernate to implements “many-to-many table relationship, with extra column in the join table“. The STOCK and CATEGORY.

  3. Join Stack Overflow to learn, share knowledge, and build your career.

Leave a Reply

Your email address will not be published. Required fields are marked *

*