01,创建环境

SQL> create table t3 (id int);

Table created.

SQL> insert into t3 values(1);

1 row created.

SQL> insert into t3 values(2);

1 row created.

SQL>  insert into t3 values(3);

1 row created.

SQL> commit;

Commit complete.

02,查看块

SQL>  select dbms_rowid.rowid_relative_fno(rowid),dbms_rowid.rowid_block_number(rowid),id from t3;

DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID) DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)  ID
------------------------------------ ------------------------------------ ---------- 1 104537 1 1 104537 2 1 104537 3

03,更新事务

SQL> update t3 set id=5 where id=3;

1 row updated.

这时候更新了下数据库

04,查看回滚段

SQL> desc v$transaction  --视图信息查看
Name Null? Type
----------------------------------------- -------- ----------------------------
ADDR RAW(8)
XIDUSN NUMBER
XIDSLOT NUMBER
XIDSQN NUMBER
UBAFIL NUMBER
UBABLK NUMBER
UBASQN NUMBER
UBAREC NUMBER
STATUS VARCHAR2(16)
START_TIME VARCHAR2(20)
START_SCNB NUMBER
START_SCNW NUMBER
START_UEXT NUMBER
START_UBAFIL NUMBER
START_UBABLK NUMBER
START_UBASQN NUMBER
START_UBAREC NUMBER
SES_ADDR RAW(8)
FLAG NUMBER
SPACE VARCHAR2(3)
RECURSIVE VARCHAR2(3)
NOUNDO VARCHAR2(3)
PTX VARCHAR2(3)
NAME VARCHAR2(256)
PRV_XIDUSN NUMBER
PRV_XIDSLT NUMBER
PRV_XIDSQN NUMBER
PTX_XIDUSN NUMBER
PTX_XIDSLT NUMBER
PTX_XIDSQN NUMBER
DSCN-B NUMBER
DSCN-W NUMBER
USED_UBLK NUMBER
USED_UREC NUMBER
LOG_IO NUMBER
PHY_IO NUMBER
CR_GET NUMBER
CR_CHANGE NUMBER
START_DATE DATE
DSCN_BASE NUMBER
DSCN_WRAP NUMBER
START_SCN NUMBER
DEPENDENT_SCN NUMBER
XID RAW(8)
PRV_XID RAW(8)
PTX_XID RAW(8)
CON_ID NUMBER
Column     Datatype     Description
ADDR RAW(4 | 8) Address of the transaction state object
XIDUSN NUMBER Undo segment number
XIDSLOT NUMBER Slot number
XIDSQN NUMBER Sequence number
UBAFIL NUMBER Undo block address (UBA) filenum
UBABLK NUMBER UBA block number
UBASQN NUMBER UBA sequence number
UBAREC NUMBER UBA record number
STATUS VARCHAR2(16) Status
START_TIME VARCHAR2(20) Start time (wall clock)
START_SCNB NUMBER Start system change number (SCN) base
START_SCNW NUMBER Start SCN wrap
START_UEXT NUMBER Start extent number
START_UBAFIL NUMBER Start UBA file number
START_UBABLK NUMBER Start UBA block number
START_UBASQN NUMBER Start UBA sequence number
START_UBAREC NUMBER Start UBA record number
SES_ADDR RAW(4 | 8) User session object address
FLAG NUMBER Flag
SPACE VARCHAR2(3) YES if a space transaction
RECURSIVE VARCHAR2(3) YES if a recursive transaction
NOUNDO VARCHAR2(3) YES if a no undo transaction
PTX VARCHAR 2(3) YES if parallel transaction
NAME VARCHAR2(256) Name of a named transaction
PRV_XIDUSN NUMBER Previous transaction undo segment number
PRV_XIDSLT NUMBER Previous transaction slot number
PRV_XIDSQN NUMBER Previous transaction sequence number
PTX_XIDUSN NUMBER Rollback segment number of the parent XID
PTX_XIDSLT NUMBER Slot number of the parent XID
PTX_XIDSQN NUMBER Sequence number of the parent XID
DSCN-B NUMBER This column is obsolete and maintained for backward compatibility. The value of this column is always equal to the value in DSCN_BASE.
DSCN-W NUMBER This column is obsolete and maintained for backward compatibility. The value of this column is always equal to the value in DSCN_WRAP.
USED_UBLK NUMBER Number of undo blocks used
USED_UREC NUMBER Number of undo records used
LOG_IO NUMBER Logical I/O
PHY_IO NUMBER Physical I/O
CR_GET NUMBER Consistent gets
CR_CHANGE NUMBER Consistent changes
START_DATE DATE Start time (wall clock)
DSCN_BASE NUMBER Dependent SCN base
DSCN_WRAP NUMBER Dependent SCN wrap
START_SCN NUMBER Start SCN
DEPENDENT_SCN NUMBER Dependent SCN
XID RAW(8) Transaction XID
PRV_XID RAW(8) Previous transaction XID
PTX_XID RAW(8) Parent transaction XID
SQL> select UBAFIL,UBABLK,XIDUSN,XIDSLOT,XIDSQN,START_SCNB from v$transaction ;

    UBAFIL     UBABLK      XIDUSN    XIDSLOT    XIDSQN START_SCNB
---------- ---------- ---------- ---------- ---------- ----------
4 4955 9 16 2339 5870968
包含的信息详细内容查看上

05,查看段名

SQL> select * from v$rollname;  --这里对应的是XIDUSN  

       USN NAME                   CON_ID
---------- ------------------------------ ----------
0 SYSTEM 1
1 _SYSSMU1_762089623$ 1
2 _SYSSMU2_3062791661$ 1
3 _SYSSMU3_1499641855$ 1
4 _SYSSMU4_3564003469$ 1
5 _SYSSMU5_1728379857$ 1
6 _SYSSMU6_965511687$ 1
7 _SYSSMU7_2247632671$ 1
8 _SYSSMU8_437891266$ 1
9 _SYSSMU9_3215744559$ 1
10 _SYSSMU10_2925533193$ 1 可以查看到这个事务的Undo segment number 为9
根据这个id查找到段名为 _SYSSMU9_3215744559$
所以我们直接可以dump 出这个段头即可

06,dump 段头

SQL> alter system dump undo header '_SYSSMU9_3215744559$';

System altered.

SQL>

07,查看当前会话id

SQL> select spid from v$process where addr in (select paddr from v$session where sid=(select sid from v$mystat where rownum=1));

SPID
------------------------
1392
这个会话id 跟随着物理磁盘存储的id,寻找到这个也就能找到dump 出来的东西

这是时候去找这个文件,查看内容就有对应的信息

08,dump 块

这时候也可以dump 数据块

SQL> select UBAFIL,UBABLK,XIDUSN,XIDSLOT,XIDSQN,START_SCNB from v$transaction ;

    UBAFIL     UBABLK      XIDUSN    XIDSLOT    XIDSQN START_SCNB
---------- ---------- ---------- ---------- ---------- ----------
4 4955 9 16 2339 5870968

这里就是写了4号文件块4955块

我们就dump 这个出来

alter system dump datafile 4 block 4955;

09,或通过id dump数据块

SQL>  select dbms_rowid.rowid_relative_fno(rowid),dbms_rowid.rowid_block_number(rowid),id from t3;

DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID) DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)  ID
------------------------------------ ------------------------------------ ---------- 1 104537 1 1 104537 2 1 104537 3

所以dump 这个也可以的

alter system dump datafile 1 block 104537 ;

10,查看dump

对接上第一个dump操作

SQL> oradebug setmypid
Statement processed.
SQL> oradebug tracefile_name
/orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc
查看这个文件就行了
 [root@node12c01 oracle]# ll /orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc
-rw-r----- 1 oracle oinstall 1420 Apr 19 04:00 /orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc
[root@node12c01 oracle]# more /orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc
Trace file /orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Build label: RDBMS_12.2.0.1.0_LINUX.X64_170125
ORACLE_HOME: /orcl/app/oracle/product/12.1.0/db_1
System name: Linux
Node name: node12c01
Release: 3.10.0-693.el7.x86_64
Version: #1 SMP Tue Aug 22 21:09:27 UTC 2017
Machine: x86_64
Instance name: orcl
Redo thread mounted by this instance: 1
Oracle process number: 56
Unix process pid: 1392, image: oracle@node12c01 (TNS V1-V3) *** 2019-04-19T04:00:53.883414-04:00 (CDB$ROOT(1))
*** SESSION ID:(28.29402) 2019-04-19T04:00:53.883452-04:00
*** CLIENT ID:() 2019-04-19T04:00:53.883457-04:00
*** SERVICE NAME:(SYS$USERS) 2019-04-19T04:00:53.883462-04:00
*** MODULE NAME:(sqlplus@node12c01 (TNS V1-V3)) 2019-04-19T04:00:53.883466-04:00
*** ACTION NAME:() 2019-04-19T04:00:53.883471-04:00
*** CLIENT DRIVER:(SQL*PLUS) 2019-04-19T04:00:53.883474-04:00
*** CONTAINER ID:(1) 2019-04-19T04:00:53.883478-04:00 Processing Oradebug command 'setmypid' *** 2019-04-19T04:00:53.883507-04:00 (CDB$ROOT(1))
Oradebug command 'setmypid' console output: <none> *** 2019-04-19T04:00:59.063237-04:00 (CDB$ROOT(1))
Processing Oradebug command 'tracefile_name' *** 2019-04-19T04:00:59.063299-04:00 (CDB$ROOT(1))
Oradebug command 'tracefile_name' console output:
/orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc

dump 归类

    01,undo头信息dump

SQL> alter system dump undo header '_SYSSMU9_3215744559$';

System altered.

SQL> oradebug setmypid
Statement processed.
SQL> oradebug tracefile_name
/orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc

    02,dump整个block

SQL> select UBAFIL,UBABLK,XIDUSN,XIDSLOT,XIDSQN,START_SCNB from v$transaction;

    UBAFIL     UBABLK      XIDUSN    XIDSLOT    XIDSQN START_SCNB
---------- ---------- ---------- ---------- ---------- ----------
4 4955 9 16 2339 5870968 SQL> alter system dump datafile 4 block 4955; System altered. SQL> oradebug tracefile_name
/orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc
文件内容略

  03,按照事务进行dump

SQL> ALTER SYSTEM DUMP UNDO BLOCK '_SYSSMU9_3215744559$' XID 9 16 2339;

System altered.

SQL> oradebug tracefile_name
/orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc
 [root@node12c01 oracle]# more /orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc
Trace file /orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Build label: RDBMS_12.2.0.1.0_LINUX.X64_170125
ORACLE_HOME: /orcl/app/oracle/product/12.1.0/db_1
System name: Linux
Node name: node12c01
Release: 3.10.0-693.el7.x86_64
Version: #1 SMP Tue Aug 22 21:09:27 UTC 2017
Machine: x86_64
Instance name: orcl
Redo thread mounted by this instance: 1
Oracle process number: 56
Unix process pid: 1392, image: oracle@node12c01 (TNS V1-V3) *** 2019-04-19T04:16:25.988842-04:00 (CDB$ROOT(1))
*** SESSION ID:(28.29402) 2019-04-19T04:16:25.988868-04:00
*** CLIENT ID:() 2019-04-19T04:16:25.988873-04:00
*** SERVICE NAME:(SYS$USERS) 2019-04-19T04:16:25.988877-04:00
*** MODULE NAME:(sqlplus@node12c01 (TNS V1-V3)) 2019-04-19T04:16:25.988882-04:00
*** ACTION NAME:() 2019-04-19T04:16:25.988886-04:00
*** CLIENT DRIVER:(SQL*PLUS) 2019-04-19T04:16:25.988889-04:00
*** CONTAINER ID:(1) 2019-04-19T04:16:25.988894-04:00 *** TRACE FILE RECREATED AFTER BEING REMOVED *** ********************************************************************************
Undo Segment: _SYSSMU9_3215744559$ (9)
xid: 0x0009.010.00000923
Low Blk : (0, 0)
High Blk : (2, 127)
Object Id : ALL
Layer : ALL
Opcode : ALL
Level : 2 ********************************************************************************
UNDO BLK: Extent: 2 Block: 91 dba (file#, block#): 4,0x0000135b
xid: 0x0009.010.00000923 seq: 0x306 cnt: 0x37 irb: 0x37 icl: 0x0 flg: 0x0000 Rec Offset Rec Offset Rec Offset Rec Offset Rec Offset
---------------------------------------------------------------------------
0x01 0x1f70 0x02 0x1f1c 0x03 0x1e94 0x04 0x1e20 0x05 0x1d7c
0x06 0x1cf4 0x07 0x1c94 0x08 0x1c2c 0x09 0x1bd8 0x0a 0x1b78
0x0b 0x1b10 0x0c 0x1aa4 0x0d 0x1a50 0x0e 0x19f0 0x0f 0x197c
0x10 0x1914 0x11 0x18ac 0x12 0x184c 0x13 0x17f8 0x14 0x1798
0x15 0x16e4 0x16 0x166c 0x17 0x1604 0x18 0x159c 0x19 0x14e8
0x1a 0x143c 0x1b 0x1390 0x1c 0x12e4 0x1d 0x1238 0x1e 0x118c
0x1f 0x10e0 0x20 0x1034 0x21 0x0f88 0x22 0x0edc 0x23 0x0e30
0x24 0x0d84 0x25 0x0cd8 0x26 0x0c60 0x27 0x0bb4 0x28 0x0b4c
0x29 0x0a98 0x2a 0x0a30 0x2b 0x0984 0x2c 0x091c 0x2d 0x08b4
0x2e 0x084c 0x2f 0x07e4 0x30 0x0794 0x31 0x0714 0x32 0x06c4
0x33 0x0644 0x34 0x05d4 0x35 0x0590 0x36 0x054c 0x37 0x04a8 *-----------------------------
* Rec #0x37 slt: 0x10 objn: 78557(0x000132dd) objd: 78557 tblspc: 0(0x00000000
)
* Layer: 11 (Row) opc: 1 rci 0x00
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000Ext idx: 0
flg2: 0
*-----------------------------
uba: 0x0100135b.0306.34 ctl max scn: 0x00000000005988a6 prv tx scn: 0x000000000059
88ab
txn start scn: scn: 0x0000000000599622 logon user: 0
prev brb: 16782158 prev bcl: 0
KDO undo record:
KTB Redo
op: 0x03 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: Z
Array Update of 1 rows:
tabn: 0 slot: 2(0x2) flag: 0x2c lock: 0 ckix: 33
ncol: 1 nnew: 1 size: 0
KDO Op code: 21 row dependencies Disabled
xtype: XAxtype KDO_KDOM2 flags: 0x00000080 bdba: 0x00419859 hdba: 0x00419858
itli: 2 ispac: 0 maxfr: 4863
vect = 0
col 0: [] c1 04 +++++++++++ Next block not in extent map - rollback segment has been shrunk.
+ WARNING + Block dba (file#, block#): 0,0x00000000
+++++++++++ *************************************
Total undo blocks scanned = 1
Total undo records scanned = 1
Total undo blocks dumped = 1
Total undo records dumped = 1 ##Total warnings issued = 1
************************************* *** 2019-04-19T04:16:31.811478-04:00 (CDB$ROOT(1))
Processing Oradebug command 'tracefile_name' *** 2019-04-19T04:16:31.811531-04:00 (CDB$ROOT(1))
Oradebug command 'tracefile_name' console output:
/orcl/app/oracle/diag/rdbms/node12c01/orcl/trace/orcl_ora_1392.trc

oracle--dump 事务槽的更多相关文章

  1. ORACLE ITL事务槽

    讲到ITL(事务槽)必定先说数据块,那么什么是数据块呢?先给大家上一个数据块结构图 数据块分别由块头.ITL(事务槽).表信息区.行信息区.块空闲区.行数据区组成,其中ITL用来记录在数据块发生的所有 ...

  2. oracle ITL(事务槽)的理解

    一.ITL描述: ITL(Interested Transaction List)是Oracle数 据块内部的一个组成部分,位于数据块头(block header),itl由xid,uba,flag, ...

  3. Oracle之事务

    一,oracle的事务: 是指对数据操作的一系列动作的统称.即:事务的任务便是使数据库从一种状态变换成为另一种状态,这不同于文件系统,它是数据库所特用的. 事务有四大特性(ACID): 1,原子性(a ...

  4. MySQL表结构,表空间,段,区,页,MVCC ,undo 事务槽

    索引组织表(IOT表):为什么引入索引组织表,好处在那里,组织结构特点是什么,如何创建,创建IOT的限制LIMIT. IOT是以索引的方式存储的表,表的记录存储在索引中,索引即是数据,索引的KEY为P ...

  5. Oracle一个事务中的Insert和Update执行顺序

    今天碰到了一个奇怪的问题,是关于Oracle一个事务中的Insert和Update语句的执行顺序的问题. 首先详细说明下整个过程: 有三张表:A,B,C,Java代码中有一段代码是先在表A中插入一条数 ...

  6. 数据库事务隔离级ORACLE数据库事务隔离级别介绍

    本文系转载,原文地址:http://singo107.iteye.com/blog/1175084 数据库事务的隔离级别有4个,由低到高依次为Read uncommitted.Read committ ...

  7. [转]了解oracle自治事务

    http://blog.csdn.net/indexman/article/details/7799862 1.什么是Oracle自治事务 在官方文档中,是这样的定义的“Autonomous tran ...

  8. 浅述Oracle分布式事务概念

    着系统的复杂性不断增加,我们所面对的分布式系统渐渐增加.分布式文件系统.分布式消息队列系统等等层出不穷,在一些行业特别是互联网行业应用广泛.分布式数据库也是目前使用比较常用的分布式系统之一. 简单来说 ...

  9. Oracle - 数据更新 - 事务

    /* 事务 事务是为了控制数据异步访问所使用的一种技术 就类似于java中的锁机制 synchronized,只不过功能更加强大 事务不能进行嵌套,当我们开启一个事务的之后作的每一次dml语句都属于这 ...

  10. oracle之事务和锁

    Oracle的事务和锁(PPT-I-283-293) 10.1 什么是事务 必须具备以下四个属性,简称ACID 属性:原子性(Atomicity):  事务是一个完整的操作.事务的各步操作是不可分的( ...

随机推荐

  1. CodeForces 682B Alyona and Mex (题意水题)

    题意:给定一个序列,你可以对这里面的数用小于它的数来代替,最后让你求,改完后的最大的序列中缺少的最小的数. 析:这个题,读了两个多小时也没读懂,要是读懂了,肯定能做出来...没什么可说的,就是尽量凑1 ...

  2. zookeeper学习及安装

    HBase提示已创建表,但是list查询时,却显示表不存在. https://blog.csdn.net/liu16659/article/details/80216085 http://archiv ...

  3. Java文件路径

    几大常用的方法 Class.getResource("")    返回的是当前Class这个类所在包开始的位置 getClassLoader().getResource(" ...

  4. VS 和Visual Assist X快捷键(转)

    Visual Assist X 最有用的快捷键 1.Alt + G: 在定义与声明之间互跳. 2.Alt + O: 在.h与.cpp之间互跳.(O是字母O,不是数字零) 3.Alt + Shift + ...

  5. Oracle SQl优化总结

    对数据库技术的热爱是我唯一的安慰,毕竟这是自己喜欢的事情,还可以做下去. 因为客户项目的需要,我又开始接触Oracle,大部分工作在工作流的优化和业务数据的排查上.为了更好的做这份工作,我有参考过or ...

  6. MIPS rev.1 指令参数

    由于MIPS各个版本之间的操作数会变,如果出现无法识别的情况 需要根据官方的MIPS instruction手册逐条核对,此处的版本为Rev.1 //******MIPS-55*********// ...

  7. 菜鸟的Xamarin.Forms前行之路——实现按钮的字体图标(可扩展)

    在实际的APP中,带有图标的按钮用到地方还是蛮多的,字体图标往往能更快更生动的传达信息,并且相对于背景图片,字体图标也有着绝对的优势,所以实现按钮的字体图标是值得尝试的. 实现方法:各平台自定义渲染按 ...

  8. Delphi32位程序拷贝system32目录中文件解决方法!

    源码下载:http://download.csdn.net/detail/sunylat/9740352 unit Unit1; interface uses Winapi.Windows, Wina ...

  9. [Maven实战-许晓斌]-[第二章]-2.1在Windows上安装maven

    来源:<maven实战>   1.检查JAVA_HOME和java -version C:\Users\admin>echo %JAVA_HOME% C:\Users\admin&g ...

  10. 谷歌支付服务端详细讲解(PHP)

    前不久公司拓展海外市场,要接入google支付.刚开始一头雾水,相关的文档实在太少.而且很多东西都需要FQ,不过好在摸索几天后,总算调试通了. 前提:FQ 1.注册账号google账号 https:/ ...