ORACLE數(shù)據(jù)文件和控制文件頭部_第1頁(yè)
ORACLE數(shù)據(jù)文件和控制文件頭部_第2頁(yè)
ORACLE數(shù)據(jù)文件和控制文件頭部_第3頁(yè)
ORACLE數(shù)據(jù)文件和控制文件頭部_第4頁(yè)
ORACLE數(shù)據(jù)文件和控制文件頭部_第5頁(yè)
已閱讀5頁(yè),還剩29頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、為了回答關(guān)于深入淺出Oracle中的一些疑問(wèn),引出本系列文章,討論鏈接參考: HYPERLINK /609499.html /609499.html在 HYPERLINK /archives/2006/08/event_file_hdrs.html 上一講中,我們說(shuō)過(guò):當(dāng)我們使用file_hdrs事件來(lái)轉(zhuǎn)儲(chǔ)數(shù)據(jù)文件頭信息時(shí),Oracle會(huì)轉(zhuǎn)儲(chǔ)兩部分信息,一部分來(lái)自控制文件,一部分來(lái)自數(shù)據(jù)文件,在數(shù)據(jù)庫(kù)啟動(dòng)過(guò)程中,這兩部分信息要用來(lái)進(jìn)行啟動(dòng)驗(yàn)證。在數(shù)據(jù)庫(kù)opeen的過(guò)程中中,Oraccle要進(jìn)行行檢查中包含含以下 HYPERLINK /internal/Checkpoint_CNT&SCN.ht

2、m 兩個(gè)過(guò)過(guò)程:第一次檢查數(shù)據(jù)據(jù)文件頭中的的Checkkpointt cnt是是否與對(duì)應(yīng)控控制文件中的的Checkkpointt cnt一一致.如果相相等,進(jìn)行第第二次檢查.第二次檢查數(shù)據(jù)據(jù)文件頭的開(kāi)開(kāi)始SCN和和對(duì)應(yīng)控制文文件中的結(jié)束束SCN是否否一致如果結(jié)結(jié)束SCN等等于開(kāi)始SCCN,則不需需要對(duì)那個(gè)文文件進(jìn)行恢復(fù)復(fù).對(duì)每個(gè)數(shù)據(jù)文件件都完成檢查查后,打開(kāi)數(shù)數(shù)據(jù)庫(kù).同時(shí)時(shí)將每個(gè)數(shù)據(jù)據(jù)文件的結(jié)束束SCN設(shè)置置為無(wú)窮大.通過(guò)以下過(guò)程我我們來(lái)進(jìn)一步步說(shuō)明一下這這個(gè)內(nèi)容。我們來(lái)看以下來(lái)來(lái)自控制文件件部分(選取取一個(gè)文件測(cè)測(cè)試): DATA FIILE #44: (naame #44) /oppt/o

3、raacle/ooradatta/eyggle/eyygle011.dbfccreatiion siize=0 blockk sizee=81922 stattus=0 xxe heaad=4 ttail=44 dup=1tabllespacce 4, indexx=4 krrfil=44 prevv_filee=0unrrecoveerablee scn: 0 x00000.0000000000 01/01/19988 000:00:000Checckpoinnt cntt:58 sscn: 00 x00000.002aac8ee 08/111/20066 09:448:29SStop ss

4、cn: 00 x00000.002aac8ee 08/111/20066 09:448:29CCreatiion Chheckpoointedd at sscn: 00 x00000.00155078d 06/066/20066 09:441:54tthreadd:0 rbba:(0 xx0.0.00).aux_file is NOOT DEFFINED 這部分中包含的的重要信息有有:檢查點(diǎn)計(jì)計(jì)數(shù): Chheckpooint ccnt:588檢查點(diǎn)SCCN: sccn: 0 xx0000.002acc8ee 008/11/2006 09:488:29數(shù)據(jù)據(jù)文件Stoop SCNN:Stopp

5、scn: 0 x00000.0002ac8eee 08/11/20006 099:48:229我們?cè)倏磥?lái)自數(shù)數(shù)據(jù)文件頭的的信息:FILE HEEADER:Softwware vvsn0 xx92000000, CCompattibiliity Vssn0 x880000000Db IID=140076865520=0 xx53e799778, Db Naame=EEYGLEActivvationn ID=00=0 x0CControol Seqq=979=0 x3d33, Fille sizze=12880=0 x5500Fille Numm

6、ber=44, Blkksiz=88192, File Type=3 DATTATabllespacce #4 - EYGGLE reel_fn:4 Creeationn at sscn: 00 x00000.00155078d 06/066/20066 09:441:54BBackupp takeen at scn: 0 x00000.0000000000 01/001/19888 00:00:000 threead:0rreset logs countt:0 x2332bee11f scnn: 0 x00000.00007c7781 reecoverred att 08/110/20006

7、 20:57:533statuus:0 x00 roott dba:0 x0000000000 chkppt cntt: 58 ctl ccnt:577beginn-hot-backuup fille sizze: 0CCheckppointeed at scn: 0 x00000.0022ac8eee 08/111/20006 09:48:299.這部分中包含的的重要信息有有:檢查點(diǎn)SSCN: CCheckppointeed at scn: 0 x00000.0022ac8eee 08/111/20006 09:48:299檢查點(diǎn)計(jì)數(shù)數(shù): chkkpt cnnt: 588 ctl cnt:5

8、57這兩者都和控制制文件中所記記錄的一致。如如果這兩者一一致,數(shù)據(jù)庫(kù)庫(kù)啟動(dòng)時(shí)就能能通過(guò)驗(yàn)證,啟啟動(dòng)數(shù)據(jù)庫(kù)。那么如果不一致致呢?Oraacle則請(qǐng)請(qǐng)求進(jìn)行恢復(fù)復(fù)。我們看,從從備份中恢復(fù)復(fù)eyglee01.dbbf文件.首首先第一部分分從控制文件件中獲得的信信息是相同的的: DATA FIILE #44: (naame #44) /oppt/oraacle/ooradatta/eyggle/eyygle011.dbfccreatiion siize=0 blockk sizee=81922 stattus=0 xxe heaad=4 ttail=44 dup=1tabllespacce 4, in

9、dexx=4 krrfil=44 prevv_filee=0unrrecoveerablee scn: 0 x00000.0000000000 01/01/19988 000:00:000Checckpoinnt cntt:58 sscn: 00 x0000.002acc8ee 008/11/2006 09:488:29Sttop sccn: 0 xx0000.002acc8ee 008/11/2006 09:488:29Crreatioon Cheeckpoiinted at sccn: 0 xx0000.00150078d 006/06/2006 09:411:54.auxx_filee

10、is NNOT DEEFINEDD 檢查點(diǎn)計(jì)數(shù): Checkkpointt cnt:58檢查點(diǎn)點(diǎn)SCN: scn: 0 x00000.0022ac8eee 08/111/20006 09:48:299數(shù)據(jù)文件SStop SSCN:Sttop sccn: 0 xx0000.002acc8ee 008/11/2006 09:488:29而從文件頭中獲獲得的備份文文件信息則是是: FILE HEEADER:Softwware vvsn0 xx92000000, CCompattibiliity Vssn0 x880000000Db IID=1400

11、76865520=0 xx53e799778, Db Naame=EEYGLEActivvationn ID=00=0 x0CControol Seqq=973=0 x3cdd, Fille sizze=12880=0 x5500Fille Nummber=44, Blkksiz=88192, File Type=3 DATTATabllespacce #4 - EYGGLE reel_fn:4 Creeationn at sscn: 00 x00000.00155078d 06/066/20066 09:441:54BBackupp takeen at scn: 0 x00000.00000

12、00000 01/001/19888 00:00:000 threead:0rreset logs countt:0 x2332bee11f scnn: 0 x00000.00007c7781 reecoverred att 08/110/20006 20:57:533statuus:0 x00 roott dba:0 x0000000000 chkppt cntt: 53 ctl ccnt:522beginn-hot-backuup fille sizze: 0CCheckppointeed at scn: 0 x00000.0022ac5f9 088/10/22006 220:58:21.

13、我們看到此時(shí)備備份文件的信信息:檢查點(diǎn)點(diǎn)是:Cheeckpoiinted at sccn: 0 xx0000.002acc5f9 088/10/22006 220:58:21檢查點(diǎn)點(diǎn)計(jì)數(shù)為:cchkpt cnt: 53 cttl cntt:52這兩者不再一致致,首先是檢檢查點(diǎn)技術(shù)不不一致,當(dāng)前前文件的chhkpt ccnt為533,小于控制制文件中記錄錄的58,OOraclee可以判斷文文件是從備份份中恢復(fù)的,或或者文件故障障,需要進(jìn)行行介質(zhì)恢復(fù)。我們看如果此時(shí)時(shí)我們?cè)噲D打打開(kāi)數(shù)據(jù)庫(kù),則則Oraclle提示文件件需要介質(zhì)恢恢復(fù): SQL allter ddatabaase oppen;allt

14、er ddatabaase oppen*ERRORR at lline 11:ORA-011133: fille 4 nneeds mediaa recooveryOORA-011110: data file 4: /opt/ooraclee/oraddata/eeygle/eyglee01.dbbf執(zhí)行恢復(fù): SQL reecoverr dataafile 4;Meddia reecoverry commpletee.我們看看恢復(fù)完完成之后,控控制文件和數(shù)數(shù)據(jù)文件的變變化.首先看看控制文件的的變化: DATA FIILE #44: (namme #4) /optt/oraccle/orrad

15、ataa/eyglle/eyggle01.dbfcrreatioon sizze=0 bblock size=8192 statuus=0 xee headd=4 taail=4 dup=11tableespacee 4, iindex=4 krffil=4 prev_file=0unreecoverrable scn: 0 x00000.0000000000 01/001/19888 00:00:000Checkkpointt cnt:59 sccn: 0 xx0000.002acc8ee 008/11/2006 09:488:29Sttop sccn: 0 xx0000.002acc8ed

16、 008/11/2006 09:488:29Crreatioon Cheeckpoiinted at sccn: 0 xx0000.00150078d 006/06/2006 09:411:54.檢查點(diǎn)計(jì)數(shù): Checkkpointt cnt:59執(zhí)行了了恢復(fù)之后,檢檢查點(diǎn)計(jì)數(shù)較較前增加了11檢查點(diǎn)SCN: scn: 0 x00000.0002ac8eee 08/11/20006 099:48:229數(shù)據(jù)文件件Stop scn: 0 x00000.0022ac8edd 08/111/20006 09:48:299數(shù)據(jù)文件SStop sscn和數(shù)據(jù)據(jù)文件進(jìn)行了了同步。數(shù)據(jù)文件頭信息息: FILE

17、 HEEADER:Softwware vvsn0 xx92000000, CCompattibiliity Vssn0 x880000000Db IID=140076865520=0 xx53e799778, Db Naame=EEYGLEActivvationn ID=00=0 x0CControol Seqq=983=0 x3d77, Fille sizze=12880=0 x5500Fille Nummber=44, Blkksiz=88192, File Type=3 DATTATabllespacce #4 - EYGGLE ree

18、l_fn:4 Creeationn at sscn: 00 x00000.00155078d 06/066/20066 09:441:54BBackupp takeen at scn: 0 x00000.0000000000 01/001/19888 00:00:000 threead:0rreset logs countt:0 x2332bee11f scnn: 0 x00000.00007c7781 reecoverred att 08/111/20006 10:11:266statuus:0 x00 roott dba:0 x0000000000 chkppt cntt: 59 ctl

19、ccnt:588beginn-hot-backuup fille sizze: 0CCheckppointeed at scn: 0 x00000.0022ac8ed 008/11/2006 09:488:29.我們看到此時(shí)數(shù)數(shù)據(jù)文件的信信息:檢查點(diǎn)點(diǎn)是:Cheeckpoiinted at sccn: 0 xx0000.002acc8ed 008/11/2006 09:488:29這個(gè)個(gè)檢查點(diǎn)和控控制文件中記記錄的stoop scnn一致,數(shù)據(jù)據(jù)庫(kù)啟動(dòng)可以以順利進(jìn)行。檢查點(diǎn)計(jì)數(shù)為:chkptt cnt: 59 cctl cnnt:58我們打開(kāi)數(shù)據(jù)庫(kù)庫(kù): SQL allter ddatabaas

20、e oppen;Databasse alttered.SQL allter ssessioon sett evennts iimmediiate ttrace name file_hdrs levell 10;Sessionn alteered.此時(shí)數(shù)據(jù)庫(kù)恢復(fù)復(fù)正常運(yùn)行??刂莆募畔⑷缦拢?DATA FIILE #44: (naame #44) /oppt/oraacle/ooradatta/eyggle/eyygle011.dbfccreatiion siize=0 blockk sizee=81922 stattus=0 xxe heaad=4 ttail=44 dup=1tabllesp

21、acce 4, indexx=4 krrfil=44 prevv_filee=0unrrecoveerablee scn: 0 x00000.0000000000 01/01/19988 000:00:000Checckpoinnt cntt:60 sscn: 00 x00000.002aac8ef 08/111/20066 10:119:30SStop sscn: 00 xfffff.fffffffff 08/111/20066 09:448:29CCreatiion Chheckpoointedd at sscn: 00 x00000.00155078d 06/066/20066 09:4

22、41:54此時(shí)stop scn被置置為無(wú)窮大。數(shù)據(jù)文件頭信息如下:FILE HEEADER:Softwware vvsn0 xx92000000, CCompattibiliity Vssn0 x880000000Db IID=140076865520=0 xx53e799778, Db Naame=EEYGLEActivvationn ID=00=0 x0CControol Seqq=984=0 x3d88, Fille sizze=12880=0 x5500Fille Nummber=44, Blkksiz=88192, File Typ

23、e=3 DATTATabllespacce #4 - EYGGLE reel_fn:4 Creeationn at sscn: 00 x00000.00155078d 06/066/20066 09:441:54BBackupp takeen at scn: 0 x00000.0000000000 01/001/19888 00:00:000 threead:0rreset logs countt:0 x2332bee11f scnn: 0 x00000.00007c7781 reecoverred att 08/111/20006 10:11:266statuus:0 x44 roott d

24、ba:0 x0000000000 chkppt cntt: 60 ctl ccnt:599beginn-hot-backuup fille sizze: 0CCheckppointeed at scn: 0 x00000.0022ac8eff 08/111/20006 10:19:300未完待續(xù).datafille bloock bllock ssize :8192Offset 0 1 2 3 4 5 6 7 8 9 a b c d e f 000140000 06 A2 00 00 0A 00 40 01 0E 89 43 00 00 00 05 02 type frmt spare1/2_

25、kcbbh rdba scn seq flg 1 : 20 bytestype: 0 x06=trans data defined in kcb.h frmt: 8i9i 都是0 x02 10.1.0 2k: 0 x62 4k:0 x82 8k:0 xa2 16k:0 xc2 (logfile 0 x22 512 bytes) spare1/2_kcbh: ub1 spare1_kcbh this field is no longer used (old inc#, now always 0) ub1 spare2_kcbh this field is no longer used (old

26、ts#, now always 0) rdba: 0 x0140000a 轉(zhuǎn)換成2進(jìn)制后它的前10 bit 表示file id 后22 bit 表示的block id 可以看出一個(gè)tablespace 可以有1023 個(gè)datafile ,每個(gè)datafile可以有4M 的block10G 出現(xiàn)的 big datafile 這里表示的就是block id了 沒(méi)有file id 9.2.0試驗(yàn)過(guò)一個(gè)tablespace可以有1023個(gè)datafile 一個(gè)object可以存放在1023個(gè)datafile中 scn: scn: 0 x0000.0043890e seq: A sequence nu

27、mber incremented for each change to a block at the same SCN A new SCN is allocated if the sequence number wraps. 同一個(gè)SCN影響這個(gè)block中的行數(shù)大于 254 行就會(huì)為這個(gè)事務(wù)分配一個(gè)新的SCN 如下面的操作就可能引起同一個(gè)SCN但影響的同一個(gè)block 中的行超過(guò)254行 delete from table_name 影響的行數(shù)(最大254) 是用從 0 x01 到 0 xfe 表示的當(dāng)這個(gè)byte 的數(shù)據(jù)為 0 xff 的時(shí)候標(biāo)志這個(gè) block 壞調(diào)了- ora-0157

28、8Sequence number:SEQ - 0 /* non-logged changes - do not advance seq# */SEQ - (UB1MAXVAL-1)/* maximum possible sequence number */SEQ - (UB1MAXVAL) /* seq# to indicate a block is corrupt,equal to FF. soft corrupt*/ 0 xff : When present it indicates that the block has been marked as corrupt by Oracle.

29、either by the db_block_checking functionality or the equivalent events (10210 for data blocks, 10211 for index blocks, and 10212 for cluster blocks) when making a database change, or by the DBMS_REPAIR.FIX_CORRUPT_BLOCKS procedure, or by PMON after an unsuccessful online block recovery attempt while

30、 recovering a failed process, or by RMAN during a BACKUP, COPY or VALIDATE command with the CHECK LOGICAL option. Logical corruptions are normally due to either recovery through a NOLOGGING operation, or an Oracle software bug. flg: as defined in kcbh.h #define KCBHFNEW 0 x01 /* new block - zeroed d

31、ata area */#define KCBHFDLC 0 x02 /* Delayed Logging Change advance SCN/seq */#define KCBHFCKV 0 x04 /* ChecK Value saved-block xors to zero */#define KCBHFTMP 0 x08 /* Temporary block */這是一個(gè)可以組合的值 也就是說(shuō)有為 6 的時(shí)候是 2,4 兩種情況的組合Block structure as defined in kcbh.h:struct kcbhub1 type_kcbh; /* Block type*

32、 / ub1 frmt_kcbh; /* #define KCBH_FRMT8 2 */ ub1 spare1_kcbh;ub1 spare2_kcbh;krdba rdba_kcbh; /* relative DBA /ub4 bas_kcbh; /* base of SCN */ub2 wrp_kcbh; /* wrap of SCN */ub1 seq_kcbh; /* sequence # of changes at same scn */ub1 flg_kcbh;ub2 chkval_kcbh; 000140110 00 00 00 00 01 00 17 00 54 D2 00 0

33、0 0A 89 43 00 chkval spare3_kcbh typ ? seg/objj csc spare3_kcbh : ub2 spare3_kcbh 2 : 24 bytes (總計(jì)44bytes)typ : 1 - DATA 2 index 改成3了在10.1.0 上引起了ora-6002032然后ORA-27101: shared memory realm does not existoracle進(jìn)行查詢(xún)的時(shí)候是根據(jù) obj$表中的情況來(lái)判斷對(duì)象的類(lèi)型的,不是根據(jù)這個(gè)typ也就是說(shuō)如果有一個(gè)表但改變表中block的這個(gè)標(biāo)志位,一樣可以查詢(xún)出數(shù)據(jù)來(lái),但dump block 時(shí)會(huì)

34、出錯(cuò),ORA-00600: 內(nèi)部錯(cuò)誤代碼,自變量: 4555, 0, , , , , , 錯(cuò)誤中的 0 就是typ對(duì)應(yīng)的數(shù)據(jù)在10G中改變它后update這個(gè)block的數(shù)據(jù)commit可以但rollback的報(bào)錯(cuò) ? 見(jiàn)過(guò)有其他值 但用編輯器改這個(gè)值 在 dump 文件中顯示不出來(lái)變化 seg/obj: 0 xd254 csc : 0 x00.43890a The SCN at which the last full cleanout was performed on the block 000140220 00 00 E8 1F 02 00 03 00 00 00 00 00 04 00

35、0C 00 csc ? itc ? flg fsl fnx xid 3 : 24 bytes * itl (2個(gè)itl總計(jì)92bytes)? 見(jiàn)過(guò)有其他值 但用編輯器改這個(gè)值 在 dump 文件中顯示不出來(lái)變化 itc ITL 條目的個(gè)數(shù) max 255超過(guò)會(huì)報(bào)ORA-02207 ORA-00060 ORA-00054 可能是沒(méi)空間分配itl條目了或它的爭(zhēng)用引起的在8i中 INITRANS default為1 , 9.2.0中 INITRANS default為2 flg indicates that the block is on a freelist. Otherwise the flag

36、 is -9i 的ASSM 的情況下這個(gè)值為 Eixora 上說(shuō)他占用 2 bytes 但我下面的試驗(yàn)和他的結(jié)果有一定的出入我觀察到的情況是 : Object id on Block? Y flg: O ver: 0 x01 上面的3項(xiàng)是用同一個(gè) byte 來(lái)表示的flg: O ver: 0 x01 Object id on Block? Y 從我的觀察中 dump 出來(lái)的文件中 flg ver Object id on Block他們共同占用的這個(gè)一個(gè)字節(jié) 他的規(guī)律可以從下面的情況看出2進(jìn)制數(shù)據(jù) flg ver Object id on Block?0 x00 - 0 x00 N0 x01

37、0 0 x00 N0 x02 - 0 x01 Y0 x03 0 0 x01 Y0 x04 - 0 x02 Y0 x05 0 0 x02 Y0 x06 - 0 x03 Y0 x07 0 0 x03 Y0 x08 - 0 x04 N0 x09 0 0 x04 N0 x0a - 0 x05 Y0 x0b 0 0 x05 Y0 x0c - 0 x06 Y0 x0d 0 0 x06 Y0 x0e - 0 x07 Y0 x0f 0 0 x07 Y0 x10 . 類(lèi)似上面的循環(huán)了 這種情況在9i上已經(jīng)改變因?yàn)锳SSM的出現(xiàn) fsl : Index to the first slot on the ITL f

38、reelist. ITL TX freelist slot fnx : 自由列表中下一塊的地址 Null if this block is not on a freelist 有數(shù)據(jù)例如: fnx: 0 x1000029 000140330 50 18 00 00 96 14 80 00 B9 07 01 00 01 20 00 00 xid uba Lck Flaag Scn/Fscc xid : Transaction ID (UndoSeg.Slot.Wrap)值可以用select XIDUSN, XIDSLOT,XIDSQN from v$transaction;查到 This is

39、comprised of the rollback segment number (2 bytes), the slot numberin the transaction table of that rollback segment (2 bytes), and the numberof times use of that transaction table has wrapped (4 bytes). uba : Undo address (UndoDBA.SeqNo.RecordNo)The location of the undo for the most recent change t

40、o this block by this transaction. This is comprised of the DBA of the rollback segment block (4 bytes), the sequence number (2 bytes), and the record number for the change in that undo block (1 byte), plus 1 unused byte. Lck Flag: Lck 鎖定的row數(shù) 這里還用到了下一個(gè) byte 的數(shù)據(jù)2 對(duì)應(yīng)的二進(jìn)制表示為 0010 正好和dump文件中的 -U- 吻合flag

41、 1 nibble C = Committed; U = Commit Upper Bound; T = Active at CSC; B = Rollback of this UBA gives before image of the ITL.- = transaction is active, or committed pending cleanoutC- = transaction has been committed and locks cleaned out-B- = this undo record contains the undo for this ITL entry-U- =

42、 transaction committed (maybe long ago); SCN is an upper bound-T = transaction was still active at block cleanout SCNLck 3 nibbles The number of row-level locks held in the block by this transaction. Scn/Fsc : If the transaction has been cleaned out, this is the commit SCN or an upper bound thereof.

43、 Otherwise the leading two bytes contain the free space credit for the transaction - that is, the number of bytes freed in the block by the transaction Scn = SCN of commited TX; Fsc = Free space credit (bytes) 000140440 0E 89 43 00 00 00 00 00 00 00 00 00 00 00 00 00 Scn/Fscc 第2條itl 這里沒(méi)使用用 000140550

44、 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 00 第2條itl 這里沒(méi)使用用 flag ntab nrow 4 : 14 bytes 從這個(gè)flag位置開(kāi)始是data區(qū) 也是下面的行的offset的起始地址flag : N=pctfree hit(clusters), F=dont put on free list K=flushable cluster keys. 當(dāng)然還有別的標(biāo)記: A . ntab : 這block中有幾個(gè)table的數(shù)據(jù) cluster這個(gè)就可能大于1 nrow : block 有多少行數(shù)據(jù) 000140660 FF FF

45、 14 00 9B 1F 83 1F 83 1F 00 00 01 00 9B 1F frre fsbo fseo avsp tosp offs nrow row offfs frre : First free row index entry. -1=you have to add one. fsbo : Free Space Begin offset 出去row dict 后面的可以放數(shù)據(jù)的空間的起始位置也可以看成是從這個(gè)區(qū)域的開(kāi)始flag到最后一個(gè) row offs占用的空間 fseo : Free Space End offset ( 9.2.0 )參與db_block_checking

46、的計(jì)算剩余空間select 的時(shí)候oracle不是簡(jiǎn)單的根據(jù)offset定位row.這個(gè)值也是參與了定位row的 avsp : Available space in the block (pctfree and pctused) ORA-01578 tosp : Total available space when all TXs commit ( 9.2.0 )參與db_block_checking offs : 偏移量 用 cluster 的時(shí)候可以看出值 nrow : 這個(gè)table有多少行數(shù)據(jù) row offs : 這行數(shù)據(jù)相對(duì)的起始位置 after delete & commit i

47、s 0 xffff 00015FFF0 00 00 00 00 00 00 00 2C 01 01 01 61 05 06 0E 89 fb lb cc length data block ttail 5 : 用戶(hù)數(shù)據(jù)6 : 4 bytes block tailfb : K = Cluster Key (Flags may change meaning if this is set to show HASH cluster) C = Cluster table member H = Head piece of row D = Deleted row F = First data piece L

48、 = Last data piece P = First column continues from previous piece N = Last column continues in next piece lb : 和上面的 ITL 的lck相對(duì)應(yīng) 表示這行是否被 lock 了 cc : 有幾列數(shù)據(jù) 這里只能表示255列 超過(guò)了就會(huì)有鏈接行 length : 這列的數(shù)據(jù)的長(zhǎng)度是多少 0 xfa ( 250 bytes ) 其實(shí)0 xfb,0 xfc,0 xfd 也同樣是250bytes 0 xfe fb 00 ( 0 xfb 00 表示的251 bytes 0 xfe表示row的長(zhǎng)度超過(guò)

49、了250 bytes) 0 xff 表示number 的 null 這也是oracle中null的表現(xiàn)形式排序的時(shí)候null最大了字段的數(shù)據(jù)超過(guò)250字節(jié)是就用3bytes來(lái)表示字段的長(zhǎng)度,因?yàn)槿绻莑ong類(lèi)型它的字段再長(zhǎng)它在這個(gè)block中的數(shù)據(jù)的長(zhǎng)度不會(huì)超過(guò)64K 所以最長(zhǎng)用3bytes來(lái)表示行的長(zhǎng)度已經(jīng)夠了.再長(zhǎng)就鏈接行了 data : a block tail : 改這 block 最后的4 bytes 數(shù)據(jù)中的任意肯定ora-1578 第 1 byte : 對(duì)應(yīng)開(kāi)始的 seq 第 2 byte : 對(duì)應(yīng)開(kāi)始的 type 第3,4byte : 對(duì)應(yīng)開(kāi)始的scn的末2為 control

50、 file 這里是control seq 10.1.0lgoneeONE.LG.OKK creeate ttable a(v vvarchaar2(40000) TABLEESPACEE t;Table ccreateed.10.1.0lgoneeONE.LG.OKK inssert iinto aa valuues(aa);1 row ccreateed.Start ddump ddata bblockss tsn: 17 ffile#: 5 miinblk 10 maaxblk 10buffer tsn: 17 rddba: 00 x01400000a (5/100) / bufffer

51、tssn: 數(shù)據(jù)文文件對(duì)應(yīng)的 tableespacee 的 nuumber 這只是是dump文文件中記錄的的數(shù)據(jù)而已 bloock 中是是沒(méi)有記錄 tableespacee 的 nuumber 的 scn: 0 xx0000.00438890e sseq: 00 x05 fflg: 00 x02 ttail: 0 x8900e06055frmt: 00 x02 cchkvall: 0 x00000 ttype: 0 x06=transs dataaBlock hheaderr dumpp: 0 xx01400000a Objectt id oon Bloock? YY seg/obbj: 0

52、xxd254 csc: 0 x000.438990a iitc: 22 flgg: O typ: 1 - DDATA fssl: 0 fnx: 0 x0 ver: 0 x01 Itl Xiid UUba Flagg Lckk Sccn/Fscc0 x01 0 x00004.00cc.000001850 0 x0008014996.07bb9.01 -U- 11 fscc 0 x00000.000438900e0 x02 0 x00000.0000.000000000 0 x0000000000.00000.00 - 00 fscc 0 x00000.0000000000 data_bllock

53、_ddump,ddata hheaderr at 00 x87e1125c / datta_bloock_duump,daata heeader at 0 xx87e1225c 其實(shí)這這個(gè)blocck不是直接接從 datta bufffer 中中 dumpp 出來(lái)的這這個(gè)表示真正正dump時(shí)時(shí) blocck 的數(shù)據(jù)據(jù)區(qū)的起始位位置 也就是是下面這部分分開(kāi)始的位置置 = / tsiiz: hsizz: ppbl: bdbaa: 在數(shù)據(jù)據(jù)文件都是沒(méi)沒(méi)有存儲(chǔ)的 tsiz: 00 x1fa00 / Totaal datta areea sizze 88k的bloock: 88192-220(blooc

54、k heead)-224(Traansacttion HHeaderr)-24*2(一個(gè)事事務(wù)條)-44(blocck taiil)=80096(0 xx1fa0)hsiz: 00 x14 / Dataa headder siize 數(shù)數(shù)據(jù)塊頭200個(gè)字節(jié)+數(shù)數(shù)據(jù)塊尾4個(gè)個(gè)字節(jié)=244字節(jié)(0 xx14)pbl: 0 xx087e1125c / Poinnter tto bufffer hholdinng thee blocckbdba: 00 x01400000a 7665432110 flag=-ntab=1nrow=1frre=-11fsbo=0 xx14fseo=0 xx1f9bavs

55、p=0 xx1f83tosp=0 xx1f830 xe:ptii0 nrow=1 offfs=00 x12:prri0 offs=0 x1f9bblock_rrow_duump:tab 0, row 00, 0 xx1f9btl: 5 ffb: -H-FL- lb: 0 x1 cc: 1col 0: 1 61end_of_blockk_dumppEnd dummp datta bloocks ttsn: 117 fille#: 55 minbblk 100 maxbblk 100block 壞壞掉了還可以以報(bào): ORAA-600 (45199) Cacche laayer bblock typ

56、e is inncorreect ORAA-600 (43933) Cheeck foor Typpe forr Segmment hheaderr withh freee listt ORAA-600 (41366) Cheeck Roollbacck seggment blockk ORAA-600 (41544) Cheeck Roollbacck seggment blockk Oraa-600kcbzppb_1,d,kind,chkk getts siggnaledd whenn the blockk got corruupted in meemory. Thee onlyy way

57、 it shhould be baad is if a strayy storre intto memmory ddestrooyed tthe heeader or taail. d = bloccknumbber, kkind= kind of coorrupttion ddetectted,chhk = ccheckssum fllag oraa-6003398 and ora-660033339 oraa-6003398 is nnot inn oraccle 8. oraa-6003398 meanns it faileed a vverifiicatioon cheeck beef

58、ore writiing baack too diskk, soo it mmust be aan in-memorry corrruptiion. oraa-6003339 comees witth oraa-15788 and meanss eithher diisk coorrupttion oor in memorry corrruptiion affter rread. oraa-600 33399 hass beenn remooved ffrom 77.2+ Froom 7.22+ orra-6000 33998 haas beccome oora-6000 33374 wwit

59、h ssome ccheckss addeed.2進(jìn)制存儲(chǔ)格式式 ALLTER SSESSIOON SETT EVENNTS 110289 tracee namee conttext fforeveer, leevel 11; ALLTER SSESSIOON SETT EVENNTS 110289 tracee namee conttext ooff;為了回答一些疑疑問(wèn),引出本本系列文章,討討論鏈接參考考:htttp:/66094999.htmll當(dāng)我們們使用fille_hdrrs事件來(lái)轉(zhuǎn)轉(zhuǎn)儲(chǔ)數(shù)據(jù)文件件頭信息時(shí),OOraclee會(huì)轉(zhuǎn)儲(chǔ)兩部部分信息,一一部分來(lái)自控控制文件,一一部分來(lái)自數(shù)數(shù)據(jù)文

60、件,在在數(shù)據(jù)庫(kù)啟動(dòng)動(dòng)過(guò)程中,這這兩部分信息息要用來(lái)進(jìn)行行啟動(dòng)驗(yàn)證。在數(shù)據(jù)庫(kù)open的過(guò)程中,Oracle要進(jìn)行檢查中包含以下兩個(gè)過(guò)程:第一次檢查數(shù)據(jù)文件頭中的Checkpointcnt是否與對(duì)應(yīng)控制文件中的Checkpointcnt一致.如果相等,進(jìn)行第二次檢查.第二次檢查數(shù)據(jù)文件頭的開(kāi)始SCN和對(duì)應(yīng)控制文件中的結(jié)束SCN是否一致如果結(jié)束SCN等于開(kāi)始SCN,則不需要對(duì)那個(gè)文件進(jìn)行恢復(fù).對(duì)每個(gè)數(shù)據(jù)文件都完成檢查后,打開(kāi)數(shù)據(jù)庫(kù).同時(shí)將每個(gè)數(shù)據(jù)文件的結(jié)束SCN設(shè)置為無(wú)窮大.通過(guò)以下過(guò)程我們來(lái)進(jìn)一步說(shuō)明一下這個(gè)內(nèi)容。我們來(lái)看以下來(lái)自控制文件部分(選取一個(gè)文件 HYPERLINK /keyword/%

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論