Oracle dump datafile block有两种方式:

然后根据block id执行dump 命令:

SQL> alter system dump datafile 4 block 20;

如果要dump 多个block,命令如下:

SQL>ALTER SYSTEM dump datafile <file_id> block min<block_id> block max <block_id+blocks-1>;

根据Rowid 查询对应的block number 和datafile number:

SQL> SELECT dbms_rowid.rowid_relative_fno(rowid) REL_FNO,

       dbms_rowid.rowid_block_number(rowid) BLOCKNO,

       dbms_rowid.rowid_row_number(rowid) ROWNO,

       empno,

       ename

  FROM emp

 WHERE empno = 7369;  2    3    4    5    6    7

REL_FNO    BLOCKNO    ROWNO      EMPNO ENAME

---------- ---------- ---------- ---------- ----------

  4   151        0       7369 SMITH

然后根据block id执行dump 命令:

SQL> alter system dump datafile 4 block 151;

Trace file /oracle/app/diag/rdbms/june/june/trace/june_ora_21915.trc

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

ORACLE_HOME = /oracle/app/product/11.2.0/db

System name: Linux

Node name: june

Release: 2.6.18-128.el5

Version: #1 SMP Wed Jan 21 10:44:23 EST 2009

Machine: i686

Instance name: june

Redo thread mounted by this instance: 1

Oracle process number: 26

Unix process pid: 21915, image: oracle@june (TNS V1-V3)

*** 2000-11-19 11:56:48.345

*** SESSION ID:(39.120) 2000-11-19 11:56:48.345

*** CLIENT ID:() 2000-11-19 11:56:48.345

*** SERVICE NAME:(SYS$USERS) 2000-11-19 11:56:48.345

*** MODULE NAME:(sqlplus@june (TNS V1-V3)) 2000-11-19 11:56:48.345

*** ACTION NAME:() 2000-11-19 11:56:48.345

 

Start dump data blocks tsn: 4 file#:4 minblk 151 maxblk 151

Block dump from cache:

Dump of buffer cache at level 4 for tsn=4, rdba=16777367

BH (0x29be801c) file#: 4 rdba: 0x01000097 (4/151) class: 1 ba: 0x298ea000

  set: 3 pool 3 bsz: 8192 bsi: 0 sflg: 1 pwc: 0,25

  dbwrid: 0 obj: 73181 objn: 73181 tsn: 4 afn: 4 hint: f

  hash: [0x34b657a4,0x34b657a4] lru: [0x21be7530,0x29fec3dc]

  ckptq: [NULL] fileq: [NULL] objq: [0x2d6a7858,0x223f4a1c]

  st: XCURRENT md: NULL tch: 2

  flags:

  LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]

  cr pin refcnt: 0 sh pin refcnt: 0

Block dump from disk:

buffer tsn: 4 rdba: 0x01000097 (4/151)

scn: 0x0000.000b6f31 seq: 0x01 flg: 0x06 tail: 0x6f310601

frmt: 0x02 chkval: 0xf091 type: 0x06=trans data

Hex dump of block: st=0, typ_found=1

Dump of memory from 0x00DCA600 to 0x00DCC600

DCA600 0000A206 01000097 000B6F31 06010000  [........1o......]

DCA610 0000F091 00000001 00011DDD 000B6F2F  [............/o..]

DCA620 00000000 00320002 01000090 00100001  [......2.........]

DCA630 00000198 00C15AB0 00120061 0000200E  [.....Z..a.... ..]

DCA640 000B6F31 00000000 00000000 00000000  [1o..............]

DCA650 00000000 00000000 00000000 00000000  [................]

DCA660 00000000 000E0100 002EFFFF 1D331D61  [............a.3.]

DCA670 00001D33 1F72000E 1F1C1F47 1EC61EF3  [3.....r.G.......]

DCA680 1E741E9D 1E261E4C 1DD51DFB 1D881DAF  [..t.L.&.........]

DCA690 00001D61 00000000 00000000 00000000  [a...............]

DCA6A0 00000000 00000000 00000000 00000000  [................]

        Repeat 465 times

DCC3C0 00000000 08012C00 2350C203 4C494D06  [.....,....P#.MIL]

DCC3D0 0552454C 52454C43 4EC2034B B6770753  [LER.CLERK..NS.w.]

DCC3E0 01011701 0EC20201 0BC102FF 0308012C  [............,...]

DCC3F0 040350C2 44524F46 414E4107 5453594C  [.P..FORD.ANALYST]

DCC400 434CC203 0CB57707 01010103 FF1FC202  [..LC.w..........]

DCC410 2C15C102 C2020801 414A0550 0553454D  [...,....P.JAMES.]

DCC420 52454C43 4DC2034B B5770763 0101030C  [CLERK..Mc.w.....]

DCC430 0AC20301 C102FF33 08012C1F 4D4FC203  [....3....,....OM]

DCC440 41444105 4305534D 4B52454C 594EC203  [.ADAMS.CLERK..NY]

DCC450 05BB7707 01010117 FF0CC202 2C15C102  [.w.............,]

DCC460 C2030801 54062D4F 454E5255 41530852  [....O-.TURNER.SA]

DCC470 4D53454C C2034E41 7707634D 010809B5  [LESMAN..Mc.w....]

DCC480 C2020101 02800110 012C1FC1 4FC20308  [..........,....O]

DCC490 494B0428 5009474E 49534552 544E4544  [(.KING.PRESIDENT]

DCC4A0 B57707FF 0101110B 33C20201 0BC102FF  [..w........3....]

DCC4B0 0308012C 05594EC2 544F4353 4E410754  [,....NY.SCOTT.AN]

DCC4C0 53594C41 4CC20354 BB770743 01011304  [ALYST..LC.w.....]

DCC4D0 1FC20201 15C102FF 0308012C 05534EC2  [........,....NS.]

DCC4E0 52414C43 414D074B 4547414E 4FC20352  [CLARK.MANAGER..O]

DCC4F0 B5770728 01010906 19C20301 C102FF33  [(.w.........3...]

DCC500 08012C0B 634DC203 414C4205 4D07454B  [.,....Mc.BLAKE.M]

DCC510 47414E41 C2035245 7707284F 010105B5  [ANAGER..O(.w....]

DCC520 C2030101 02FF331D 012C1FC1 4DC20308  [.....3....,....M]

DCC530 414D0637 4E495452 4C415308 414D5345  [7.MARTIN.SALESMA]

DCC540 4DC2034E B5770763 01011C09 0DC20301  [N..Mc.w.........]

DCC550 0FC20233 2C1FC102 C2030801 4A05434C  [3......,....LC.J]

DCC560 53454E4F 4E414D07 52454741 284FC203  [ONES.MANAGER..O(]

DCC570 04B57707 01010102 4C1EC203 15C102FF  [.w.........L....]

DCC580 0308012C 04164CC2 44524157 4C415308  [,....L..WARD.SAL]

DCC590 414D5345 4DC2034E B5770763 01011602  [ESMAN..Mc.w.....]

DCC5A0 0DC20301 06C20233 2C1FC102 C2030801  [....3......,....]

DCC5B0 4105644B 4E454C4C 4C415308 414D5345  [Kd.ALLEN.SALESMA]

DCC5C0 4DC2034E B5770763 01011402 11C20201  [N..Mc.w.........]

DCC5D0 0204C202 012C1FC1 4AC20308 4D530546  [......,....JF.SM]

DCC5E0 05485449 52454C43 50C2034B B4770703  [ITH.CLERK..P..w.]

DCC5F0 0101110C 09C20201 15C102FF 6F310601  [..............1o]

Block header dump:  0x01000097

 Object id on Block? Y

 seg/obj: 0x11ddd  csc: 0x00.b6f2f  itc: 2  flg: E  typ: 1 - DATA

     brn: 0  bdba: 0x1000090 ver: 0x01 opc: 0

     inc: 0  exflg: 0

 

 Itl           Xid                  Uba         Flag  Lck        Scn/Fsc

0x01   0x0001.010.00000198  0x00c15ab0.0061.12  --U-   14  fsc 0x0000.000b6f31

0x02   0x0000.000.00000000  0x00000000.0000.00  ----    0  fsc 0x0000.00000000

bdba: 0x01000097

data_block_dump,data header at 0xdca664

===============

tsiz: 0x1f98

hsiz: 0x2e

pbl: 0x00dca664

     76543210

flag=--------

ntab=1

nrow=14

frre=-1

fsbo=0x2e

fseo=0x1d61

avsp=0x1d33

tosp=0x1d33

0xe:pti[0] nrow=14 offs=0

0x12:pri[0] offs=0x1f72

0x14:pri[1] offs=0x1f47

0x16:pri[2] offs=0x1f1c

0x18:pri[3] offs=0x1ef3

0x1a:pri[4] offs=0x1ec6

0x1c:pri[5] offs=0x1e9d

0x1e:pri[6] offs=0x1e74

0x20:pri[7] offs=0x1e4c

0x22:pri[8] offs=0x1e26

0x24:pri[9] offs=0x1dfb

0x26:pri[10] offs=0x1dd5

0x28:pri[11] offs=0x1daf

0x2a:pri[12] offs=0x1d88

0x2c:pri[13] offs=0x1d61

block_row_dump:

tab 0, row 0, @0x1f72

tl: 38 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4a 46

col  1: [ 5]  53 4d 49 54 48

col  2: [ 5]  43 4c 45 52 4b

col  3: [ 3]  c2 50 03

col  4: [ 7]  77 b4 0c 11 01 01 01

col  5: [ 2]  c2 09

col  6: *NULL*

col  7: [ 2]  c1 15

tab 0, row 1, @0x1f47

tl: 43 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4b 64

col  1: [ 5]  41 4c 4c 45 4e

col  2: [ 8]  53 41 4c 45 53 4d 41 4e

col  3: [ 3]  c2 4d 63

col  4: [ 7]  77 b5 02 14 01 01 01

col  5: [ 2]  c2 11

col  6: [ 2]  c2 04

col  7: [ 2]  c1 1f

tab 0, row 2, @0x1f1c

tl: 43 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4c 16

col  1: [ 4]  57 41 52 44

col  2: [ 8]  53 41 4c 45 53 4d 41 4e

col  3: [ 3]  c2 4d 63

col  4: [ 7]  77 b5 02 16 01 01 01

col  5: [ 3]  c2 0d 33

col  6: [ 2]  c2 06

col  7: [ 2]  c1 1f

tab 0, row 3, @0x1ef3

tl: 41 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4c 43

col  1: [ 5]  4a 4f 4e 45 53

col  2: [ 7]  4d 41 4e 41 47 45 52

col  3: [ 3]  c2 4f 28

col  4: [ 7]  77 b5 04 02 01 01 01

col  5: [ 3]  c2 1e 4c

col  6: *NULL*

col  7: [ 2]  c1 15

tab 0, row 4, @0x1ec6

tl: 45 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4d 37

col  1: [ 6]  4d 41 52 54 49 4e

col  2: [ 8]  53 41 4c 45 53 4d 41 4e

col  3: [ 3]  c2 4d 63

col  4: [ 7]  77 b5 09 1c 01 01 01

col  5: [ 3]  c2 0d 33

col  6: [ 2]  c2 0f

col  7: [ 2]  c1 1f

tab 0, row 5, @0x1e9d

tl: 41 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4d 63

col  1: [ 5]  42 4c 41 4b 45

col  2: [ 7]  4d 41 4e 41 47 45 52

col  3: [ 3]  c2 4f 28

col  4: [ 7]  77 b5 05 01 01 01 01

col  5: [ 3]  c2 1d 33

col  6: *NULL*

col  7: [ 2]  c1 1f

tab 0, row 6, @0x1e74

tl: 41 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4e 53

col  1: [ 5]  43 4c 41 52 4b

col  2: [ 7]  4d 41 4e 41 47 45 52

col  3: [ 3]  c2 4f 28

col  4: [ 7]  77 b5 06 09 01 01 01

col  5: [ 3]  c2 19 33

col  6: *NULL*

col  7: [ 2]  c1 0b

tab 0, row 7, @0x1e4c

tl: 40 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4e 59

col  1: [ 5]  53 43 4f 54 54

col  2: [ 7]  41 4e 41 4c 59 53 54

col  3: [ 3]  c2 4c 43

col  4: [ 7]  77 bb 04 13 01 01 01

col  5: [ 2]  c2 1f

col  6: *NULL*

col  7: [ 2]  c1 15

tab 0, row 8, @0x1e26

tl: 38 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4f 28

col  1: [ 4]  4b 49 4e 47

col  2: [ 9]  50 52 45 53 49 44 45 4e 54

col  3: *NULL*

col  4: [ 7]  77 b5 0b 11 01 01 01

col  5: [ 2]  c2 33

col  6: *NULL*

col  7: [ 2]  c1 0b

tab 0, row 9, @0x1dfb

tl: 43 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4f 2d

col  1: [ 6]  54 55 52 4e 45 52

col  2: [ 8]  53 41 4c 45 53 4d 41 4e

col  3: [ 3]  c2 4d 63

col  4: [ 7]  77 b5 09 08 01 01 01

col  5: [ 2]  c2 10

col  6: [ 1]  80

col  7: [ 2]  c1 1f

tab 0, row 10, @0x1dd5

tl: 38 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 4f 4d

col  1: [ 5]  41 44 41 4d 53

col  2: [ 5]  43 4c 45 52 4b

col  3: [ 3]  c2 4e 59

col  4: [ 7]  77 bb 05 17 01 01 01

col  5: [ 2]  c2 0c

col  6: *NULL*

col  7: [ 2]  c1 15

tab 0, row 11, @0x1daf

tl: 38 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 2]  c2 50

col  1: [ 5]  4a 41 4d 45 53

col  2: [ 5]  43 4c 45 52 4b

col  3: [ 3]  c2 4d 63

col  4: [ 7]  77 b5 0c 03 01 01 01

col  5: [ 3]  c2 0a 33

col  6: *NULL*

col  7: [ 2]  c1 1f

tab 0, row 12, @0x1d88

tl: 39 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 50 03

col  1: [ 4]  46 4f 52 44

col  2: [ 7]  41 4e 41 4c 59 53 54

col  3: [ 3]  c2 4c 43

col  4: [ 7]  77 b5 0c 03 01 01 01

col  5: [ 2]  c2 1f

col  6: *NULL*

col  7: [ 2]  c1 15

tab 0, row 13, @0x1d61

tl: 39 fb: --H-FL-- lb: 0x1  cc: 8

col  0: [ 3]  c2 50 23

col  1: [ 6]  4d 49 4c 4c 45 52

col  2: [ 5]  43 4c 45 52 4b

col  3: [ 3]  c2 4e 53

col  4: [ 7]  77 b6 01 17 01 01 01

col  5: [ 2]  c2 0e

col  6: *NULL*

col  7: [ 2]  c1 0b

end_of_block_dump

End dump data blocks tsn: 4 file#: 4 minblk 151 maxblk 151

从End dump data blocks tsn: 4 file#: 4 minblk 151 maxblk 151 可以看到是dump了 数据文件4的151号块

这里的row 13下的colo col1 ....代表每列对应的值 可以看到 这个有8列

col  0: [ 3]  c2 50 23 表示第一列的值为7934

SQL> declare n number;

  2  begin

  3  dbms_stats.convert_raw_value('c25023',n);

  4   dbms_output.put_line(n);

  5  end;

  6  /

7934

PL/SQL procedure successfully completed.

col  1: [ 6]  4d 49 4c 4c 45 52  第2列的值为

SQL> declare n VARCHAR2(10);

  2  begin

  3  dbms_stats.convert_raw_value('4d494c4c4552',n);

  4  dbms_output.put_line(n);

  5  end;

  6  /

MILLER

PL/SQL procedure successfully completed.

col  2: [ 5]  43 4c 45 52 4b 第3列的值为

SQL> declare n VARCHAR2(9);

  2  begin

  3  dbms_stats.convert_raw_value('434c45524b',n);

  4  dbms_output.put_line(n);

  5  end;

  6  /

CLERK

PL/SQL procedure successfully completed.

col  3: [ 3]  c2 4e 53 第4列的值为:

SQL> declare n number

  2  ;

  3  begin

  4  dbms_stats.convert_raw_value('c24e53',n);

  5  dbms_output.put_line(n);

  6  end;

  7  /

7782

PL/SQL procedure successfully completed

col  4: [ 7]  77 b6 01 17 01 01 01 第5列的值为:

SQL> declare n date;

  2  begin

  3  dbms_stats.convert_raw_value('77b60117010101',n);

  4  dbms_output.put_line(n);

  5  end;

  6  /

23-JAN-82

PL/SQL procedure successfully completed.

col  5: [ 2]  c2 0e  第6列的值为;

SQL> declare n NUMBER(7,2);

  2  begin

  3  dbms_stats.convert_raw_value('c20e',n);

  4  dbms_output.put_line(n);

  5  end;

  6  /

1300

PL/SQL procedure successfully completed.

col  6: *NULL*  第7列为空值

col  7: [ 2]  c1 0b 第8列的值为

SQL> declare n NUMBER(2);

  2  begin

  3  dbms_stats.convert_raw_value('c10b',n);

  4  dbms_output.put_line(n);

  5  end;

  6  /

10

PL/SQL procedure successfully completed.

查看这条记录的值:

SQL> select * from emp where empno=7934;

EMPNO ENAME      JOB        MGR HIREDATE     SAL       COMM     DEPTNO

---------- ---------- --------- ---------- --------- ---------- ---------- ----------

      7934 MILLER     CLERK       7782 23-JAN-82    1300      10

dump datafile block的更多相关文章

  1. Oracle ITL(Interested Transaction List)理解

    ITL(Interested Transaction List) ITL是位于数据块头部的事物槽列表,它是由一系列的ITS(Interested Transaction Slot,事物槽)组成,其初始 ...

  2. oracle dump数据库

    最近正在看老白的<DBA的思想天空>,了解数据块结构,想通过dump data block验证oracle对于行尾的NULL,是不占用存储空间的. 我们先来看一下怎样dump数据块: 1. ...

  3. Oracle中 根据 file# 和 block# 找到对象

    我们在10046生产的trace 文件里经常看到下面的信息. 表示系统在等待散列读取某个文件号的某个块开始的8个块. WAIT #6: nam='db file scattered read' ela ...

  4. oracle dump event

    一.Memory Dumps 1).Global Area ALTER SESSION SET EVENTS 'immediate trace name global_area level n'; 1 ...

  5. oracle跟踪事件(dump)总结

    一.Oracle跟踪文件 Oracle跟踪文件分为三种类型,一种是后台报警日志文件,记录数据库在启动.关闭和运行期间后台进程的活动情况,如表空间创建.回滚段创建.某些alter命令.日志切换.错误消息 ...

  6. Oracle corrupt block(坏块) 详解

    转自:http://blog.csdn.net/tianlesoftware/article/details/5024966 一. 坏块说明 1.1 相关链接 在看坏块之前,先看几个相关的链接,在后面 ...

  7. 定位表的数据块并且dump出来

    SQL> select * from city;         ID NAME ---------- ----------          7 Chicago          6 Jers ...

  8. 如何获取数据块结构信息dump

    有个pub_department的表,索引为PK_PUB_DEPARTMENT. 1.找到object_id select   object_id from dba_objects s  where  ...

  9. B*tree dump

    Oracle的索引是以平衡树的方式组织存储的:保存的是索引列的值,以及该行的rowid的一部分(文件号,块号,行号) 下面我们通过例子来了解一下: 1,create table test(id int ...

随机推荐

  1. C# HTTP 请求

    public class HttpHelper { /// <summary> /// 创建GET方式的HTTP请求 /// </summary> public static ...

  2. 安卓百度地图开发so文件引用失败问题研究

    博客: 安卓之家 微博: 追风917 CSDN: 蒋朋的家 简书: 追风917 博客园: 追风917 # 问题 首先,下面的问题基本都是在Android Studio下使用不当导致,eclipse是百 ...

  3. Angularjs总结(八)$ cookie和$rootscope

    AngularJS 提供了很好的 $cookie 和 $cookieStore API 用来处理 cookies .这两个服务都能够很好的发挥HTML5 cookies,当HTML5 API可用时浏览 ...

  4. WPF动画之关键帧动画(2)

    XAML代码: <Window x:Class="关键帧动画.MainWindow" xmlns="http://schemas.microsoft.com/win ...

  5. 无刷新分页 Ajax,JQuery,Json

    1.数据库设计 字段:Id(int) , Msg(varchar(MAX)) , PostDate(datetime) 2.自定义SQL查询方法(强类型DataSet) //SelectCount() ...

  6. HTTP_USER_AGENT

    <!DOCTYPE html><html><head><meta charset="UTF-8" /><title>We ...

  7. CentOs install oracle instant client

    rpm -ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm rpm -ivh oracle-instantclient11.2-de ...

  8. 【自用代码】Json转对象

    private static object JsonToObject(string jsonString, object obj) { var serializer = new DataContrac ...

  9. php随机生成福彩双色球号码

    发布:thebaby   来源:net     [大 中 小] 不瞒您说,俺也是个双色球爱好者,经常买,但迟迟没有中过一等奖,哈哈.这里为大家介绍用php随机生成福彩双色球号码的二种方法,供朋友们学习 ...

  10. python学习笔记enumerate()与range(len)运用及赋值小计

    #!/uer/bin/env python # _*_ coding: utf-8 _*_ #格式1 a = 'abc' for i in range(len(a)): print a[i],'(%d ...