At the beginning, we first use an experiment to introduce the transaction:
- Sys @ ORCL>SelectXid, xidusn, xidslot, xidsqn, ubablk, ubafilFromV $Transaction;
-
- No RowsSelected
The corresponding transaction information is not found. Use hr to initiate a transaction:
- Hr @ ORCL>Select*FromP;
-
- ID TEST
- ---------------
- 2 f
- 3g
- 1
- Hr @ ORCL>UpdatePSetTest ='W' WhereId = 1;
-
- 1 row updated.
View transaction information again:
- Sys @ ORCL>/
-
- XID XIDUSN XIDSLOT XIDSQN UBABLK UBAFIL
- ------------------------------------------------------------------
- 02000800E2010000 2 8 482 3339 2
View the rollback segments of the hr initiating firm:
- Sys @ ORCL>SelectXidusn, sid, usernameFromV $TransactionT, v $ session sWhereT. ses_addr = s. saddr;
-
- XIDUSN SID USERNAME
- --------------------------------------------------
- 2 141 HR
- 9 158 SCOTT
View the segment name of rollback segment 2:
- Sys @ ORCL>Select*FromV $ rollname;
-
- USNNAME
- ----------------------------------------
- 0 SYSTEM
- 1 _ SYSSMU1 $
- 2 _ SYSSMU2 $
- 3 _ SYSSMU3 $
- 4_syssmu4 $
- 5_syssmu5 $
- 6_syssmu6 $
- 7 _ SYSSMU7 $
- 8_syssmu8 $
- 9 _ SYSSMU9 $
- 10 _ SYSSMU10 $
-
- 11RowsSelected.
Then dump the segment header of the rollback segment No. 2 to the udump directory:
- Sys @ ORCL>SelectHeader_block, header_fileFromDba_segmentsWhereSegment_name ='_ SYSSMU2 $';
-
- HEADER_BLOCK HEADER_FILE
- -----------------------
- 41 2
-
- Sys @ ORCL>AlterSystem dump undo header'_ SYSSMU2 $';
-
- System altered.
- View the process ID of the server process in the current session:
- Sys @ ORCL>SelectSpidFromV $ processWhereAddrIn(SelectPaddrFromV $ sessionWhereSid = (SelectSidFromV $ mystatWhereRownum = 1 ));
-
- SPID
- ------------
- 5446