溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

怎么解決Oracle數(shù)據(jù)庫中未清空磁盤被添加到磁盤組觸發(fā)壞塊問題

發(fā)布時(shí)間:2021-11-05 10:37:10 來源:億速云 閱讀:233 作者:iii 欄目:關(guān)系型數(shù)據(jù)庫

這篇文章主要介紹“怎么解決Oracle數(shù)據(jù)庫中未清空磁盤被添加到磁盤組觸發(fā)壞塊問題”,在日常操作中,相信很多人在怎么解決Oracle數(shù)據(jù)庫中未清空磁盤被添加到磁盤組觸發(fā)壞塊問題問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”怎么解決Oracle數(shù)據(jù)庫中未清空磁盤被添加到磁盤組觸發(fā)壞塊問題”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

問題描述

收到系統(tǒng)維護(hù)人員通知,Oracle數(shù)據(jù)庫軟件目錄突然異常爆滿,需要及時(shí)清理。登陸環(huán)境后檢查發(fā)現(xiàn)告警日志不斷的刷新日志,刷新的內(nèi)容為檢測到有壞塊。

部分告警日志內(nèi)容如下:

Reading datafile '+xx01/xxx85' for corruption at rdba: 0x1c4b3afc (file x3,  block 474692348)
Read datafile mirror 'xxx02' (file x3, block 47xx48) found same  corrupt data (no logical check)
Read datafile mirror ' xxx 53' (file x3, block 47xx48) found valid data
Hex  dump of (file x3, block 47xx48) in trace file /xxx130931.trc
Repaired corruption at (file x3,  block 47  xxx  48)
Hex  dump of (file x3, block 47xxx24) in trace file /xx931.trc
Corrupt  block relative dba: 0x1c308c08 (file x3, block 47xx4)
Bad  header found during buffer read
Data  in bad block:
type: 0 format: 6 rdba: 0x34363835
last change scn: 0x3833.35313431 seq: 0x30  flg: 0x37
spare1: 0x31 spare2: 0x36 spare3: 0xf00
consistency value in tail: 0x30520300
check value in block header: 0x36
computed block checksum: 0x6060
Reading  datafile '+xxxx8685' for corruption at rdba: 0x1c308c08 (file x3, block 47xx24)
Read datafile mirror 'xxxx2'  (file x3, block 47xx24) found same corrupt data (no logical check)
Read  datafile mirror 'xxx3' (file x3, block 47xx24) found valid data
Hex  dump of (file x3, block 47xxx24) in trace file /xxx0931.trc
Sat  Nov 09 12:48:17 2019
Hex  dump of (file x3, block 14xxx7) in trace file /xxx22.trc
Corrupt  block relative dba: 0x1ed647db (file x3, block 14xxx7)
Bad  header found during buffer read
Data  in bad block:
type: 73 format: 6 rdba: 0x5454415f
last change scn: 0x0e00.00440052 seq: 0x0  flg: 0x00
spare1: 0x53 spare2: 0x54 spare3: 0x0
consistency value in tail: 0x01006541
check value in block header: 0xa00
block checksum disabled
Reading  datafile '+xxxx17527' for corruption at rdba: 0x1ed647db (file x3, block 14xxx7)
Read datafile mirror 'xx002'  (file x3, block 14xxx7) found same corrupt data (no logical check)
Read  datafile mirror 'xxx0' (file x3, block 14xxx7) found valid data
Hex  dump of (file x3, block 14xx7) in trace file /xxx2.trc
Repaired corruption at (file x3,  block 14xxx7)

問題分析

通過告警日志中出現(xiàn)的信息,我們查看這些問題數(shù)據(jù)塊發(fā)現(xiàn),涉及的類型包含表和索引等。

select  relative_fno,owner,segment_name ,segment_type   from dba_extents where file_id = x3 and 35xxxx9 between block_id and  block_id + blocks -1;
RELATIVE_FNO      OWNER       SEGMENT_NAME       SEGMENT_TYPE
----------------------    --------------      -------------------------      ---------------------
1024                           IxxxL                 PxxxT                          INDEX

RELATIVE_FNO      OWNER       SEGMENT_NAME       SEGMENT_TYPE
----------------------    --------------      -------------------------      ---------------------
124                            IxxxM                 OxxxT                         TABLE

使用DBV 進(jìn)行檢查校驗(yàn):


……
Page 278199 is marked  corrupt
Corrupt block relative  dba: 0x21843eb7 (file x4, block 2xx9)
Bad header found during  dbv:
Data in bad block:
type: 0 format: 4 rdba: 0x0000ffff
last change scn: 0x0000.00000000 seq: 0x0  flg: 0x1d
spare1: 0x0 spare2: 0xa spare3: 0x0
consistency value in tail: 0x31040000
check value in block header: 0x1500
computed block checksum: 0xe403

Page 278200 is marked  corrupt
Corrupt block relative  dba: 0x21843eb8 (file x4, block 2xx0)
Bad header found during  dbv:
Data in bad block:
type: 48 format: 0 rdba: 0x000a0018
last change scn: 0x3031.31060000 seq: 0x30  flg: 0x30
spare1: 0x30 spare2: 0x0 spare3: 0x19
consistency value in tail: 0x000b0000
check value in block header: 0x31
block checksum disabled
…………此處省略n行

相關(guān)Trace 中記錄:


Corrupt block relative  dba: 0x2180ba80 (file x4, block 4xx4)
Bad header found during  user buffer read
Data in bad block:
type: 82 format: 0 rdba: 0x534e4901
last change scn: 0x4546.464f2e54 seq: 0x52  flg: 0x5f
spare1: 0x0 spare2: 0x0 spare3: 0x5453
consistency value in tail: 0x0908bdf2
check value in block header: 0x4e49
computed block checksum: 0x66c6
Reading datafile '+xxx05'  for corruption at rdba: 0x2180ba80 (file x4, block 4xx4)
ksfdrfms:Mirror Read  file=+xxx905 fob=0x246076cb80 bufp=0x7f9a07619c00 blkno=47744 nbytes=8192
ksfdrfms: Read success  from mirror side=1 logical extent number=0 disk=xxx2 path=/dev/axxx1
Mirror I/O done from ASM  disk /dev/axxx1
Read datafile mirror 'xxx02'  (file x4, block 4xx4) found same corrupt data (no logical check)
ksfdrnms:Mirror Read  file=+xxx7905 fob=0x246076cb80 bufp=0x7f9a07619c00 nbytes=8192
ksfdrnms: Read success  from mirror side=2 logical extent number=1 disk=xxx3 path=/dev/axxx4
Mirror I/O done from ASM  disk /dev/axxx4
Read datafile mirror 'xxx3'  (file x4, block 4xx4) found valid data
Hex dump of (file x4,  block 4xx4)

仔細(xì)觀察發(fā)現(xiàn),每次的壞塊報(bào)錯(cuò)都十分相似,如下所示:

Read datafile mirror 'xxx2'(file x3, block 47xxx48) found same corrupt data (no logical check)

我們進(jìn)一步細(xì)看日志,發(fā)現(xiàn)有一共同特點(diǎn)是基本都是磁盤名為 xxx2與其他磁盤名中都發(fā)現(xiàn)了相同的數(shù)據(jù)塊, 并且這些數(shù)據(jù)塊中有效的數(shù)據(jù)塊都在其他磁盤中,反而無效的數(shù)據(jù)壞塊卻全都在磁盤/dev/axxx1 (也就是磁盤名:xxx2) , 因此猜測可能和這塊磁盤的相關(guān)操作有關(guān),進(jìn)一步了解與發(fā)現(xiàn),這塊磁盤之前原本就是磁盤組xxx1 中的一塊盤,但由于某些原因?qū)е逻@塊磁盤不在該磁盤組,然后他們在異常時(shí)間的前一天又重新添加該磁盤,最后真相浮出水面,由于 /dev/axxx1 的舊數(shù)據(jù)尚未被清空,導(dǎo)致添加磁盤后,舊塊與新塊沖突,數(shù)據(jù)庫異常報(bào)錯(cuò),撐爆軟件目錄。

而xxx1 磁盤組的冗余度是 NORMAL ,簡單舉例說明下 ,oracle根據(jù)鏡像個(gè)數(shù)不同,磁盤組的冗余度被劃分為以下3種:

1)外部冗余(External redundancy):數(shù)據(jù)沒有鏡像。這種情況適用于已經(jīng)使用底層存儲(chǔ)軟件對數(shù)據(jù)做過鏡像的系統(tǒng)。

2)普通冗余(Normal redundancy): 1路鏡像。這種冗余度適用于大部分系統(tǒng)。

3)高冗余(High redundancy) : 2路鏡像。這種冗余度適合保存系統(tǒng)的重要數(shù)據(jù),當(dāng)然這也意味著會(huì)占用更多的空間。

Oracle鏡像數(shù)據(jù)是通過failuregroup (失敗組)的方式來實(shí)現(xiàn)的。也就是說由于xxx1 磁盤組是normal 冗余,在保留一份鏡像的同時(shí)Oracle會(huì)保證每一個(gè)Extent和它對應(yīng)的鏡像不會(huì)保存在相同的failure group中,從而確保了當(dāng)failure group中的某一個(gè)或多個(gè)磁盤,甚至整個(gè)failure group全部丟失時(shí)也不會(huì)有數(shù)據(jù)丟失;當(dāng)磁盤/dev/axxx1重新加入到磁盤組中時(shí),ASM再平衡功能會(huì)讓磁盤組中所有磁盤上的文件extent 均衡的分布,該過程是由后臺進(jìn)程RBAL進(jìn)行處理。當(dāng)分布的鏡像與磁盤/dev/axxx1 中的舊數(shù)據(jù)存在沖突時(shí),將報(bào)錯(cuò)。

問題解決

直接剔除問題磁盤,dd磁盤,清除舊數(shù)據(jù),再重新添加回來,問題解決,故障恢復(fù)。


alter diskgroup xxx1  drop disk 'Oxxxx2';

dd if=/dev/zero  of=/dev/asxxx1 bs=1M count=256

到此,關(guān)于“怎么解決Oracle數(shù)據(jù)庫中未清空磁盤被添加到磁盤組觸發(fā)壞塊問題”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注億速云網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI