5.1.4. Setting the Replication Start Position
Positions within the Oracle replication processe can be identified and/or
set using the Oracle System Change Number (SCN) reference. By setting the
replication to start at a specific SCN you can take advantage of
provisioning, or starting replication on specific known boundaries, for
example, after a specific backup operation, or snapshot, has taken place.
By default tpm sets up Oracle replication to start at
the current position of the Oracle DBMS, which is denoted by the current
SCN. The replicator represents this value using the word
NOW. To enable default behavior
simply install normally and include the tpm --start-and-report option in
the installation. The replicator will extract the first transaction
committed after the time when the replicator was installed.
18.104.22.168. Setting a Specific Start Position
To start replication at a specific SCN in the past, you must bring the
replicator online explicitly with an option that specifies the exact SCN
where replication should start. Here are the exact steps.
Determine the SCN from which you would like to begin replication.
When installing the replicator do not include the --start-and-report
option. tpm will install the replicator but will
not start the service or bring it online.
After installation completes successfully, start the replicator on
the source Oracle instance and bring it online using the following
replicator start offline
trepctl online -from-event
Start the target replicator(s) normally using:
Replication will now start at the target SCN value. Here is a short
example of how to select the target SCN and then bring the replicator
online to pick up older changes.
select current_scn from v$database;
Depending on how old the SCN is the replicator may take a while to
extract up to the current position of the Oracle instance. You can
confirm that older data were extracted by looking in the log using the
22.214.171.124. Resetting Existing Replication to a specific SCN
You can reset replicators to begin extracting from a specific SCN after
replication has been installed using the following procedure:
Reset target and source replicators using the reset command to clear
multi_trepctl -service servicename reset -y
Bring the source replicator online starting at the desired SCN:
trepctl -host sourcehost online -from-event 14140241
Bring the target replicator online normally:
trepctl -host targethost online
126.96.36.199. Forcing replication to restart from a new SCN without resetting the THL
You can use the
command to change the position of replication in the source Oracle
instance. This allows you to skip over parts of the log or reposition
replication without disturbing target replicators.
Bring the source replicator offline and reset the redo component
trepctl -host sourcehost offline
trepctl -host sourcehost -service servicename reset -redo -y
Bring the source replicator online starting at the desired SCN.
trepctl -host sourcehost online -from-event 61754320
Target replicators will automatically reconnect to the source