This section initialises and starts the replication processes
1. Go in to the home directory of the replication that has been setup by the setup wizard
No Format |
---|
su - oracle
cd ~oracle/dbvrep_orcl |
2. The configuration scripts can be inspected if needed. They are in the ./config directory.
...
This section initialises and starts the replication processes
1. Go in to the home directory of the replication that has been setup by the setup wizard
No Format |
---|
su - oracle |
No Format |
---|
cd ~oracle/dbvrep_orcl |
2. The configuration scripts can be inspected if needed. They are in the ./config directory.
No Format |
---|
ls ./config dbvrep_orcl-dbsetup_ttorcl_src.sql dbvrep_orcl-setup.dbvrep grants_ttorcl_src.sql dbvrep_orcl-onetime.ddc dbvrep_orcl-wizard-ddcdatabases.cfg dbvrep_orcl-wizard-tables.cfgpairs.cfg dbvrep_orcl-dbsetup_ttorcl_trg.sql dbvrep_orcl-grants_ttorcl_trg.sql dbvrep_orcl-setup.dbvrep dbvrep_orcl-wizard-ddc.cfg dbvrep_orcl-wizard-tables.cfg |
The following types of scripts are in the config directory
- SQL scripts. These scripts will run SQL statements in the source or target databases.
- CFG scripts. These are used in the setup wizard to remember user inputs. The setup wizard can be run again and the previous input will be displayed based on information in the .cfg files.
- DDC scripts. These scripts contain all the configurational settings for the replication.
- DBVREP script. This script runs Dbvisit Replicate commands and initialises the replication.
3. The dbvrep_orcl-all.sh is the main script that calls all the other script to initialise the replication. Start this script
No Format |
---|
cd ~oracle/dbvrep_orcl
./dbvrep_orcl-all.sh |
4. The replication is now being initialised. This takes approximately 3-5 minutes.
No Format |
---|
Setting up Dbvisit Replicate configuration Configure database ttorcl_src... This check fails if the DBID is not the expected one... Ok, check passed. Configure database ttorcl_trg... This check fails if the DBID is not the expected one... Ok, check passed. Object grants for database ttorcl_src... Object grants for database ttorcl_trg... Setting up the configuration Initializing......done WARN-1850: No DDC DB available, dictionary table does not exist. DDC loaded from database (0 variables). Dbvisit Replicate version 2.67.0002.37354333 Copyright (C) Dbvisit Software Limited. All rights reserved. DDC file /homeu01/oracle/dbvrep_orcl/config/dbvrep_orcl-onetime.ddc loaded. MINE: Cannot determine Dbvisit Replicate dictionary version. (no dictionary exists) APPLY: Cannot determine Dbvisit Replicate dictionary version. (no dictionary exists) dbvrep> #clear the no-DDC-DB-available warning dbvrep> engineprocess clear previous warnings dbvrep> set ON_WARNING SKIP Variable ON_WARNING set to SKIP for process *. dbvrep> set ON_ERROR EXIT Variable ON_ERROR set to EXIT for process *. dbvrep> ENGINEPROCESS SWITCH_REDOLOG WARN-1258: Insufficient privileges to do a redolog switch. Please issue it manually. dbvrep> ENGINEPROCESS SETUP MINE DROP DICTIONARY 0 dictionary objects dropped. dbvrep> ENGINEPROCESS SETUP MINE CREATE DICTIONARY dbvrep> ENGINEPROCESS SETUP MINE LOAD DICTIONARY Supplemental logging on database set. Loading dictionary table DBRSCOL$ Loading dictionary table DBRSIND$ Loading dictionary table DBRSOBJ$ Loading dictionary table DBRSTAB$ Loading dictionary table DBRSUSER$ Loading dictionary table DBRSV_$DATABASE ID of mine proces is 86E1BF73-6BAB-11E3-BF96-B392B0702394. If not using DDC in database, set MINE_UNIQUE_ID to this value. dbvrep> ENGINE SETUP WARN-1258: Insufficient privileges to do a redolog switch. Please issue it manually. WARN-1258: Insufficient privileges to do a redolog switch. Please issue it manually. dbvrep> PROCESS SETUP APPLY DROP DICTIONARY 0 dictionary objects dropped. dbvrep> ENGINEPROCESS SETUP APPLY CREATE DICTIONARY dbvrep> ENGINEPROCESS SETUP APPLY LOAD DICTIONARY dbvrep> ENGINEPROCESS PREPARE_DP SETUP CLEAR dbvrep> ENGINEPROCESS SETUP PAIR MINE AND APPLY WARN-1381: Looks like table 114274 is not an IOT after all. No data found in SQL ' select obj_ from DBRSIND$ where bo_ = ? and bitand(type_,4) != 0 and ? between valid_from_scn and valid_to_scn and DDC_ID = ? and MINE_PROCESS_NAME = ? ' WARN-1381: Looks like table 114334 is not an IOT after all. No data found in SQL ' select obj_ from DBRSIND$ where bo_ = ? and bitand(type_,4) != 0 and ? between valid_from_scn and valid_to_scn and DDC_ID = ? and MINE_PROCESS_NAME = ? ' WARN-1381: Looks like table 114338 is not an IOT after all. No data found in SQL ' select obj_ from DBRSIND$ where bo_ = ? and bitand(type_,4) != 0 and ? between valid_from_scn and valid_to_scn and DDC_ID = ? and MINE_PROCESS_NAME = ? ' 1 applier SCN set. dbvrep> SET APPLY.INSTANTIATE_SCN NOW Variable INSTANTIATE_SCN set to NOW for process APPLY. dbvrep> ENGINE SUPPLEMENTAL LOGGING SCHEMA OE ENABLE PRIMARY KEY dbvrep> ENGINE SWITCH_REDOLOG dbvrep> ENGINE WAIT_SCN_FLIP Waited 2 seconds until scn_to_timestamp changed. dbvrep> #single-scn instantiation: lock all tables and schemas dbvrep> ENGINE LOCK SCHEMAS OE Locking all schemas. Lock done. dbvrep> #single-scn instantiation: unlock all tables and schemas, but keep the SCN dbvrep> ENGINE LOCK RELEASE LOCKS dbvrep> dbvrep> #prepare the tables (we use OFFLINE as neither MINE not APPLY is running; with OFFLINE we won't wait on network timeout) dbvrep> PREPARE OFFLINE SCHEMA OE dbvrep> #single-scn instantiation: unlock all tables and schemas, forget the SCN (so it does not affect any further PREPARE statements) dbvrep> ENGINE LOCK CLEAR SCN dbvrep> ENGINE SWITCH_REDOLOG dbvrep> #prepare script for instantiation dbvrep> ENGINE PREPARE_DP WRITE DP_NETWORKLINK DIRECTORY DATA_PUMP_DIR FILE /home/oracle/dbvrep_orcl/APPLY.sh DBLINK ttorcl_src USERID SYSTEM/oracle@ttorcl_trg Created Data Pump script /home/oracle/dbvrep_orcl/APPLY.sh, using network import. dbvrep> create ddcdb from ddcfile DDC loaded into database (312 variables). dbvrep> set ON_WARNING SKIP Variable ON_WARNING set to SKIP for process *. dbvrep> set ON_ERROR SKIP Variable ON_ERROR set to SKIP for process *. OK-0: Completed, but some operation(s) raised warnings and/or errors. |
5. At the end of the output, the Next Steps to be completed will be shown. These will be done in the next steps
No Format |
---|
These steps are required after the dbvrep_orcl-all.sh script runs:
1) Create the necessary directory(ies) on the servers:
target: /home/oracle/dbvrep_orcl
2) Copy the DDC files to the server(s) where the processes will run:
target: /home/oracle/dbvrep_orcl/dbvrep_orcl-APPLY.ddc
source: /home/oracle/dbvrep_orcl/dbvrep_orcl-MINE.ddc
3) Review that path to dbvrep executable is correct in the run scripts:
/home/oracle/dbvrep_orcl/dbvrep_orcl-run-source.sh
/home/oracle/dbvrep_orcl/dbvrep_orcl-run-target.sh
4) Copy the run script to the server(s) where the processes will run:
source: /home/oracle/dbvrep_orcl/dbvrep_orcl-run-source.sh
target: /home/oracle/dbvrep_orcl/dbvrep_orcl-run-target.sh
5) Ensure firewall is open for listen interfaces 0.0.0.0:7902, 0.0.0.0:7901 used by the processes.
6) Make sure the data on apply are in sync as of time when setup was run.
Scripts for Data Pump/export/DDL were created as requested:
/home/oracle/dbvrep_orcl/APPLY.sh
Create referenced database links (if any) before running the scripts.
7) Start the replication processes on all servers:
source: /home/oracle/dbvrep_orcl/dbvrep_orcl-run-source.sh
target: /home/oracle/dbvrep_orcl/dbvrep_orcl-run-target.sh
8) Start the console to monitor the progress:
/home/oracle/dbvrep_orcl/start-console.sh
The above list is stored in /home/oracle/dbvrep_orcl/Nextsteps.txt. |
6. On the target server (dbv02) create the /home/oracle/dbvrep_orcl directory
No Format |
---|
su - oracle
[oracle@target ~]$ mkdir /home/oracle/dbvrep_orcl
[oracle@target ~]$ |
7. On the source server (dbv01), copy the DDC file to the target server using scp. The Dbvisit Database Configuration file contains all the configurational settings for the replication. The scp password is oracle
No Format |
---|
[oracle@source dbvrep_orcl]$ scp /home/oracle/dbvrep_orcl/dbvrep_orcl-APPLY.ddc oracle@target-int:/home/oracle/dbvrep_orcl/
The authenticity of host 'target-int (10.1.1.11)' can't be established.
RSA key fingerprint is 07:15:bb:a2:a6:ba:60:3f:c3:31:a9:c9:4a:7c:51:6a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'target-int,10.1.1.11' (RSA) to the list of known hosts.
oracle@target-int's password:
dbvrep_orcl-APPLY.ddc |
8. On the source server (dbv01), copy the dbvrep_orcl-run-target.sh file to the target server using scp. The scp password is oracle
No Format |
---|
[oracle@source dbvrep_orcl]$ scp /home/oracle/dbvrep_orcl/dbvrep_orcl-run-target.sh oracle@target-int:/home/oracle/dbvrep_orcl/
oracle@target-int's password:
dbvrep_orcl-run-target.sh |
9. On the target server (dbv02), setup the database link
No Format |
---|
SQL> CREATE public DATABASE LINK ttorcl_src CONNECT TO system IDENTIFIED BY oracle USING 'ttorcl_src'; |
This database link is needed for the Datapump script that is created as APPLY.sh. The content of datapump script APPLY.sh is similar to:
No Format |
---|
impdp SYSTEM/oracle@ttorcl_trg table_exists_action=TRUNCATE network_link=ttorcl_src directory=DATA_PUMP_DIR flashback_scn=14415748 tables=OE.ADDRESSES,OE.CARD_DETAILS,OE.CUSTOMERS,OE.INVENTORIES,OE.LOGON,OE.ORDERENTRY_METADATA,OE.ORDERS,OE.ORDER_ITEMS,OE.PRODUCT_DESCRIPTIONS,OE.PRODUCT_INFORMATION,OE.WAREHOUSES logfile=OE_WAREHOUSES.log JOB_NAME=DP_dbvrep_orcl_0001 |
The flashback_scn number (in this case 14415748) determines the consistency point as to where the data will be loaded to. All data prior to this SCN will be loaded using the above DataPump script. All data past this SCN will be replicated using Dbvisit Replicate.
10. On the source server (dbv01) start the APPLY.sh script
No Format |
---|
$ ./APPLY.sh
Import: Release 11.2.0.2.0 - Production on Sat Dec 28 19:55:26 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."DP_DBVREP_ORCL_0001": SYSTEM/********@ttorcl_trg table_exists_action=TRUNCATE network_link=ttorcl_src directory=DATA_PUMP_DIR flashback_scn=14491671 tables=OE.ADDRESSES,OE.CARD_DETAILS,OE.CUSTOMERS,OE.INVENTORIES,OE.LOGON,OE.ORDERENTRY_METADATA,OE.ORDERS,OE.ORDER_ITEMS,OE.PRODUCT_DESCRIPTIONS,OE.PRODUCT_INFORMATION,OE.WAREHOUSES logfile=OE_WAREHOUSES.log JOB_NAME=DP_dbvrep_orcl_0001
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 1.008 GB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . imported "OE"."ORDER_ITEMS" 4290023 rows
. . imported "OE"."INVENTORIES" 900632 rows
. . imported "OE"."ORDERS" 1429790 rows
. . imported "OE"."ADDRESSES" 1500000 rows
. . imported "OE"."CUSTOMERS" 1000000 rows
. . imported "OE"."CARD_DETAILS" 1500000 rows
. . imported "OE"."LOGON" 2382984 rows
. . imported "OE"."PRODUCT_DESCRIPTIONS" 1000 rows
. . imported "OE"."PRODUCT_INFORMATION" 1000 rows
. . imported "OE"."ORDERENTRY_METADATA" 4 rows
. . imported "OE"."WAREHOUSES" 1000 rows
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Job "SYSTEM"."DP_DBVREP_ORCL_0001" successfully completed at 20:20:50
[oracle@source dbvrep_orcl]$ |
Note | ||
---|---|---|
During the import of the data, the archiver will become stuck because there will not be enough space. Run the following script a few times on the target server (dbv02) to ensure that the flash recovery area does not fill up and pause the import:
|
...
Applier SCN set (start=3141006, current=3141006).
dbvrep> SET APPLY.INSTANTIATE_SCN NOW
Variable INSTANTIATE_SCN set to NOW for process APPLY.
dbvrep> EXCLUDE CREATE TABLE %.DBMS_TABCOMP_TEMP_UNCMP #Ignore tables
created by Compression Advisor
Exclude rule created.
dbvrep> EXCLUDE CREATE TABLE %.DBMS_TABCOMP_TEMP_CMP #Ignore tables
created by Compression Advisor
Exclude rule created.
dbvrep> SET PREPARE_SCHEMA_EXCEPTIONS
OE.SUBCATEGORY_REF_LIST_NESTEDTAB,OE.PRODUCT_REF_LIST_NESTEDTAB
Variable PREPARE_SCHEMA_EXCEPTIONS set to
OE.SUBCATEGORY_REF_LIST_NESTEDTAB,OE.PRODUCT_REF_LIST_NESTEDTAB for
process *.
dbvrep> PROCESS SUPPLEMENTAL LOGGING SCHEMA "OE" ENABLE PRIMARY KEY
dbvrep> PROCESS SWITCH_REDOLOG
WARN-1258: Insufficient privileges to do a redolog switch. Please issue
it manually.
dbvrep> PROCESS WAIT_SCN_FLIP
Waited 2 seconds until scn_to_timestamp changed.
dbvrep> #single-scn instantiation: lock all tables and schemas
dbvrep> PROCESS LOCK SCHEMAS "OE"
Locking all schemas.
Lock done.
dbvrep> #single-scn instantiation: unlock all tables and schemas, but
keep the SCN
dbvrep> PROCESS LOCK RELEASE LOCKS
dbvrep>
dbvrep> #prepare the tables (we use OFFLINE as neither MINE not APPLY
is running; with OFFLINE we won't wait on network timeout)
dbvrep> PREPARE OFFLINE SCHEMA "OE"
Table OE.ADDRESSES instantiated at SCN 3144204
Table OE.CARD_DETAILS instantiated at SCN 3144204
Table OE.CMP3$95780 instantiated at SCN 3144204
Table OE.CMP4$95780 instantiated at SCN 3144204
Table OE.CUSTOMERS instantiated at SCN 3144204
Column SYS_NC00017$ is special: virtual column. Excluding.
Column SYS_NC00017$ is special: hidden column. Excluding.
Column SYS_NC00017$ is special: system-generated column. Excluding.
Column SYS_NC00017$ is special: virtual column. Excluding.
Column SYS_NC00018$ is special: virtual column. Excluding.
Column SYS_NC00018$ is special: hidden column. Excluding.
Column SYS_NC00018$ is special: system-generated column. Excluding.
Column SYS_NC00018$ is special: virtual column. Excluding.
Table OE.INVENTORIES instantiated at SCN 3144204
Table OE.LOGON instantiated at SCN 3144204
Table OE.ORDERENTRY_METADATA instantiated at SCN 3144204
Table OE.ORDERS instantiated at SCN 3144204
Table OE.ORDER_ITEMS instantiated at SCN 3144204
Table OE.PRODUCT_DESCRIPTIONS instantiated at SCN 3144204
Table OE.PRODUCT_INFORMATION instantiated at SCN 3144204
Table OE.PROMOTIONS instantiated at SCN 3144204
Table OE.WAREHOUSES instantiated at SCN 3144204
dbvrep>
dbvrep> #single-scn instantiation: unlock all tables and schemas,
forget the SCN (so it does not affect any further PREPARE statements)
dbvrep> PROCESS LOCK CLEAR SCN
dbvrep> PROCESS SWITCH_REDOLOG
WARN-1258: Insufficient privileges to do a redolog switch. Please issue
it manually.
dbvrep> #prepare script for instantiation
dbvrep> PROCESS PREPARE_DP WRITE DP_NETWORKLINK DIRECTORY
ttorcl_trg_DATA_PUMP_DIR FILE /u01/oracle/dbvrep_orcl/APPLY.sh DBLINK
ttorcl_src USERID SYSTEM/oracle@ttorcl_trg
Created Data Pump script /u01/oracle/dbvrep_orcl/APPLY.sh, using
network import.
dbvrep> create ddcdb from ddcfile
DDC loaded into database (346 variables).
dbvrep> set ON_WARNING SKIP
Variable ON_WARNING set to SKIP for process *.
dbvrep> set ON_ERROR SKIP
Variable ON_ERROR set to SKIP for process *.
OK-0: Completed, but some operation(s) raised warnings and/or errors. |
Note |
---|
WARN-1258: Insufficient privileges to do a redolog switch. Please issue it manually. This warning is expected. In Oracle 12c when you connect to a CDB, you don't have privileges for a system-wide log switch. The warning will not stop replication. Replication may take a bit longer to initialize as the MINE process will have to read through the current log. Or you could run the command manually. |
At the end of the output, the Next Steps to be completed will be shown.
No Format |
---|
These steps are required after the dbvrep_orcl-all.sh script runs:
1) Create the necessary directory(ies) on the servers:
target: /u01/oracle/dbvrep_orcl
2) Copy the DDC files to the server(s) where the processes will run:
target: /u01/oracle/dbvrep_orcl/dbvrep_orcl-APPLY.ddc
source: /u01/oracle/dbvrep_orcl/dbvrep_orcl-MINE.ddc
3) Review that path to dbvrep executable is correct in the run scripts:
/u01/oracle/dbvrep_orcl/dbvrep_orcl-run-source.sh
/u01/oracle/dbvrep_orcl/dbvrep_orcl-run-target.sh
4) Copy the run script to the server(s) where the processes will run:
source: /u01/oracle/dbvrep_orcl/dbvrep_orcl-run-source.sh
target: /u01/oracle/dbvrep_orcl/dbvrep_orcl-run-target.sh
5) Ensure firewall is open for listen interfaces 0.0.0.0:7902, 0.0.0.0:7901 used by the processes.
6) Make sure the data on apply are in sync as of time when setup was run.
Scripts for Data Pump/export/DDL were created as requested:
/u01/oracle/dbvrep_orcl/APPLY.sh
Create referenced database links (if any) before running the scripts.
7) Start the replication processes on all servers:
source: /u01/oracle/dbvrep_orcl/dbvrep_orcl-run-source.sh
target: /u01/oracle/dbvrep_orcl/dbvrep_orcl-run-target.sh
8) Start the console to monitor the progress:
/u01/oracle/dbvrep_orcl/start-console.sh
The above list is stored in /u01/oracle/dbvrep_orcl/Nextsteps.txt. |
5. On the target server (dbv02) create the /u01/oracle/dbvrep_orcl directory
No Format |
---|
su - oracle |
No Format |
---|
mkdir /u01/oracle/dbvrep_orcl |
6. On the source server (dbv01), copy the DDC file to the target server using scp. The Dbvisit Database Configuration file contains all the configurational settings for the replication.
No Format |
---|
scp /u01/oracle/dbvrep_orcl/dbvrep_orcl-APPLY.ddc oracle@target-int:/u01/oracle/dbvrep_orcl/
The authenticity of host 'target-int (10.0.2.5)' can't be established.
RSA key fingerprint is ad:11:03:c0:f0:78:7f:29:82:7c:35:e7:66:bc:e0:5b. |
No Format |
---|
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'target-int' (RSA) to the list of known hosts. |
The scp password is oracle
No Format |
---|
oracle@target-int's password:
dbvrep_orcl-APPLY.ddc |
7. On the source server (dbv01), copy the dbvrep_orcl-run-target.sh file to the target server using scp.
No Format |
---|
scp /u01/oracle/dbvrep_orcl/dbvrep_orcl-run-target.sh oracle@target-int:/u01/oracle/dbvrep_orcl/ |
The scp password is oracle
No Format |
---|
oracle@target-int's password:
dbvrep_orcl-run-target.sh |
Note |
---|
The word "target" in dbvrep_orcl-run-target.sh is dependent on your target hostname. In this case, the target hostname is called target |