Versions Compared

Key

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

Oracle SCN (System Change Number)

The Oracle SCN (System Change Number) is very important in replication. It is the primary mechanism to determine the start of the replication and to maintain consistency during replication. Dbvisit Replicate uses the SCN to mark the starting point of where to start replicating from. Only changes made from the SCN specified are replicated. Also changes pending in non committed transactions from this SCN will be lost. Each table can have a different SCN to replicate from, or a single SCN can be used to mark the beginning of the replication of all tables. 

The setting INSTANTIATE_SCN determines which SCN is used. The values are:

  • NOW (default) - It uses the SCN as of now at this moment in time.

    No Format
    INSTANTIATE_SCN NOW
  • RESETLOGS - It uses the SCN of the last resetlogs at the target database. It obtains the resetlogs_change# value from v$database.. This is handy if a standby database is used to create the initial starting point and a resetlogs is used to open the standby database in READ WRITE mode.

    No Format
    INSTANTIATE_SCN RESETLOGS
  • NOW_NOLOCK -  This is used when using the no-lock option in step 2 of the SETUP WIZARD.  This will not lock the tables, it will capture the SCN of the oldest active transaction at that time.  This has a pre-requisite of running the pre-all.sh script prior to running the all.sh script.

    No Format
    INSTANTIATE_SCN NOW_NOLOCK
  • manually entered numeric value - A manually entered SCN can be used. This is done by editing the *.dbvrep script and change the word "RESETLOGS" to the actual SCN number. Then run *all.sh or *all.bat script. 

    No Format
    INSTANTIATE_SCN 14382713



When the INSTANTIATE_SCN NOW is used Dbvisit Replicate will capture the SCN using either of the following methods:
  • When there is an ENGINE LOCK command, it captures the SCN at the start of the LOCK command. 
  • When there is no ENGINE LOCK command, it captures the SCN at the start of each PREPARE command.

...