标签:事务 transactions 回滚块 数据块 事务槽争用
select xid,xidusn,xidslot,xidsqn,ubablk,ubafil from v$transaction;// lists the active transactions in the system. null null null null null null insert into t values(1,‘zhangsan‘); select xid,xidusn,xidslot,xidsqn,ubablk,ubafil from v$transaction; 070017008F020000 7 23 655 1037 3//当前活动事务 COMMIT
select xid,xidusn,xidslot,xidsqn,ubablk,ubafil from v$transaction;null null null null null null//说明事务已经被提交了
|
回滚段的段头块
0 SYSTEMselect * from v$rollname; 1 _SYSSMU1_3780397527$ 2 _SYSSMU2_2232571081$ 3 _SYSSMU3_2097677531$ 4 _SYSSMU4_1152005954$ 5 _SYSSMU5_1527469038$ 6 _SYSSMU6_2443381498$ 7 _SYSSMU7_3286610060$ 8 _SYSSMU8_2012382730$ 9 _SYSSMU9_1424341975$ 10 _SYSSMU10_3550978943$ select header_block,header_file from dba_segments where segment_name=‘_SYSSMU1_3780397527$‘;
128 3
alter system dump undo header ‘_SYSSMU1_3780397527$‘;//转储回滚段头
查看当前会话的进程编号
select spid from v$process where addr in (select paddr from v$session where sid=(select sid from v$mystat where rownum=1)); spid//server process ID
5179
alter system dump undo header ‘_SYSSMU1_3780397527$‘;//转储回滚段
alter system dump datafile 5 block 4308;//转储回滚段数据块
|
INI_TRANS MAX_TRANS ---------- ---------- 1 255 |
UBAFIL, UBABLK, XIDUSN, XIDSLOT, XIDSQN, START_SCNB 3 11254 9 19 868 1234672 //UBA的文件号,块号,回滚块的段头块,表中的哪一行记录,记录被覆盖第几次(这些信息既存在事务表中也存在事务操作中) |
0 SYSTEM 1 _SYSSMU1_3780397527$ 2 _SYSSMU2_2232571081$ 3 _SYSSMU3_2097677531$ 4 _SYSSMU4_1152005954$ 5 _SYSSMU5_1527469038$ 6 _SYSSMU6_2443381498$ 7 _SYSSMU7_3286610060$ 8 _SYSSMU8_2012382730$ 9 _SYSSMU9_1424341975$ 10 _SYSSMU10_3550978943$ |
SQL> select spid from v$process where addr in (select paddr from v$session where sid=(select sid from v$mystat where rownum=1)); 2 SPID ------------------------ 11175//通过server Pro来到udump中查找对应的文件 |
SQL> show parameter dump NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ background_core_dump string partial background_dump_dest string /u01/app/oracle/diag/rdbms/jia gulun/jiagulun/trace core_dump_dest string /u01/app/oracle/diag/rdbms/jia gulun/jiagulun/cdump max_dump_file_size string unlimited shadow_core_dump string partial user_dump_dest string /u01/app/oracle/diag/rdbms/jia gulun/jiagulun/trace SQL> |
[oracle@localhost trace]$ cat jiagulun_ora_11175.trc Trace file /u01/app/oracle/diag/rdbms/jiagulun/jiagulun/trace/jiagulun_ora_11175.trc Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options ORACLE_HOME = /u01/app/product/11.2.0/db_1 System name: Linux Node name: localhost.localdomain Release: 2.6.18-194.el5 Version: #1 SMP Tue Mar 16 21:52:39 EDT 2010 Machine: x86_64 Instance name: jiagulun Redo thread mounted by this instance: 1 Oracle process number: 29 Unix process pid: 11175, image: oracle@localhost.localdomain (TNS V1-V3) *** 2015-01-03 00:05:56.449 *** SESSION ID:(36.245) 2015-01-03 00:05:56.449 *** CLIENT ID:() 2015-01-03 00:05:56.449 *** SERVICE NAME:(SYS$USERS) 2015-01-03 00:05:56.449 *** MODULE NAME:(sqlplus@localhost.localdomain (TNS V1-V3)) 2015-01-03 00:05:56.449 *** ACTION NAME:() 2015-01-03 00:05:56.449 ******************************************************************************** Undo Segment: _SYSSMU8_2012382730$ (8) ******************************************************************************** Extent Control Header ----------------------------------------------------------------- Extent Header:: spare1: 0 spare2: 0 #extents: 3 #blocks: 143 last map 0x00000000 #maps: 0 offset: 4080 Highwater:: 0x00c000fc ext#: 1 blk#: 4 ext size: 8 #blocks in seg. hdr‘s freelists: 0 #blocks below: 0 mapblk 0x00000000 offset: 1 Unlocked Map Header:: next 0x00000000 #extents: 3 obj#: 0 flag: 0x40000000 Extent Map ----------------------------------------------------------------- 0x00c000f1 length: 7 0x00c000f8 length: 8 0x00c02c00 length: 128 Retention Table ----------------------------------------------------------- Extent Number:0 Commit Time: 1420272055 Extent Number:1 Commit Time: 1420272055 Extent Number:2 Commit Time: 1420267116 TRN CTL:: seq: 0x00b3 chd: 0x001b ctl: 0x0020 inc: 0x00000000 nfb: 0x0002 mgc: 0xb000 xts: 0x0068 flg: 0x0001 opt: 2147483646 (0x7ffffffe) uba: 0x00c000fc.00b3.09 scn: 0x0000.0013265c Version: 0x01 FREE BLOCK POOL:: uba: 0x00c000fc.00b3.0b ext: 0x1 spc: 0x1a54 uba: 0x00c000fa.00b3.33 ext: 0x1 spc: 0x680 uba: 0x00000000.00b1.2d ext: 0x2 spc: 0x11bc uba: 0x00000000.0000.00 ext: 0x0 spc: 0x0 uba: 0x00000000.0000.00 ext: 0x0 spc: 0x0 TRN TBL:: index state cflags wrap# uel scn dba parent-xid nub stmt_num cmt ------------------------------------------------------------------------------------------------ 0x00 9 0x00 0x0355 0x0016 0x0000.00132a0f 0x00c000f6 0x0000.000.00000000 0x00000001 0x00000000 1420272011 .... . ... .... ... ...... .... .... .... ... .... 0x20 9 0x00 0x0355 0xffff 0x0000.00132b09 0x00c000fc 0x0000.000.00000000 0x00000001 0x00000000 1420272233 0x21 9 0x00 0x0354 0x000a 0x0000.00132900 0x00c000f6 0x0000.000.00000000 0x00000001 0x00000000 1420271514 EXT TRN CTL:: usn: 8 sp1:0x00000000 sp2:0x00000000 sp3:0x00000000 sp4:0x00000000 sp5:0x00000000 sp6:0x00000000 sp7:0x7fff00000000 sp8:0x00000000 EXT TRN TBL:: index extflag extHash extSpare1 extSpare2 --------------------------------------------------- 0x00 0x00000000 0x00000000 0x00000000 0x00000000 ... ..... ..... .... ... 0x21 0x00000000 0x00000000 0x00000000 0x00000000 [oracle@localhost trace]$ |
标签:事务 transactions 回滚块 数据块 事务槽争用
原文地址:http://blog.csdn.net/u011218159/article/details/43924211