[20161129]奇怪的轉儲命令.txt

lfree發表於2016-11-29

[20161129]奇怪的轉儲命令.txt

--如果你轉儲檔案頭使用如下命令:

SYS@book> alter system dump datafile 6  block 1;
System altered.

Start dump data blocks tsn: 8 file#:6 minblk 1 maxblk 1
Block 1 (file header) not dumped:use dump file header command
End dump data blocks tsn: 7 file#: 6 minblk 2 maxblk 1

--也就是檔案頭不能使用這樣的方式。

SYS@book> alter system dump datafile '/mnt/ramdisk/book/sugar01.dbf'  block 1;
System altered.

*** 2016-11-29 15:07:31.354
Start dump data block from file /mnt/ramdisk/book/sugar01.dbf minblk 1 maxblk 1
V10 STYLE FILE HEADER:
    Compatibility Vsn = 186647552=0xb200400
    Db ID=1337401710=0x4fb7216e, Db Name='BOOK'
    Activation ID=0=0x0
    Control Seq=43937=0xaba1, File size=5120=0x1400
    File Number=6, Blksiz=8192, File Type=3 DATA
Dump all the blocks in range:
End dump data block from file /mnt/ramdisk/book/sugar01.dbf minblk 2 maxblk 1
--至少可以看到dbid

--如果執行如下:
SYS@book> alter system dump datafile '/mnt/ramdisk/book/sugar01.dbf'  block 2;
System altered.

*** 2016-11-29 15:12:14.535
Start dump data block from file /mnt/ramdisk/book/sugar01.dbf minblk 2 maxblk 2
V10 STYLE FILE HEADER:
    Compatibility Vsn = 186647552=0xb200400
    Db ID=1337401710=0x4fb7216e, Db Name='BOOK'
    Activation ID=0=0x0
    Control Seq=43937=0xaba1, File size=5120=0x1400
    File Number=6, Blksiz=8192, File Type=3 DATA
Dump all the blocks in range:
buffer tsn: 7 rdba: 0x01800002 (6/2)
scn: 0x0000.006ec689 seq: 0x02 flg: 0x04 tail: 0xc6891d02
frmt: 0x02 chkval: 0x8d28 type: 0x1d=KTFB Bitmapped File Space Header
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x00007F1C354AEA00 to 0x00007F1C354B0A00
7F1C354AEA00 0000A21D 01800002 006EC689 04020000  [..........n.....]
7F1C354AEA10 00008D28 00000006 00000008 00001400  [(...............]
7F1C354AEA20 00000009 00000800 003FFFFE 0000007E  [..........?.~...]
7F1C354AEA30 000013FF 00000050 00000220 006EC688  [....P... .....n.]
7F1C354AEA40 00000000 00000000 00000000 00000000  [................]
7F1C354AEA50 00000300 00000008 00000000 00000000  [................]
7F1C354AEA60 00000000 00000000 00000000 00000000  [................]
        Repeat 504 times
7F1C354B09F0 00000000 00000000 00000000 C6891D02  [................]
File Space Header Block:
Header Control:
RelFno: 6, Unit: 8, Size: 5120, Flag: 9
AutoExtend: YES, Increment: 2048, MaxSize: 4194302
Initial Area: 126, Tail: 5119, First: 80, Free: 544
Deallocation scn: 7259784.0
Header Opcode:
Save: No Pending Op
End dump data block from file /mnt/ramdisk/book/sugar01.dbf minblk 2 maxblk 2

--你可以發現這樣實際上訪問2個資料塊。

SYS@book> alter system dump datafile 6  block 2;
System altered.

*** 2016-11-29 15:15:35.925
Start dump data blocks tsn: 7 file#:6 minblk 2 maxblk 2
Block dump from cache:
Dump of buffer cache at level 4 for tsn=7 rdba=25165826
BH (0x73bf96d0) file#: 6 rdba: 0x01800002 (6/2) class: 13 ba: 0x73ba4000
  set: 70 pool: 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 35,28
  dbwrid: 0 obj: -1 objn: 45 tsn: 7 afn: 6 hint: f
  hash: [0x773f98c0,0x849ccd70] lru: [0x73bf98f8,0x73bfa2b8]
  ckptq: [NULL] fileq: [NULL] objq: [0x7d1f6fd8,0x7d1f6fd8] objaq: [0x7d1f6fc8,0x7d1f6fc8]
  st: XCURRENT md: NULL fpin: 'kttewh00: ktte_get_file_info' tch: 1
  flags:
  LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]
Block dump from disk:
buffer tsn: 7 rdba: 0x01800002 (6/2)
scn: 0x0000.006ec689 seq: 0x02 flg: 0x04 tail: 0xc6891d02
frmt: 0x02 chkval: 0x8d28 type: 0x1d=KTFB Bitmapped File Space Header
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x00007F1C354AEA00 to 0x00007F1C354B0A00
7F1C354AEA00 0000A21D 01800002 006EC689 04020000  [..........n.....]
7F1C354AEA10 00008D28 00000006 00000008 00001400  [(...............]
7F1C354AEA20 00000009 00000800 003FFFFE 0000007E  [..........?.~...]
7F1C354AEA30 000013FF 00000050 00000220 006EC688  [....P... .....n.]
7F1C354AEA40 00000000 00000000 00000000 00000000  [................]
7F1C354AEA50 00000300 00000008 00000000 00000000  [................]
7F1C354AEA60 00000000 00000000 00000000 00000000  [................]
        Repeat 504 times
7F1C354B09F0 00000000 00000000 00000000 C6891D02  [................]
File Space Header Block:
Header Control:
RelFno: 6, Unit: 8, Size: 5120, Flag: 9
AutoExtend: YES, Increment: 2048, MaxSize: 4194302
Initial Area: 126, Tail: 5119, First: 80, Free: 544
Deallocation scn: 7259784.0
Header Opcode:
Save: No Pending Op
End dump data blocks tsn: 7 file#: 6 minblk 2 maxblk 2
--僅僅塊2的資訊。

SYS@book> alter system dump datafile '/mnt/ramdisk/book/sugar01.dbf'  block 135;
System altered.

--你可以看到除了檔案頭資訊,還包括塊135的資訊。也就是使用檔名方式要顯示第1塊的相關資訊。

--即使dump帶檔名,要轉儲135塊,這樣寫:

SYS@book> alter system dump datafile '/mnt/ramdisk/book/sugar01.dbf' block min 135  block max 135;
System altered.

SYS@book> alter system dump datafile '/mnt/ramdisk/book/users01.dbf' block min 135  block max 135;
System altered.

--即使這樣也要掃描檔案頭出現如下資訊:
Start dump data block from file /mnt/ramdisk/book/users01.dbf minblk 135 maxblk 135
V10 STYLE FILE HEADER:
    Compatibility Vsn = 186647552=0xb200400
    Db ID=1337401710=0x4fb7216e, Db Name='BOOK'
    Activation ID=0=0x0
    Control Seq=44604=0xae3c, File size=6400=0x1900
    File Number=4, Blksiz=8192, File Type=3 DATA
Dump all the blocks in range:
buffer tsn: 4 rdba: 0x01000087 (4/135)
scn: 0x0000.000e0ef0 seq: 0x01 flg: 0x06 tail: 0x0ef00601
frmt: 0x02 chkval: 0xe273 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1

--如果你不想使用
alter session set events 'immediate trace name FILE_HDRS level 12';

--要看檔案頭資訊要執行如下:
alter system dump datafile '/mnt/ramdisk/book/sugar01.dbf'  block 1;
而不能使用
alter system dump datafile 6  block 1;

--另外一點在mount狀態下,不能使用alter system dump datafile 6  block 2;,因為這個時候無法識別檔案號,
--一些檢視物件還無法訪問。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2129307/,如需轉載,請註明出處,否則將追究法律責任。

相關文章