揭密一致性读------之UNDO回滚链
揭密一致性读------之UNDO回滚链
Table created. gyj@OCM> insert into gyj values(1,'AAAAA'); 1 row created. gyj@OCM> commit; Commit complete. gyj@OCM> var x refcursor; gyj@OCM> exec open :x for select * from gyj where id=1; PL/SQL procedure successfully completed. gyj@OCM> update gyj set name='BBBBB' where id=1; 1 row updated. gyj@OCM> commit; Commit complete. gyj@OCM> update gyj set name='CCCCC' where id=1; 1 row updated. gyj@OCM> commit; Commit complete. gyj@OCM> update gyj set name='DDDDD' where id=1; 1 row updated. gyj@OCM> commit; Commit complete. gyj@OCM> update gyj set name='EEEEE' where id=1; 1 row updated. gyj@OCM> print :x; ID NAME ---------- ---------- 1 AAAAA gyj@OCM> alter system flush buffer_cache; System altered.
[html] gyj@OCM> select * from v$transaction; ADDR XIDUSN XIDSLOT XIDSQN UBAFIL UBABLK UBASQN UBAREC STATUS START_TIME START_SCNB START_SCNW START_UEXT START_UBAFIL START_UBABLK START_UBASQN START_UBAREC SES_ADDR FLAG SPA REC NOU PTX NAME PRV_XIDUSN PRV_XIDSLT PRV_XIDSQN PTX_XIDUSN PTX_XIDSLT PTX_XIDSQN DSCN-B DSCN-W USED_UBLK USED_UREC LOG_IO PHY_IO CR_GET CR_CHANGE START_DATE DSCN_BASE DSCN_WRAP START_SCN DEPENDENT_SCN XID PRV_XID PTX_XID ---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- -------------------- ---------- ---------- ---------- ------------ ------------ ------------ ------------ ---------------- ---------- --- --- --- --- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------------ ---------- ---------- ---------- ------------- ---------------- ---------------- ---------------- 000000008FF105A0 7 2 14757 3 84972 1174 21 ACTIVE 11/02/13 18:29:52 13027640 13 3 84972 1174 21 000000009147B7E0 3587 NO NO NO NO 0 0 0 0 0 0 0 0 1 1 11 3 24 0 02-NOV-13 0 0 13027640 0 07000200A5390000 0000000000000000 0000000000000000 sys@OCM> select * from X$KTUXE where KTUXESTA='ACTIVE'; ADDR INDX INST_ID KTUXEUSN KTUXESLT KTUXESQN KTUXERDBF KTUXERDBB KTUXESCNB KTUXESCNW KTUXESTA KTUXECFL KTUXEUEL KTUXEDDBF KTUXEDDBB KTUXEPUSN KTUXEPSLT KTUXEPSQN KTUXESIZ ---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ------------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- 00002AC148607908 304 1 7 2 14757 3 84972 13027640 0 ACTIVE NONE 13 0 0 0 0 0 1 sys@OCM> select header_file,header_block from dba_segments where segment_name='_SYSSMU7_4222772309$'; HEADER_FILE HEADER_BLOCK ----------- ------------ 3 224 sys@OCM> select EXTENT_ID,FILE_ID, BLOCK_ID,BYTES,BLOCKS,STATUS from dba_undo_extents where segment_name='_SYSSMU7_4222772309$'; EXTENT_ID FILE_ID BLOCK_ID BYTES BLOCKS STATUS ---------- ---------- ---------- ---------- ---------- --------- 0 3 224 65536 8 EXPIRED 1 3 600 65536 8 EXPIRED 2 3 3200 1048576 128 EXPIRED 3 3 4992 1048576 128 EXPIRED 4 3 6528 1048576 128 EXPIRED 5 3 8192 1048576 128 EXPIRED 6 3 9600 1048576 128 EXPIRED 7 3 11136 1048576 128 EXPIRED 8 3 12800 1048576 128 EXPIRED 9 3 14208 1048576 128 EXPIRED 10 3 15744 1048576 128 EXPIRED 11 3 17408 1048576 128 EXPIRED 12 3 18688 1048576 128 EXPIRED 13 3 84864 8388608 1024 ACTIVE 14 3 178560 8388608 1024 EXPIRED sys@OCM> select * from v$rollstat; USN LATCH EXTENTS RSSIZE WRITES XACTS GETS WAITS OPTSIZE HWMSIZE SHRINKS WRAPS EXTENDSAVESHRINK AVEACTIVE STATUS CUREXT CURBLK ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------------- ---------- ---------- 0 0 6 385024 8112 0 93 0 385024 0 0 0 0 ONLINE 5 4 1 1 16 14802944 1172136 0 832 0 14802944 0 1 00 104857 ONLINE 15 45 2 2 5 3268608 930888 0 871 0 3268608 0 1 00 104857 ONLINE 3 53 3 0 17 2088960 1175554 0 948 0 2088960 0 16 140 123087 ONLINE 14 56 4 1 17 15851520 981912 0 779 0 15851520 0 1 00 104857 ONLINE 16 45 5 2 24 19259392 581992 0 688 0 19259392 0 1 00 104857 ONLINE 23 81 6 0 3 1171456 807088 0 810 0 1171456 0 1 00 104857 ONLINE 0 4 7 1 15 28434432 246082 1 361 0 28434432 0 0 0 0 ONLINE 13 108 8 2 5 3268608 843906 0 789 0 3268608 0 1 00 104857 ONLINE 4 95 9 0 12 10608640 725944 0 775 0 10608640 0 1 00 104857 ONLINE 3 75 10 1 5 2285568 800262 0 727 0 2285568 0 4 00 109093 ONLINE 2 83 ******************************************************************************** Undo Segment: _SYSSMU7_4222772309$ (7) ******************************************************************************** Extent Control Header ----------------------------------------------------------------- Extent Header:: spare1: