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

SQL> select * from city;
        ID NAME
---------- ----------
         7 Chicago
         6 JerseyCity
         8 Manhattan
         1 New York
         3 Dallas
         4 Beijing
         5 Shanghai
         2 Washington
8 rows selected.
SQL> select file_id,block_id,blocks FROM DBA_EXTENTS where segment_name='CITY';
   FILE_ID   BLOCK_ID          BLOCKS
---------- ---------- ----------
         6          288               8
select id,dbms_rowid.rowid_object(rowid) object_id,dbms_rowid.rowid_relative_fno(rowid) file_id,dbms_rowid.rowid_block_number(rowid) block_id,dbms_rowid.rowid_row_number(rowid) num,rownum from swat.city;
ID  OBJECT_ID FILE_ID   BLOCK_ID   NUM   ROWNUM
---------- ---------- ---------- ---------- ---------- ----------
7 75180       6 291     0 1
6 75180       6 291     1 2
8 75180       6 291     2 3
1 75180       6 295     0 4
3 75180       6 295     2 5
4 75180       6 295     3 6
5 75180       6 295     4 7
2 75180       6 295     5 8
8 rows selected.
把6号文件295号块dump出来:
alter system dump datafile 6 block 295;
*** 2015-03-29 15:08:41.902
Start dump data blocks tsn: 7 file#:6 minblk 295 maxblk 295
Block dump from cache:
Dump of buffer cache at level 4 for tsn=7, rdba=25166119
BH (0x88f68618) file#: 6 rdba: 0x01800127 (6/295) class: 1 ba: 0x88042000
  set: 6 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 207,28
  dbwrid: 0 obj: 75180 objn: 75180 tsn: 7 afn: 6 hint: f
  hash: [0xa23a2130,0xa23a2130] lru: [0x88f68830,0x88f685d0]
  ckptq: [NULL] fileq: [NULL] objq: [0x88f68858,0x9edde318]
  st: XCURRENT md: NULL tch: 4
  flags: only_sequential_access
  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: 7 rdba: 0x01800127 (6/295)
scn: 0x0000.001493e8 seq: 0x01 flg: 0x06 tail: 0x93e80601
frmt: 0x02 chkval: 0x2d93 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x00007F270C905800 to 0x00007F270C907800
7F270C905800 0000A206 01800127 001493E8 06010000  [....'...........]
7F270C905810 00002D93 00000001 000125AC 001493E7  [.-.......%......]
7F270C905820 00000000 00320002 01800120 00170009  [......2. .......]
7F270C905830 000003DF 00C00669 00140173 000D2001  [....i...s.... ..]
7F270C905840 001493E8 00140003 000003E1 00C0022D  [............-...]
7F270C905850 0014010D 00008000 001493D5 00000000  [................]
7F270C905860 00000000 00060100 001EFFFF 1F211F32  [............2.!.]
7F270C905870 00001F30 1F890006 1F6F1F32 1F521F61  [0.......2.o.a.R.]
7F270C905880 00001F41 00000000 00000000 00000000  [A...............]
7F270C905890 00000000 00000000 00000000 00000000  [................]
        Repeat 495 times
7F270C907790 00000000 013C0000 07C10202 756C4608  [......<......Flu]
7F270C9077A0 6E696873 02002C67 0A03C102 68736157  [shing,......Wash]
7F270C9077B0 74676E69 002C6E6F 06C10202 61685308  [ington,......Sha]
7F270C9077C0 6168676E 02002C69 0705C102 6A696542  [nghai,......Beij]
7F270C9077D0 2C676E69 C1020200 61440604 73616C6C  [ing,......Dallas]
7F270C9077E0 0202023C 420603C1 6F74736F 02002C6E  [<......Boston,..]
7F270C9077F0 0802C102 2077654E 6B726F59 93E80601  [....New York....]
Block header dump:  0x01800127
Object id on Block? Y
seg/obj: 0x125ac  csc: 0x00.1493e7  itc: 2  flg: E  typ: 1 - DATA
     brn: 0  bdba: 0x1800120 ver: 0x01 opc: 0
     inc: 0  exflg: 0
Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x0009.017.000003df  0x00c00669.0173.14  --U-    1  fsc 0x000d.001493e8
0x02   0x0003.014.000003e1  0x00c0022d.010d.14  C---    0  scn 0x0000.001493d5
bdba: 0x01800127
data_block_dump,data header at 0x7f270c905864
===============
tsiz: 0x1f98
hsiz: 0x1e
pbl: 0x7f270c905864
     76543210
flag=--------
ntab=1
nrow=6
frre=-1
fsbo=0x1e
fseo=0x1f32
avsp=0x1f21
tosp=0x1f30
0xe:pti[0] nrow=6 offs=0
0x12:pri[0] offs=0x1f89
0x14:pri[1] offs=0x1f32
0x16:pri[2] offs=0x1f6f
0x18:pri[3] offs=0x1f61
0x1a:pri[4] offs=0x1f52
0x1c:pri[5] offs=0x1f41
block_row_dump:
tab 0, row 0, @0x1f89
tl: 15 fb: --H-FL-- lb: 0x0  cc: 2
col  0: [ 2]  c1 02
col  1: [ 8]  4e 65 77 20 59 6f 72 6b
tab 0, row 1, @0x1f32
tl: 2 fb: --HDFL-- lb: 0x1 
tab 0, row 2, @0x1f6f
tl: 13 fb: --H-FL-- lb: 0x0  cc: 2
col  0: [ 2]  c1 04
col  1: [ 6]  44 61 6c 6c 61 73
tab 0, row 3, @0x1f61
tl: 14 fb: --H-FL-- lb: 0x0  cc: 2
col  0: [ 2]  c1 05
col  1: [ 7]  42 65 69 6a 69 6e 67
tab 0, row 4, @0x1f52
tl: 15 fb: --H-FL-- lb: 0x0  cc: 2
col  0: [ 2]  c1 06
col  1: [ 8]  53 68 61 6e 67 68 61 69
tab 0, row 5, @0x1f41
tl: 17 fb: --H-FL-- lb: 0x0  cc: 2
col  0: [ 2]  c1 03
col  1: [10]  57 61 73 68 69 6e 67 74 6f 6e
end_of_block_dump
End dump data blocks tsn: 7 file#: 6 minblk 295 maxblk 295

上一篇:webservices上传文件


下一篇:Hadoop教程(五)Hadoop分布式集群部署安装