|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
MyISAMMysql的默认数据库,最为常用。拥有较高的插入,查询速度,但不支持事务数据|转换
数据块转储及RDBA的转换
原文链接:
http://www.eygle.com/internal/How_to_dump_datablock.htm
Tuesday,2004-08-3117:51Eygle
良多时分我们在举行进一步研讨时必要转储(dump)Oracle的数据块,以研讨其内容,Oracle供应了很好的体例,我们经由过程以下例子复杂申明一下:
[oracle@jumperudump]$sqlplus"/assysdba"SQL*Plus:Release9.2.0.3.0-ProductiononTueAug3117:01:272004Copyright(c)1982,2002,OracleCorporation.Allrightsreserved.Connectedto:Oracle9iEnterpriseEditionRelease9.2.0.3.0-ProductionWiththePartitioning,OLAPandOracleDataMiningoptionsJServerRelease9.2.0.3.0-ProductionSQL>selectrowid,deptno,dname,locfromscott.dept;ROWIDDEPTNODNAMELOC-------------------------------------------------------AAADZ7AABAAAGK6AAA10ACCOUNTINGNEWYORKAAADZ7AABAAAGK6AAB20RESEARCHDALLASAAADZ7AABAAAGK6AAC30SALESCHICAGOAAADZ7AABAAAGK6AAD40OPERATIONSBOSTONSQL>selectfile_id,block_id,blocksfromdba_extentswheresegment_name=DEPT;FILE_IDBLOCK_IDBLOCKS------------------------------1252738SQL>altersystemdumpdatafile1blockmin25273blockmax25274;Systemaltered.SQL>![oracle@jumperudump]$ls-ltotal4-rw-r-----1oracledba3142Aug3117:04hsjf_ora_13674.trc[oracle@jumperudump]$morehsjf_ora_13674.trc/opt/oracle/admin/hsjf/udump/hsjf_ora_13674.trcOracle9iEnterpriseEditionRelease9.2.0.3.0-ProductionWiththePartitioning,OLAPandOracleDataMiningoptionsJServerRelease9.2.0.3.0-ProductionORACLE_HOME=/opt/oracle/product/9.2.0Systemname:LinuxNodename:jumper.hurray.com.cnRelease:2.4.18-14Version:#1WedSep413:35:50EDT2002Machine:i686Instancename:hsjfRedothreadmountedbythisinstance:1Oracleprocessnumber:9Unixprocesspid:13674,image:oracle@jumper.hurray.com.cn(TNSV1-V3)***2004-08-3117:04:27.820***SESSIONID:(8.3523)2004-08-3117:04:27.819Startdumpdatablockstsn:0file#:1minblk25273maxblk25274buffertsn:0rdba:0x004062b9(1/25273)scn:0x0000.0057c70dseq:0x01flg:0x04tail:0xc70d1001frmt:0x02chkval:0x12e3type:0x10=DATASEGMENTHEADER-UNLIMITEDExtentControlHeader-----------------------------------------------------------------ExtentHeader::spare1:0spare2:0#extents:1#blocks:7lastmap0x00000000#maps:0offset:4128Highwater::0x004062bbext#:0blk#:1extsize:7#blocksinseg.hdrsfreelists:1#blocksbelow:1mapblk0x00000000offset:0UnlockedMapHeader::next0x00000000#extents:1obj#:13947flag:0x40000000ExtentMap-----------------------------------------------------------------0x004062balength:7nfl=1,nfb=1typ=1nxf=0ccnt=1SEGLST::flg:USEDlhd:0x004062baltl:0x004062babuffertsn:0rdba:0x004062ba(1/25274)scn:0x0000.0131909bseq:0x07flg:0x04tail:0x909b0607frmt:0x02chkval:0xa8e7type:0x06=transdataBlockheaderdump:0x004062baObjectidonBlock?Yseg/obj:0x367bcsc:0x00.131909aitc:2flg:Otyp:1-DATAfsl:0fnx:0x0ver:0x01ItlXidUbaFlagLckScn/Fsc0x010x0001.02a.000003f30x0080000b.0188.08C---0scn0x0000.0057c70e0x020x0000.000.000000000x00000000.0000.00----0fsc0x0000.00000000data_block_dump,dataheaderat0xadb505c===============tsiz:0x1fa0hsiz:0x1apbl:0x0adb505cbdba:0x004062ba76543210flag=--------ntab=1nrow=4frre=-1fsbo=0x1af搜索引擎优化=0x1f44avsp=0x1f2atosp=0x1f2a0xe:pti[0]nrow=4offs=00x12:pri[0]offs=0x1f860x14:pri[1]offs=0x1f700x16:pri[2]offs=0x1f5c0x18:pri[3]offs=0x1f44block_row_dump:tab0,row0,@0x1f86tl:26fb:--H-FL--lb:0x0cc:3col0:[2]c10bcol1:[10]4143434f554e54494e47col2:[8]4e455720594f524btab0,row1,@0x1f70tl:22fb:--H-FL--lb:0x0cc:3col0:[2]c115col1:[8]5245534541524348col2:[6]44414c4c4153tab0,row2,@0x1f5ctl:20fb:--H-FL--lb:0x0cc:3col0:[2]c11fcol1:[5]53414c4553col2:[7]4348494341474ftab0,row3,@0x1f44tl:24fb:--H-FL--lb:0x0cc:3col0:[2]c129col1:[10]4f5045524154494f4e53col2:[6]424f53544f4eend_of_block_dumpEnddumpdatablockstsn:0file#:1minblk25273maxblk25274
良多人常常提出的一个成绩是,rdba是怎样转换的?
rdba:0x004062ba(1/25274)
我们经由过程这个例子先容一下.
rdba从Oracle6->Oracle7->Oracle8产生了三次改动:
在Oracle6中,rdba由6位2进制数暗示,也就是说数据块最多只能有2^6=64个数据文件(往失落全0和全1,实践上最多只能代表62个文件)
在Oracle7中,rdba中的文件号增添为10位,为了向后兼容,从Block号的高位拿出4位作为文件号的高位.如许从6->7的Rowid无需产生变更.
在Oracle8中,文件号仍旧用10位暗示,只是不再必要置换,为了向后兼容,同时引进了绝对文件号(rfile#),以是从Oracle7到Oracle8,Rowid仍旧无需产生变更.
举例申明以下:
在Oracle6中:好比:file8,block5689226位block号==56892vvvvvvvvvvvvvvvvvvvvvvvvvv00100000000000001101111000111100^^^^^^6位文件号==8在Oracle7中:好比:File255,block5689211111100110000001101111000111100FCC0DE3C\_____/\___/\_______________________/|||||Block=0xDE3C=56892\_____________|VV0011111111=0xFF=255--注重这里高位和低位要置换才干得出准确的file#在Oracle8中:好比:File255,block5689211111100110000001101111000111100FCC0DE3C\_____/\___/\_______________________/|||||Block=0xDE3C=56892\_____________|VV001111110011=03F3=1011--这就是绝对文件号
关于我们测试中的例子:
rdba:0x004062ba(1/25274)
也就是:00000000010000000110001010111010
前10位为rfile#:0000000001=1
后22位为Block#:0000000110001010111010=25274
Archive非常适合存储大量的独立的,作为历史记录的数据。因为它们不经常被读取。Archive拥有高效的插入速度,但其对查询的支持相对较差 |
|