diff --git a/Golden_Gate/example_02/setup_extract_pump_replicat_02.md b/Golden_Gate/example_02/setup_extract_pump_replicat_02.md index 5b0deea..11a9593 100644 --- a/Golden_Gate/example_02/setup_extract_pump_replicat_02.md +++ b/Golden_Gate/example_02/setup_extract_pump_replicat_02.md @@ -221,8 +221,6 @@ END; ``` - - ## Interesting things Deleting all 9999998 from source: diff --git a/Golden_Gate/example_02/setup_extract_pump_replicat_03.md b/Golden_Gate/example_02/setup_extract_pump_replicat_03.md new file mode 100644 index 0000000..9956b90 --- /dev/null +++ b/Golden_Gate/example_02/setup_extract_pump_replicat_03.md @@ -0,0 +1,107 @@ +# Add a new table to replication + +``` +dblogin useridalias EREP +list tables R2D2.* +add trandata R2D2.T2 +``` + +To check if supplemental log is activated on entire database: + +```sql +select + supplemental_log_data_pk, + supplemental_log_data_ui +from v$database +/ +``` + +To check if supplemental log is activated on a specific table: + +```sql +set lines 256 +col LOG_GROUP_NAME for a25 +col TABLE_NAME for a25 +col OWNER for a30 + +select + OWNER, + TABLE_NAME, + DECODE(ALWAYS,'ALWAYS', 'Unconditional','CONDITIONAL', 'Conditional') ALWAYS, + LOG_GROUP_NAME, + LOG_GROUP_TYPE FROM DBA_LOG_GROUPS +where + OWNER='R2D2' and TABLE_NAME='T2' +/ +``` + +Add new table to extract definition: + +``` +edit params EXTRAA +``` + +``` +extract EXTRAA +useridalias NABOOPRD +sourcecatalog EREP +exttrail ./dirdat/aa +purgeoldextracts +checkpointsecs 1 +ddl include mapped +warnlongtrans 1h, checkinterval 30m +------------------------------------ +table R2D2.T1; +table R2D2.T2; +``` + +Restart the extract: + +``` +restart extract EXTRAA +status extract EXTRAA +``` + +Note down the current `SCN` on source database: + +```sql +select current_scn from v$database; +``` + +Export new table in a consistent state of previous `SCN`: + +``` +expdp userid="'/ as sysdba'" dumpfile=MY:T2.dmp logfile=MY:T2.log tables=R2D2.T2 flashback_scn=4153892 +``` + +Import new table on target database: + +``` +impdp userid="'/ as sysdba'" dumpfile=MY:T2.dmp logfile=MY:import_T2.log remap_schema=R2D2:C3PO +``` + + +On target, stop replicat, add new table and start from the **good** `SCN` for new table. + +``` +edit params REPLAA +``` + +``` +replicat REPLAA +useridalias GERISS +dboptions enable_instantiation_filtering +discardfile REPLAA.dsc, purge, megabytes 10 + +map EREP.R2D2.T1, target GERISS.C3PO.T1; +map EREP.R2D2.T2, target GERISS.C3PO.T2, filter(@GETENV ('TRANSACTION','CSN') > 4153892); +``` + +``` +restart replicat REPLAA +``` + + + + +