2026-05-26 08:49:05

This commit is contained in:
2026-05-26 10:49:05 +02:00
parent e470d51bda
commit 79ad48af41
2 changed files with 107 additions and 2 deletions
@@ -221,8 +221,6 @@ END;
``` ```
## Interesting things ## Interesting things
Deleting all 9999998 from source: Deleting all 9999998 from source:
@@ -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
```