欢迎来到天天文库
浏览记录
ID:11204812
大小:68.50 KB
页数:10页
时间:2018-07-10
《oracle数据块深入分析总结》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Oracle数据块深入分析总结最近在研究块的内部结构,把文档简单整理了一下,和大家分享一下。该篇文章借助dump和BBED对数据库内部结构进行了分析,最后附加了一个用BBED解决ORA-1200错误的小例子。在总结的过程中参考了《DisassemblingtheOracleDataBlock》以及网上的翻译版本。dump说明创建表空间和测试表:createtablespacetestblockdatafile'/opt/oracle/oradata/oradb/testblock01.dbf'size100M;createtabletestblock
2、(idnumber,namevarchar(4))tablespacetestblock;插入3条数据然后提交:SQL>insertintotestblockvalues(1,'a');SQL>insertintotestblockvalues(2,'b');SQL>insertintotestblockvalues(3,'c');SQL>commit;SQL>select*fromtestblock; IDNAME------------------ 1a 2b 3cSQL>selectrowi
3、d,dbms_rowid.rowid_relative_fno(rowid)rel_fno,dbms_rowid.rowid_block_number(rowid)blocknofromtestblock;ROWID REL_FNO BLOCKNO------------------ ---------- ----------AAANK4AAFAAAAAQAAA 5 16AAANK4AAFAAAAAQAAB 5 16AAANK4AA
4、FAAAAAQAAC 5 16我们看到这3行数据都在5号数据文件的第16个块执行数据块dump:SQL>altersystemdumpdatafile5block16;以下是该数据块的完整dump结果:Startdumpdatablockstsn:7file#:5minblk16maxblk16buffertsn:7rdba:0x01400010(5/16)scn:0x0000.001732d3seq:0x01flg:0x04tail:0x32d30601frmt:0x02chkval:0x84cbtype:0x06=t
5、ransdataHexdumpofblock:st=0,typ_found=1Dumpofmemoryfrom0x0CEB6400to0x0CEB8400CEB64000000A20601400010001732D304010000 [......@..2......]CEB6410000084CB000000010000D2B8001732D3 [.............2..]CEB642000000000003200020140000900200006 [......2...@....]CEB6430000002710080020500130
6、25700008000 [q.......W.......]CEB6440001732C4000600080000027900800351 [.2......y...Q...]CEB645000150278000000010000000000000000 [x...............]10/10CEB646000000000000301000018FFFF1F651F5E [............^.e.]CEB647000001F651F5E00031F801F6600000000 [e.....^.f.......]CEB64800000
7、0000000000000000000000000000 [................] Repeat499timesCEB83C0022C000002C10202002C610103C10202 [..,......a,.....]CEB83D0012C620103C102022C626202C1020200 [.b,......bb,....]CEB83E0616102020202002C630104C10202002C [..aa,......c,...]CEB83F0620103C10202002C610102C132D30
8、601 [...b,......a...2]Blockheaderdump: 0x01400010 Obje
此文档下载收益归作者所有