Wednesday, April 10, 2013

Flashback & GoldenGate

Goldengate supports the flashback of committed transactions, but does not support flashback at the database or dropped table levels.

Supported
flashback table ... to SCN ...
flashback table ... to TIMESTAMP ...
flashback table ... to RESTORE POINT ...

Not Supported
flashback table ... to BEFORE DROP ...
flashback DATABASE ... to ...
 
Quick test with flashback table:
Pre-requisites: set these parameters:
  1. db_flashback_retention_target
  2. db_recovery_file_dest
  3. db_recovery_file_dest_size
sql> grant flashback any table to ;
sql> alter table schema.table enable row movement;

Use any table to do this test:

1) Get the current SCN#:

sql> SELECT current_scn FROM v$database;

CURRENT_SCN
-----------
   15286586

1 row selected.

2) Make some DML changes to the test table


3) sql> SELECT current_scn FROM v$database;

CURRENT_SCN
-----------
   15286648

1 row selected.


4) Flashback test table to before the latest changes:

sql> flashback table emp to scn 15286586;
Flashback complete.

Select from the test table, confirm that the table has been flashed back
Now check on the target; GG replicated the changes made with the flashback table command - tables should be in sync

5) Now flashback again to after the latest changes:

sql> flashback table emp to scn 15286648;
Flashback complete.

Source table should be restored to after the changes; and GG should have also replicated the changes.

No comments: