搜尋此網誌

星期六, 6月 25, 2011

rman 舊備份記錄清除

最近新接手一套9i rac

因此開始要進行一堆翻修的動作。

當然第一個要做的就是備份。

9i之後的備份,已經不太去進行exp / imp的動作

原因是要花太多的時間,尤其是imp時還要注意許多schema與權限問題。

因此我一律採用Rman的備份。

不過今天要說的這套,因為有"前人"努力過,所以留下了一堆殘缺不全的內容。

在我備份完後,進行清除舊資料時,發現原先用磁帶備份的資料,會產生錯誤造成rman執行不完整。

delete force noprompt obsolete;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of delete command at 06/26/2011 02:33:41
RMAN-06091: no channel allocated for maintenance (of an appropriate type)


怎麼刪都刪不掉,一直以為是因為之前備份是用tape,所以才備份失敗

所以改用:

configure device type 'sbt_tape' clear;

CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' CLEAR;

想來清除與磁帶相關上的記錄

結果還是沒變。

一直到這個指令出現,才是正確解答(的一部份)

RMAN> delete noprompt obsolete device type disk;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=588 devtype=DISK
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 15385 24-JUN-11
Backup Piece 15385 24-JUN-11 /oracle/dbs/c-1189594198-20110624-00
Datafile Copy 412 25-NOV-05 /dev/vx/rdsk/testdg/tools_50
Datafile Copy 413 25-NOV-05 /dev/vx/rdsk/testdg/index-his-30g
Datafile Copy 414 25-NOV-05 /dev/vx/rdsk/testdg/userdb_pacs_02_2048
Datafile Copy 415 25-NOV-05 /dev/vx/rdsk/testdg/userdb_his_10_10240
Datafile Copy 444 29-DEC-05 /dev/vx/rdsk/testdg/userdb_his_03_10240
Datafile Copy 445 29-DEC-05 /dev/vx/rdsk/testdg/userdb_his_04_10240
Datafile Copy 446 29-DEC-05 /dev/vx/rdsk/testdg/userdb_pacs_01_4096
Datafile Copy 447 29-DEC-05 /dev/vx/rdsk/testdg/userdb_his_05_10240
Datafile Copy 448 29-DEC-05 /dev/vx/rdsk/testdg/userdb_his_02_10240
Controlfile Copy 1267 02-MAY-08 /oracle/rscp/pacsctlbk.ctl
deleted backup piece
backup piece handle=/oracle/dbs/c-1189594198-20110624-00 recid=15385 stamp=754671617
deleted controlfile copy
controlfile copy filename=/oracle/rscp/pacsctlbk.ctl recid=1267 stamp=653691555
Deleted 2 objects

RMAN-06207: WARNING: 9 objects could not be deleted for DISK channel(s) due
RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status
List of Mismatched objects
==========================
Object Type Filename/Handle
--------------- ---------------------------------------------------
Datafile Copy /dev/vx/rdsk/testdg/tools_50
Datafile Copy /dev/vx/rdsk/testdg/index-his-30g
Datafile Copy /dev/vx/rdsk/testdg/userdb_pacs_02_2048
Datafile Copy /dev/vx/rdsk/testdg/userdb_his_10_10240
Datafile Copy /dev/vx/rdsk/testdg/userdb_his_03_10240
Datafile Copy /dev/vx/rdsk/testdg/userdb_his_04_10240
Datafile Copy /dev/vx/rdsk/testdg/userdb_pacs_01_4096
Datafile Copy /dev/vx/rdsk/testdg/userdb_his_05_10240
Datafile Copy /dev/vx/rdsk/testdg/userdb_his_02_10240

哈,只刪了一個Control file,不過還好,至少沒有錯誤訊息了。

由於這個Device type disk 的提示,我後來就進行Crosscheck copy的找出已經失效檔案,再進行刪除記錄:

RMAN> delete noprompt obsolete device type disk;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=588 devtype=DISK
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Datafile Copy 412 25-NOV-05 /dev/vx/rdsk/testdg/tools_50
Datafile Copy 413 25-NOV-05 /dev/vx/rdsk/testdg/index-his-30g
Datafile Copy 414 25-NOV-05 /dev/vx/rdsk/testdg/userdb_pacs_02_2048
Datafile Copy 415 25-NOV-05 /dev/vx/rdsk/testdg/userdb_his_10_10240
Datafile Copy 444 29-DEC-05 /dev/vx/rdsk/testdg/userdb_his_03_10240
Datafile Copy 445 29-DEC-05 /dev/vx/rdsk/testdg/userdb_his_04_10240
Datafile Copy 446 29-DEC-05 /dev/vx/rdsk/testdg/userdb_pacs_01_4096
Datafile Copy 447 29-DEC-05 /dev/vx/rdsk/testdg/userdb_his_05_10240
Datafile Copy 448 29-DEC-05 /dev/vx/rdsk/testdg/userdb_his_02_10240
deleted datafile copy
datafile copy filename=/dev/vx/rdsk/testdg/tools_50 recid=412 stamp=575303261
deleted datafile copy
datafile copy filename=/dev/vx/rdsk/testdg/index-his-30g recid=413 stamp=575307628
deleted datafile copy
datafile copy filename=/dev/vx/rdsk/testdg/userdb_pacs_02_2048 recid=414 stamp=575313295
deleted datafile copy
datafile copy filename=/dev/vx/rdsk/testdg/userdb_his_10_10240 recid=415 stamp=575317535
deleted datafile copy
datafile copy filename=/dev/vx/rdsk/testdg/userdb_his_03_10240 recid=444 stamp=578337094
deleted datafile copy
datafile copy filename=/dev/vx/rdsk/testdg/userdb_his_04_10240 recid=445 stamp=578339270
deleted datafile copy
datafile copy filename=/dev/vx/rdsk/testdg/userdb_pacs_01_4096 recid=446 stamp=578340124
deleted datafile copy
datafile copy filename=/dev/vx/rdsk/testdg/userdb_his_05_10240 recid=447 stamp=578340816
deleted datafile copy
datafile copy filename=/dev/vx/rdsk/testdg/userdb_his_02_10240 recid=448 stamp=578342100
Deleted 9 objects

至此,問題終於解決了。

沒有留言: