溫馨提示×

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

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

刪除過(guò)期備份時(shí)報(bào)no channel allocated for maintenance(of an appropriate type)

發(fā)布時(shí)間:2020-08-24 04:00:20 來(lái)源:網(wǎng)絡(luò) 閱讀:920 作者:xiaocao13140 欄目:關(guān)系型數(shù)據(jù)庫(kù)

問(wèn)題描述:AIX 平臺(tái)Oracle 10G,今天發(fā)現(xiàn)數(shù)據(jù)庫(kù)歸檔空間滿(mǎn)了,就通過(guò)crosscheck 后,執(zhí)行delete force obsolete時(shí)報(bào)no channel allocated for maintenance(of an appropriate type) 錯(cuò)誤,

原因分析:經(jīng)過(guò)查詢(xún)可能是因?yàn)樵谥暗膫浞葸^(guò)程中采用了不同設(shè)備類(lèi)型備份導(dǎo)致不能正常刪除過(guò)期的備份

解決方案:

先摘錄一段對(duì)CROSSCHECK的描述

當(dāng)archivelog或是backup被手工刪除后,需要運(yùn)行crosscheck.該命令確保recovery catalog或是控制文件中記錄的數(shù)據(jù)與硬盤(pán)上的文件一致。

 

對(duì)于找不到的文件,CROSSCHECK會(huì)把它的狀態(tài)標(biāo)為EXPIRED.然后,你運(yùn)行DELETE EXPIRED命令就可以把rman repository中的相關(guān)記錄和硬盤(pán)上的文件刪除。

 

如果有些文件被錯(cuò)誤地標(biāo)為EXPIRED,那么在確認(rèn)文件存在時(shí),再次運(yùn)行CROSSCHECK BACKUP可以將這些文件重置為AVAILABLE狀態(tài)。

 

也就是說(shuō),對(duì)于硬盤(pán)上已經(jīng)不存在的文件,用DELETE EXPIRED在RMAN中刪除相關(guān)記錄。對(duì)于已經(jīng)超過(guò)retention policy的備份,用DELETE OBSOLETE從硬盤(pán)和磁帶設(shè)備上刪除,并從RMAN中把記錄刪除。

 

在執(zhí)行完

Crosscheck backup;

Crossscheck backuppiece;

Crosscheck archivelog all;

Delete obsolete;報(bào)RMAN-06091: no channel allocated for maintenance (of an appropriate type)

 

研究了一下,之前的備份一部分是直接備份在硬盤(pán)上,另一部分是通過(guò)DP備份在磁帶上的。出現(xiàn)這樣的錯(cuò)誤是因?yàn)橛写艓系臄?shù)據(jù),但是未申請(qǐng)磁帶類(lèi)型的channel造成的。

 

RMAN> allocate channel for maintenance type disk;

 

allocated channel: ORA_MAINT_DISK_6

channel ORA_MAINT_DISK_6: sid=137 devtype=DISK

 

RMAN> delete expired archivelog all;

 

specification does not match any archive log in the recovery catalog

這個(gè)應(yīng)該是正常的,沒(méi)有發(fā)現(xiàn)expired log.

 

RMAN> delete obsolete;

 

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

Deleting the following obsolete backups and copies:

Type                Key   Completion Time   Filename/Handle

-------------------- ------ ------------------ --------------------

Backup Set          2499  2011-11-24 11:39:28

 Backup Piece      2511  2011-11-24 11:39:28 swt-oracle-full<gz_7:768051562:1>.dbf

Backup Set          2564  2011-11-26 21:18:57

 Backup Piece      2567  2011-11-26 21:18:57 /backup/arc0dmsld1e

Backup Set          2950  2011-12-14 14:45:40

 Backup Piece      2955  2011-12-14 14:45:40 /u01/oracle/flash_recovery_area/GZ/backupset/2011_12_14/o1_mf_annnn_TAG20111214T144526_7gjkjly0_.bkp

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of delete command at 12/15/2011 17:05:42

RMAN-06091: no channel allocated for maintenance (of an appropriate type)

這里出錯(cuò)了

 

解決的辦法是分別刪除硬盤(pán)上與磁帶上的過(guò)期備份數(shù)據(jù)。

RMAN>delete obsolete device type disk;--指定設(shè)備類(lèi)型,這樣就可以刪除指定的設(shè)備中的數(shù)據(jù)

刪除硬盤(pán)上的過(guò)期備份

 

 

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

Deleting the following obsolete backups and copies:

Type                Key   Completion Time   Filename/Handle

-------------------- ------ ------------------ --------------------

Backup Set          2509  2011-11-24 14:28:32

 Backup Piece      2521  2011-11-24 14:28:32 /backup/sp

Backup Set          2564  2011-11-26 21:18:57

 Backup Piece      2567  2011-11-26 21:18:57 /backup/arc0dmsld1e

Backup Set          2565  2011-11-26 21:19:20

 Backup Piece      2568  2011-11-26 21:19:20 /backup/arc0emsld29

Control File Copy    2709  2011-11-26 21:42:33 /var/opt/omni/tmp/ctrl_gz.dbf

Backup Set          2885  2011-11-27 20:44:15

 Backup Piece      2888  2011-11-27 20:44:15 /backup/db_full_31.1

Control File Copy    2898  2011-11-27 20:43:57 /backup/bj.ctl

Backup Set          2886  2011-11-27 20:44:21

 Backup Piece      2889  2011-11-27 20:44:21 /backup/db_full_32.1

Backup Set          2950  2011-12-14 14:45:40

 Backup Piece      2955  2011-12-14 14:45:40 /u01/oracle/flash_recovery_area/GZ/backupset/2011_12_14/o1_mf_annnn_TAG20111214T144526_7gjkjly0_.bkp

Backup Set          2951  2011-12-14 14:45:46

 

 

Do you really want to delete the above objects (enter YES or NO)? YES

deleted backup piece

backup piece handle=/backup/db_full_31.1 recid=31 stamp=768343384

deleted control file copy

control file copy filename=/backup/bj.ctl recid=4 stamp=768343437

deleted backup piece

backup piece handle=/backup/db_full_32.1 recid=32 stamp=768343461

deleted backup piece

backup piece handle=/u01/oracle/flash_recovery_area/GZ/backupset/2011_12_14/o1_mf_annnn_TAG20111214T144526_7gjkjly0_.bkp recid=38 stamp=769877137

deleted backup piece

Deleted 17 objects

 

deleted backup piece

backup piece handle=/backup/sp recid=11 stamp=768061712

deleted backup piece

backup piece handle=/backup/arc0dmsld1e recid=13 stamp=768259119

deleted backup piece

backup piece handle=/backup/arc0emsld29 recid=14 stamp=768259146

Deleted 3 objects

這回成功了

 

 

RMAN> allocate channel for maintenance device type 'sbt_tape' PARMS 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=gz,OB2BARLIST=swt-oracle-full)';

 

這里PARMS后面的參數(shù)與備份時(shí)RMAN腳本中的參數(shù)相同

 

 

allocated channel: ORA_MAINT_SBT_TAPE_7

channel ORA_MAINT_SBT_TAPE_7: sid=136 devtype=SBT_TAPE

channel ORA_MAINT_SBT_TAPE_7: Data Protector A.06.11/243

 

RMAN> delete obsolete;

 

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

Deleting the following obsolete backups and copies:

Type                Key   Completion Time   Filename/Handle

-------------------- ------ ------------------ --------------------

Backup Set          2499  2011-11-24 11:39:28

 Backup Piece      2511  2011-11-24 11:39:28 swt-oracle-full<gz_7:768051562:1>.dbf

 

Do you really want to delete the above objects (enter YES or NO)? yes

 

 

deleted backup piece

backup piece handle=swt-oracle-full<gz_7:768051562:1>.dbf recid=1 stamp=768051562

Deleted 26 objects

這樣就成功了




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

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

AI