Adding new object from a given SCN
When using AS OF <scn> clause of PREPARE TABLE command to include tables in the on-going replication from pre-specified SCN one has to consider several things beforehand. Except for the consideration bellow the steps do not differ from those for a simple PREPARE TABLE command without AS OF.
- make sure that the current SCN of replication (where MINE and APPLY is right now) is not greater than the SCN in PREPARE AS OF <scn> command, e.g.:
SCN ---|-------|--------------|---------------------|-----------
100 150 200 300
APPLY MINE PREPARE AS OF Source DB
make sure that the table has supplemental logging enabled as of SCN used in PREPARE AS OF <scn> command. If supplemental logging is not enabled Replicate will have to use current SCN instead, e.g.:
dbvrep> prepare as of 2225767872 table TEST1.FORALL_TEST Prepare enabled supplemental logging, waiting for SCN advance enough to prevent ORA-01466 during consistent export....Waited 2 seconds until scn_to_timestamp changed. We've just added supplemental logging to the table and thus we must use a current SCN and can't use the required one of 2225767872. Connecting to running apply [TEST1.FORALL_TEST]: [Apply table removed (0 metadata record(s)). Apply table added (1 metadata record(s)).] Connecting to running mine [TEST1.FORALL_TEST]: [Table prepared (1 internal records).] Table TEST1.FORALL_TEST instantiated at SCN 2225768428
To enable supplemental logging on table or schema before running PREPARE AS OF use the following command:
PROCESS SUPPLEMENTAL LOGGING {SCHEMA schema|TABLE schema.table_name} ENABLE {PRIMARY KEY|ALL COLUMN}