Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Run the TEST-EC2-all.sh script to initialize Dbvisit Replicate and load the dbvrep repository in both the source and target.  It is important that the steps above be executed before running this step.

*******start_HERE**************** 

Code Block
languagetext
[oracle@]$ ./TEST-EC2-all.sh
Setting up Dbvisit Replicate configuration
Configure database SOURCEDBSOURCE_DB...
This check fails if the DBID is not the expected one...




Ok, check passed.
Configure database EC2_TARGET...
This check fails if the DBID is not the expected one...




Ok, check passed.
Object grants for database SOURCE_DB...
Object grants for database EC2_TARGET...
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.6
Copyright (C) Dbvisit Software Limited.  All rights reserved.
DDC file /home/oracle/RDSPOCTEST/config/RDSPOCTEST-EC2-onetime.ddc loaded.
MINE: Cannot determine Dbvisit Replicate dictionary version. (no dictionary exists)
APPLY: Cannot determine Dbvisit Replicate dictionary version. (no dictionary exists)
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> ENGINE SWITCH_REDOLOG
dbvrep> ENGINE SETUP MINE DROP DICTIONARY
0 dictionary objects dropped.
dbvrep> ENGINE SETUP MINE CREATE DICTIONARY
dbvrep> ENGINE 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 5B57FC60-2978-11E3-A0AD-58D8E5C48113. If not using DDC in database, set MINE_UNIQUE_ID to this value.
dbvrep> ENGINE SETUP APPLY DROP DICTIONARY
0 dictionary objects dropped.
dbvrep> ENGINE SETUP APPLY CREATE DICTIONARY
dbvrep> ENGINE SETUP APPLY LOAD DICTIONARY
dbvrep> ENGINE PREPARE_DP SETUP CLEAR
dbvrep> ENGINE SETUP PAIR MINE AND APPLY
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
Table OESCOTT.CUSTOMERSEMP instantiated at SCN 1229827
Table OESCOTT.INVENTORIESDEPT instantiated at SCN 1229827
Table OESCOTT.LOGONSALGRADE instantiated at SCN 1229827
Table OESCOTT.ORDERENTRY_METADATALOADTEST instantiated at SCN 1229827

Table OE.ORDERS instantiated at SCN 1229827
Table OE.ORDER_ITEMS instantiated at SCN 1229827
Table OE.PRODUCT_DESCRIPTIONS instantiated at SCN 1229827
Table OE.PRODUCT_INFORMATION instantiated at SCN 1229827
Table OE.WAREHOUSES instantiated at SCN 1229827
dbvrep> #single-scn instantiation: unlock all tables and schemas, forget the SCN (so it does not affect any further PREPARE statements)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/RDSPOCTEST/APPLY.sh DBLINK XExx USERID dbvadminsystem/xxxx@AWSDBxxxx@EC2_TARGET
Created Data Pump script /home/oracle/RDSPOCTEST/APPLY.sh, using network import.
dbvrep> create ddcdb from ddcfile
DDC loaded into database (266 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.
These steps are required after the RDSPOCEC2-TEST-all.sh script runs:


1) Create the necessary directory(ies) on the servers:
dbvrds02ec2-54-82-3-111.compute-1.amazonaws.com: /home/oracle/RDSPOCTEST


2) Copy the DDC files to the server(s) where the processes will run:
dbvrds02ec2-54-82-3-111.compute-1.amazonaws.com: /home/oracle/RDSPOCTESTC/RDSPOCEC2-TEST-APPLY.ddc
dbvrds01sourceserver.com: /home/oracle/RDSPOCTEST/RDSPOCEC2-TEST-MINE.ddc


3) Review that path to dbvrep executable is correct in the run scripts:
/home/oracle/RDSPOCTEST/RDSPOCEC2-TEST-run-dbvrds01sourceserver.sh
/home/oracle/RDSPOCTEST/RDSPOCEC2-TEST-run-dbvrds02-ec2-54-82-3-111.compute-1.amazonaws.com.sh


4) Copy the run script to the server(s) where the processes will run:
dbvrds01sourceserver.com: /home/oracle/RDSPOCTEST/RDSPOCEC2-TEST-run-dbvrds01.sh
dbvrds02ec2-54-82-3-111.compute-1.amazonaws.com: /home/oracle/RDSPOCTEST/RDSPOCEC2-TEST-run-dbvrds02.sh-ec2-54-82-3-111.compute-1.amazonaws.com.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/RDSPOC/APPLY.sh
Create referenced database links (if any) before running the scripts.


7) Start the replication processes on all servers:
dbvrds01sourceserver.com: /home/oracle/RDSPOCTEST/RDSPOCEC2-TEST-run-dbvrds01sourceserver.com.sh
dbvrds02ec2-54-82-3-111.compute-1.amazonaws.com: /home/oracle/RDSPOCTEST/RDSPOCEC2-TEST-run-dbvrds02-ec2-54-82-3-111.compute-1.amazonaws.com.sh


8) Start the console to monitor the progress:
/home/oracle/RDSPOCTEST/start-console.sh


The above list is stored in /home/oracle/RDSPOCTEST/Nextsteps.txt.

 

 

Once the above scripts are created, copy the TEST-EC2-rundbvrds02-ec2-54-82-3-111.compute-1.amazonaws.com.sh and TEST-EC2-APPLY.ddc to the ec2-54-82-3-111.compute-1.amazonaws.com server, example:

...

Code Block
languagetext
[oracle@ ]$ scp /home/oracle/TEST/RDSPOCEC2-TEST-run-dbvrds02.sh dbvrds02-ec2-54-82-3-111.compute-1.amazonaws.com.sh ec2-54-82-3-111.compute-1.amazonaws.com:/home/oracle/RDSPOCTEST/


[oracle@ ]$ scp /home/oracle/TEST/RDSPOCEC2-TEST-APPLY.ddc dbvrds02ec2-54-82-3-111.compute-1.amazonaws.com:/home/oracle/RDSPOCTEST/

 

Instantiate Data (Import data into EC2)

 

The first step is to create the required database link.  This link is required to pull the data from the AWSDB database into the XE database.  The full network connection description is used for the connection detail, as we do not have access to the local system to modify the tnsnames.orais to create the required database link.  This link is required to pull the data from the source database into the target database. .  For this database link the SYSTEM account is used.

...

Code Block
languagetext
SQL> create public database link XX connect to system identified by manager using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.90.111SOURCESERVER.COM)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SOURCE_DB)))';

Database link created.


SQL> select * from v$instance@SOURCE_DB;


INSTANCE_NUMBER INSTANCE_NAME
--------------- ----------------
HOST_NAME
----------------------------------------------------------------
VERSION         STARTUP_T STATUS    PAR   THREAD# ARCHIVE LOG_SWITCH_WAIT
----------------- --------- ------------ --- ---------- ------- ---------------
LOGINS    SHU DATABASE_STATUS       INSTANCE_ROLE     ACTIVE_ST BLO EDITION
---------- --- ----------------- ------------------ --------- --- -------
             1 SOURCE_DB
sourceserver.com
11.2.0.2.0      30-SEP-13 OPEN      NO          1 STARTED
ALLOWED    NO  ACTIVE        PRIMARY_INSTANCE   NORMAL    NO  XE


...

Code Block
languagetext
[oracle\]$ cat APPLY.sh

impdp dbvadminsystem/xxxx@EC2_TARGET table_exists_action=TRUNCATE network_link=XE directory=DATA_PUMP_DIR flashback_scn=1229827 tables=OE.CUSTOMERS,OE.INVENTORIES,OE.LOGON,OE.ORDERENTRY_METADATA,OE.ORDERS,OE.ORDER_ITEMS,OE.PRODUCT_DESCRIPTIONS,OE.PRODUCT_INFORMATION,OE.WAREHOUSESSCOTT.EMP SCOTT.DEPT SCOTT.SALGRADE SCOTT.LOADTEST   logfile=OE_WAREHOUSES.log JOB_NAME=DP_RDSPOCEC2-TEST_0001 exclude=statistics


[oracle@dbvrds01 RDSPOCoracle@]$ ./APPLY.sh
***GOT TO HERE****
Import: Release 11.2.0.2.0 - Production on Mon Sep 30 15:45:45 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
Starting "DBVADMIN"."DP_RDSPOC_0001":  dbvadmin/********@AWSDB table_exists_action=TRUNCATE network_link=XE directory=DATA_PUMP_DIR flashback_scn=1229827 tables=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_RDSPOC_0001 exclude=statistics
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 102.6 MB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . imported "OES"."ORDER_ITEMS"                         1200672 rows
. . imported "OE"."CUSTOMERS"                            354141 rows
. . imported "OE"."ORDERS"                               401688 rows
. . imported "OE"."INVENTORIES"                          900441 rows
. . imported "OE"."LOGON"                                114403 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
Job "DBVADMIN"."DP_RDSPOC_0001" successfully completed at 02:46:32


...