5.1.5. Provisioning an Oracle Replication Solution

You can provision an empty target Oracle schema from an existing one and start Tungsten Replicator while positioning redo log extraction correctly.

The instructions below assume the following:

  • Tungsten Replicator is not installed on each the source or the target servers.

  • An active source Oracle installation with tables and data.

  • An active target Oracle installation, without data, but with a matching schema.

Before starting the provisioning process:

  • Make sure that Tungsten is not installed, no Tungsten Replicator internal tables exist (trep_commit_seqno) and no THL files are left from old installations.

  • Make sure that VMware redo reader is not installed and PLOG files are left from previous installations.

5.1.5.1. Provisioning with Oracle Data Pump

Important

When using this method, no open transactions must be running. Active transactions are not extracted and result in inconsistencies

  1. Login to Oracle as sysdba and get current SCN position:

    shell> sqlplus / as sysdba
    
    SQL> SELECT CURRENT_SCN FROM v$database;
    
    CURRENT_SCN
    -----------
    6449931
  2. On the source server export the full schema at this specific SCN position to generate a consistent dump across all tables (note the parameter flashback_scn).

    shell> expdp system/Password11 directory=DATA_PUMP_DIR schemas=tungsten \
        dumpfile=tungsten.dmp logfile=tungsten.log flashback_scn=6449931
  3. Copy the generated files to the target server.

    shell> scp /app/oracle/local/admin/ORCL/dpdump/tungsten.* \
        oracleslave.example.com:/app/oracle/local/admin/ORCL/dpdump/
  4. On the target server import the files.

    shell> impdp tungsten/secret DIRECTORY=DATA_PUMP_DIR \
        DUMPFILE=tungsten.dmp LOGFILE=tungsten.log SCHEMAS=tungsten

    Note

    If you get the following error messages when you try to import the data:

    ORA-39002: invalid operation
    ORA-39070: Unable to open the log file.
    ORA-39087: directory name DATA_PUMP_DIR is invalid

    Check the value of DATA_PUMP_DIR using:

    SQL> select * from all_directories where directory_name = 'DATA_PUMP_DIR';

    If you do not get a result, create the required directory:

    SQL> CREATE DIRECTORY DATA_PUMP_DIR AS ‘/path‘;

    If the directory already exists, then ensure the permissions for the user you are using to import the data:

    SQL> GRANT READ, WRITE ON DIRECTORY DATA_PUMP_DIR TO tungsten;
  5. Install replication on the master server, for example using the instructions in Section 5.3.2.2.1, “Installing Oracle to Oracle Migration Replication - Basic Procedure using INI Files”.

    However, when starting replication, ensure that you use the instructions for setting an explicit SCN number when the replication starts. See Section 5.1.4.1, “Setting a Specific Start Position” for more information on setting this parameter during replication startup.

    shell> trepctl online -from-event 6449931