Block Dump
Block Dump究竟是从memory中读取还是从datafile 中读取?
最近一次有趣的讨论得到出以下的结论
alter system dump datafile file_id block block_number, 如果buffer中存在该block,将从buffer中读取
alter system dump datafile file_name block block_number ,不管buffer中是否存在,都将从文件中读取
通过truss来跟踪 truss -t open,close,read -p 24490
SQL> alter system dump datafile 4 block 2468;
System altered.
read(7, “01\v\0\006\0\0\0\0\011 i”.., 2064) = 267
read(7, 0x1037F3976, 2064) (sleeping…)
SQL> alter system dump datafile ‘/oracle/GBPGW/data01/CSHAN/CSHAN_system02a.dbf’ block 2468;
System altered.
Received signal #21, SIGURG, in read() [caught]
siginfo: SIGURG pid=24489 uid=32000
read(7, 0x1037F3976, 2064) Err#91 ERESTART
read(7, “\0\v\0\0\f\0\0\001\002″, 2064) = 11
read(7, “01 6\0\006\0\0\0\0\011 i”.., 2064) = 310
open(“/oracle/GBPGW/data01/CSHAN/CSHAN_system02a.dbf”, O_RDONLY) = 11
read(11, “\002\0\0\0\0 \0\0\0 d\0″.., 512) = 512
close(11) = 0
open(“/oracle/GBPGW/data01/CSHAN/CSHAN_system02a.dbf”, O_RDWR) = 11
close(11) = 0
open(“/oracle/GBPGW/data01/CSHAN/CSHAN_system02a.dbf”, O_RDONLY) = 11
close(11) = 0
close(259) = 0
read(7, 0x1037F3976, 2064) (sleeping…)
以前从来没考虑过这个问题。
这样看来,某些时刻,两个结果有不一致的可能?
truss是好东西。
是的,我新建了一个表,从dump中来看
dump datafile ‘file_name’ block xxx
显示是leaf block
dump datafile ‘file_id’ block xxxx
显示是data block
Leaf block dump
===============
header address 4353484892=0x1037ce85c
kdxcolev 0
KDXCOLEV Flags = – - -
kdxcolok 0
kdxcoopc 0×80: opcode=0: iot flags=— is converted=Y
kdxconco 3
kdxcosdc 0
kdxconro 0
kdxcofbo 36=0×24
kdxcofeo 8032=0x1f60
kdxcoavs 7996
kdxlespl 0
kdxlende 0
kdxlenxt 0=0×0
kdxleprv 0=0×0
kdxledsz 0
kdxlebksz 8032
—– end of leaf block dump —–
End dump data block from file /oracle/GBPGW/data01/CSHAN/CSHAN_system02a.dbf minblk 2461 maxblk 2461
Start dump data blocks tsn: 0 file#: 4 minblk 2461 maxblk 2461
buffer tsn: 0 rdba: 0x0100099d (4/2461)
scn: 0×0000.00561b42 seq: 0×01 flg: 0×00 tail: 0x1b420601
frmt: 0×02 chkval: 0×0000 type: 0×06=trans data
Block header dump: 0x0100099d
Object id on Block? Y
seg/obj: 0×2243 csc: 0×00.561869 itc: 2 flg: O typ: 1 – DATA
fsl: 0 fnx: 0×0 ver: 0×01
Itl Xid Uba Flag Lck Scn/Fsc
0×01 0×0002.040.00003976 0x00c00fb5.1afb.06 C— 0 scn 0×0000.005616ea
0×02 0×0002.03d.00003980 0x00c01014.1afc.4a —- 1 fsc 0×0000.00000000
data_block_dump,data header at 0x1037ce85c
===============
tsiz: 0x1fa0
hsiz: 0×14
pbl: 0x1037ce85c
bdba: 0x0100099d
76543210
flag=——–
ntab=1
nrow=1
frre=-1
fsbo=0×14
fseo=0x13df
avsp=0x1f83
tosp=0x1f83
0xe:pti[0] nrow=1 offs=0
0×12:pri[0] offs=0x13df
block_row_dump:
alter system checkpoint后就都一样了