oracle之flashback深入研究(二)

2014-11-24 16:05:56 · 作者: · 浏览: 2
t bit: 4 (post-11) padding: 1
op: L itl: xid: 0x0010.000.000000cb uba: 0x02006433.024f.39
flg: C--- lkc: 0 scn: 0x0000.00a832c7
KDO Op code: DRP row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x0080f7a9 hdba: 0x0080039a
itli: 1 ispac: 0 maxfr: 4858
tabn: 0 slot: 27(0x1b)
SQL> select to_number('a82f35','xxxxxxxxxxxxxxxx') sc from dual;
SC
----------
11022133
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
11054748
SQL>
注意:闪回查询和undo_retention有直接关系;
eg:
SQL> update t1 set job='ab' where id=1;
3 rows updated.
SQL> select versions_starttime,versions_endtime,versions_xid,versions_operation,id,sal from t1 versions between timestamp minvalue and maxvalue
2 ;
VERSIONS_STARTTIME VERSIONS_ENDTIME VERSIONS_XID V ID SAL
--------------------------------------------------------------------------- -------------------- ---------------- - ---------- ----------
1 9
1 2
2 3
1 3
2 1
6 rows selected.
SQL> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
_optimizer_undo_cost_change string 11.2.0.1
_undo_autotune boolean FALSE
undo_management string AUTO
undo_retention integer 60
undo_tablespace string UNDOTBS3
SQL> alter system set undo_retention=1800;
System altered.
SQL> select versions_starttime,versions_endtime,versions_xid,versions_operation,id,sal from t1 versions between timestamp minvalue and maxvalue;
VERSIONS_STARTTIME VERSIONS_ENDTIME VERSIONS_XID V ID SAL
--------------------------------------------------------------------------- -------------------- ---------------- - ---------- ----------
1 9
24-AUG-13 09.49.38 PM 11000300BF000000 D 3 4
1 2
2 3
24-AUG-13 09.49.38 P 3 4
M
1 3
2 1
8 rows selected.
1)闪回查询:
SQL> select * from t1 ;
ID SAL JOB
---------- ---------- ----------
1 9 z
1 2 a
2 3 b
1 3 b
2 1 a
D
6 rows selected.
SQL> select * from t1 a