Versions Compared

Key

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

...

However, The Oracle Data Pump scripts can also be manually created by running the following command:

panel
Section
Column
width95
No Format
bgColorCCC
ENGINE PREPARE_DP WRITE DP_NETWORKLINK DIRECTORY DATA_PUMP_DIR FILE...

 

This command is part of the *.dbvrep script that is created by the setup wizard and is run as part of the *-all.sh or *-all.bat script to configure the replication. This command can be used to generate datapump script after adding table(s)/schema(s) into an already running replication by using prepare command.

The dbvrep ENGINE PREPARE_DP command creates the Oracle Data Pump script using the following information:

...

2. The SQL*Net TNS connections to connect to the source and target database using network import. The network_link has to be created manually in the target database. If the network link is not in place the following error message is displayed "ORA-39200: Link name "xxx" is invalid". The network link can be created with command:

Section
Column
width95
Panel
No Format
bgColorCCC
CREATE public DATABASE LINK 
LINK 
link_name
 CONNECT
 CONNECT TO system IDENTIFIED BY 
BY 
password
 USING 
 USING connect_string

 

1. The system username and password to connect to the source and target database.

...

No outage of the source database is required because the SCN is used to extract the data out of the source data. This ensures that the data will be consistent at that particular point in time. Dbvisit Replicate will start replicating at the same point in time and therefore consistency is maintained between the source and target database.

Example

Following commands will add test1.emp table into the current replication and generate datapump script to load data into target database. Following environment is used in this example.

ObjectName
Source Databasereptest1
Target Databasereptest2
Database Link

reptest1_link

No Format
bgColorCCC
dbvrep>ENGINE PREPARE_DP SETUP CLEAR 
dbvrep>PREPARE TABLE TEST1.EMP
Connecting to running apply [TEST1.EMP]: [Apply table removed (0 metadata record(s)). 
Apply table added (1 metadata record(s)).]
Connecting to running mine [TEST1.EMP]: [Table prepared (321356 internal records).]
Table test1.temp instantiated at SCN 6704096
dbvrep>ENGINE PREPARE_DP WRITE DP_NETWORKLINK DIRECTORY DATA_PUMP_DIR FILE /home/oracle/reptest1/APPLY2.sh DBLINK reptest1_link USERID SYSTEM/password@reptest2
Created Data Pump script /home/oracle/reptest1/APPLY1.sh, using network import.

 

Above command will generate following datapump script.

No Format
bgColorCCC
impdp SYSTEM/password@reptest2 table_exists_action=TRUNCATE network_link=reptest1_link directory=
DATA_PUMP_DIR flashback_scn=6704096 tables=TEST1.emp logfile=TEST1_temp.log JOB_NAME=DP_reptest1_0001

 

 

Note

ENGINE PREPARE_DP SETUP CLEAR command removes the old metadata of any previous prepare command(s).