oracle之flashback深入研究(六)
rom t1;
ID SAL JOB
---------- ---------- ----------
2 3 b
2 1 a
D
SQL> update t1 set id=3 where job='D';
1 row updated.
SQL> commit;
Commit complete.
SQL> select versions_startscn,versions_endscn,versions_xid,versions_operation,id,sal,job from t1 versions between scn minvalue and maxvalue;
VERSIONS_STARTSCN VERSIONS_ENDSCN VERSIONS_XID V ID SAL JOB
----------------- --------------- ---------------- - ---------- ---------- ----------
11144497 0D001600D8000000 D 1 9 z
11144497 1 9 z
11211146 0B001600DF000000 U 3 D
11144497 0D001600D8000000 D 1 3 b
11144497 0D001600D8000000 D 1 2 a
11144497 1 2 a
2 3 b
11144497 1 3 b
2 1 a
11211146 D
10 rows selected.
SQL> select xid,logon_user,start_scn,operation,table_name,row_id,undo_sql from flashback_transaction_query where xid='0B001600DF000000';
^CERROR:
ORA-01013: user requested cancel of current operation
no rows selected
SQL> set timing on
SQL> r
1* select xid,logon_user,start_scn,operation,table_name,row_id,undo_sql from flashback_transaction_query where xid='0B001600DF000000'
XID LOGON_USER START_SCN OPERATION
---------------- ------------------------------ ---------- --------------------------------
TABLE_NAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ROW_ID
-------------------
UNDO_SQL
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0B001600DF000000 SYS 11211144 UPDATE
T1
AAASCgAAFAAAACHAAF
update "SYS"."T1" set "ID" = NULL where ROWID = 'AAASCgAAFAAAACHAAF';
XID LOGON_USER START_SCN OPERATION
---------------- ------------------------------ ---------- --------------------------------
TABLE_NAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ROW_ID
-------------------
UNDO_SQL
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0B001600DF000000 SYS 11211144 BEGIN
Elapsed: 00:03:40.77
SQL>
可以看到sql了。
那么之前的事务是不是也能自动再重新记录sql呢?答案是否定的如下:
SQL> select xid,logon_user,start_scn,operation,table_name,row_id,undo_sql from f