日期:2014-05-16  浏览次数:20561 次

揭密一致性读------之UNDO回滚链

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/14088663

gyj@OCM> create table gyj(id int,name char(2000));


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.


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