刪除到期備份時報no channel allocated for maintenance(of an appropriate type)

來源:互聯網
上載者:User

標籤:刪除到期備份時報no channel allocated for maintenance(of an appropriate type)

問題描述:AIX 平台Oracle 10G,今天探索資料庫歸檔空間滿了,就通過crosscheck 後,執行delete force obsolete時報no channel allocated for maintenance(of an appropriate type) 錯誤,

原因分析:經過查詢可能是因為在之前的備份過程中採用了不同裝置類型備份導致不能正常刪除到期的備份

解決方案:

先摘錄一段對CROSSCHECK的描述

當archivelog或是backup被手工刪除後,需要運行crosscheck.該命令確保recoverycatalog或是控制檔案中記錄的資料與硬碟上的檔案一致。

 

對於找不到的檔案,CROSSCHECK會把它的狀態標為EXPIRED.然後,你運行DELETEEXPIRED命令就可以把rman repository中的相關記錄和硬碟上的檔案刪除。

 

如果有些檔案被錯誤地標為EXPIRED,那麼在確認檔案存在時,再次運行CROSSCHECKBACKUP可以將這些檔案重設為AVAILABLE狀態。

 

也就是說,對於硬碟上已經不存在的檔案,用DELETE EXPIRED在RMAN中刪除相關記錄。對於已經超過retentionpolicy的備份,用DELETE OBSOLETE從硬碟和磁帶裝置上刪除,並從RMAN中把記錄刪除。

 

在執行完

Crosscheck backup;

Crossscheck backuppiece;

Crosscheck archivelog all;

Delete obsolete;報RMAN-06091: no channel allocated formaintenance (of an appropriate type)

 

研究了一下,之前的備份一部分是直接備份在硬碟上,另一部分是通過DP備份在磁帶上的。出現這樣的錯誤是因為有磁帶上的資料,但是未申請磁帶類型的channel造成的。

 

RMAN> allocate channel for maintenance typedisk;

 

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 recoverycatalog

這個應該是正常的,沒有發現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   CompletionTime   Filename/Handle

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

BackupSet          2499  2011-11-24 11:39:28

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

BackupSet          2564  2011-11-26 21:18:57

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

BackupSet          2950  2011-12-14 14:45:40

 BackupPiece      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 anappropriate type)

這裡出錯了

 

解決的辦法是分別刪除硬碟上與磁帶上的到期備份資料。

RMAN>delete obsolete device type disk;--指定裝置類型,這樣就可以刪除指定的裝置中的資料

刪除硬碟上的到期備份

 

 

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   CompletionTime   Filename/Handle

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

BackupSet          2509  2011-11-24 14:28:32

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

BackupSet          2564  2011-11-26 21:18:57

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

BackupSet          2565  2011-11-26 21:19:20

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

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

BackupSet          2885  2011-11-27 20:44:15

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

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

BackupSet          2886  2011-11-27 20:44:21

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

BackupSet          2950  2011-12-14 14:45:40

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

BackupSet          2951  2011-12-14 14:45:46

 

 

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

deleted backup piece

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

deleted control file copy

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

deleted backup piece

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

deleted backup piece

backup piecehandle=/u01/oracle/flash_recovery_area/GZ/backupset/2011_12_14/o1_mf_annnn_TAG20111214T144526_7gjkjly0_.bkprecid=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=13stamp=768259119

deleted backup piece

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

Deleted 3 objects

這回成功了

 

 

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

 

這裡PARMS後面的參數與備份時RMAN指令碼中的參數相同

 

 

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   CompletionTime   Filename/Handle

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

BackupSet          2499  2011-11-24 11:39:28

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

 

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

 

 

deleted backup piece

backup piecehandle=swt-oracle-full<gz_7:768051562:1>.dbfrecid=1 stamp=768051562

Deleted 26 objects

這樣就成功了




本文出自 “我主梁緣” 部落格,請務必保留此出處http://xiaocao13140.blog.51cto.com/6198256/1970938

刪除到期備份時報no channel allocated for maintenance(of an appropriate type)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.