SQL> alter database add supplemental log data;
SQL> alter database add supplemental log data (primary key) columns;
SQL> grant execute to dbms_flashback to danco;
SQL> grant select any transaction to danco;
SQL> select DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER from dual;
2028207
SQL> select * from test2;
2
2
2
2
2
SQL> select * from flashback_transaction_query where table_name='TEST2' and undo_sql is not null;
03001C0039050000 2028066 22-MAR-12 2028067 22-MAR-12
DANCO 1 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAE
update "DANCO"."TEST2" set "ID" = '5' where ROWID = 'AAAS2jAAEAAAAhnAAE';
03001C0039050000 2028066 22-MAR-12 2028067 22-MAR-12
DANCO 2 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAD
update "DANCO"."TEST2" set "ID" = '5' where ROWID = 'AAAS2jAAEAAAAhnAAD';
03001C0039050000 2028066 22-MAR-12 2028067 22-MAR-12
DANCO 3 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAC
update "DANCO"."TEST2" set "ID" = '5' where ROWID = 'AAAS2jAAEAAAAhnAAC';
03001C0039050000 2028066 22-MAR-12 2028067 22-MAR-12
DANCO 4 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAB
update "DANCO"."TEST2" set "ID" = '5' where ROWID = 'AAAS2jAAEAAAAhnAAB';
040018008B040000 2015834 22-MAR-12 2015835 22-MAR-12
DANCO 1 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAE
update "DANCO"."TEST2" set "ID" = '6' where ROWID = 'AAAS2jAAEAAAAhnAAE';
040018008B040000 2015834 22-MAR-12 2015835 22-MAR-12
DANCO 2 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAD
update "DANCO"."TEST2" set "ID" = '6' where ROWID = 'AAAS2jAAEAAAAhnAAD';
040018008B040000 2015834 22-MAR-12 2015835 22-MAR-12
DANCO 3 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAC
update "DANCO"."TEST2" set "ID" = '6' where ROWID = 'AAAS2jAAEAAAAhnAAC';
040018008B040000 2015834 22-MAR-12 2015835 22-MAR-12
DANCO 4 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAB
update "DANCO"."TEST2" set "ID" = '6' where ROWID = 'AAAS2jAAEAAAAhnAAB';
8 rows selected.
SQL> exec DBMS_FLASHBACK.ENABLE_AT_SYSTEM_CHANGE_NUMBER (2028015);
PL/SQL procedure successfully completed.
SQL> select * from test2;
2
5
5
5
5
SQL> select * from flashback_transaction_query where table_name='TEST2' and undo_sql is not null;
03001C0039050000 2028066 22-MAR-12 2028067 22-MAR-12
DANCO 1 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAE
update "DANCO"."TEST2" set "ID" = '5' where ROWID = 'AAAS2jAAEAAAAhnAAE';
03001C0039050000 2028066 22-MAR-12 2028067 22-MAR-12
DANCO 2 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAD
update "DANCO"."TEST2" set "ID" = '5' where ROWID = 'AAAS2jAAEAAAAhnAAD';
03001C0039050000 2028066 22-MAR-12 2028067 22-MAR-12
DANCO 3 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAC
update "DANCO"."TEST2" set "ID" = '5' where ROWID = 'AAAS2jAAEAAAAhnAAC';
03001C0039050000 2028066 22-MAR-12 2028067 22-MAR-12
DANCO 4 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAB
update "DANCO"."TEST2" set "ID" = '5' where ROWID = 'AAAS2jAAEAAAAhnAAB';
040018008B040000 2015834 22-MAR-12 2015835 22-MAR-12
DANCO 1 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAE
update "DANCO"."TEST2" set "ID" = '6' where ROWID = 'AAAS2jAAEAAAAhnAAE';
040018008B040000 2015834 22-MAR-12 2015835 22-MAR-12
DANCO 2 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAD
update "DANCO"."TEST2" set "ID" = '6' where ROWID = 'AAAS2jAAEAAAAhnAAD';
040018008B040000 2015834 22-MAR-12 2015835 22-MAR-12
DANCO 3 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAC
update "DANCO"."TEST2" set "ID" = '6' where ROWID = 'AAAS2jAAEAAAAhnAAC';
040018008B040000 2015834 22-MAR-12 2015835 22-MAR-12
DANCO 4 UPDATE
TEST2
DANCO AAAS2jAAEAAAAhnAAB
update "DANCO"."TEST2" set "ID" = '6' where ROWID = 'AAAS2jAAEAAAAhnAAB';
8 rows selected.
SQL>
No comments:
Post a Comment