因為系統是直接以HP Data Protector,用RMAM直接備份到磁帶上,
檔案因為已經過期而刪掉。
所以想把RMAN的記錄也刪掉,但是卻發生無法刪除的狀況。
登入RMAN
oracle@hp7420 /> rman target system/system123
RMAN> list backup summary;
using target database controlfile instead of recovery catalog
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Tag
------- -- -- - ----------- --------------- ------- ------- ---
1516 B 2 A SBT_TAPE 06-NOV-12 1 1 TAG20121105T225453
1517 B A A SBT_TAPE 06-NOV-12 1 1 TAG20121106T030419
1518 B F A SBT_TAPE 06-NOV-12 1 1 TAG20121106T031446
1520 B 2 A SBT_TAPE 07-NOV-12 1 1 TAG20121106T225451
1521 B A A SBT_TAPE 07-NOV-12 1 1 TAG20121107T033351
1522 B F A SBT_TAPE 07-NOV-12 1 1 TAG20121107T034949
11月6日的檔案已經不在磁帶上,想把它刪除,先讓RMAN檢查過期或無效的Backupset
RMAN> crosscheck backup;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=339 devtype=DISK
由上可知,沒有任何的過期或無效的備份,但是11月6日的檔案確定已經刪除了。
發現allocated channel是ORA_DISK_1,並不是磁帶機。
RMAN> show default device type ;
RMAN configuration parameters are:
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
把Device Type改為SBT_TAPE
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1
再次執行檢查
RMAN> crosscheck backup;
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=339 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.05.50/330
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=301 devtype=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=7420_DB_Backup_incr_2.dbf recid=1498 stamp=798262135
(略)
查詢備份的狀態
RMAN> list backup summary;
using target database controlfile instead of recovery catalog
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Tag
------- -- -- - ----------- --------------- ------- ------- ---
1516 B 2 X SBT_TAPE 06-NOV-12 1 1 TAG20121105T225453
1517 B A X SBT_TAPE 06-NOV-12 1 1 TAG20121106T030419
1518 B F X SBT_TAPE 06-NOV-12 1 1 TAG20121106T031446
1520 B 2 A SBT_TAPE 07-NOV-12 1 1 TAG20121106T225451
1521 B A A SBT_TAPE 07-NOV-12 1 1 TAG20121107T033351
1522 B F A SBT_TAPE 07-NOV-12 1 1 TAG20121107T034949
可以刪除過期或無效的備份了
RMAN> DELETE FORCE EXPIRED BACKUPSET;
所以想把RMAN的記錄也刪掉,但是卻發生無法刪除的狀況。
登入RMAN
oracle@hp7420 /> rman target system/system123
RMAN> list backup summary;
using target database controlfile instead of recovery catalog
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Tag
------- -- -- - ----------- --------------- ------- ------- ---
1516 B 2 A SBT_TAPE 06-NOV-12 1 1 TAG20121105T225453
1517 B A A SBT_TAPE 06-NOV-12 1 1 TAG20121106T030419
1518 B F A SBT_TAPE 06-NOV-12 1 1 TAG20121106T031446
1520 B 2 A SBT_TAPE 07-NOV-12 1 1 TAG20121106T225451
1521 B A A SBT_TAPE 07-NOV-12 1 1 TAG20121107T033351
1522 B F A SBT_TAPE 07-NOV-12 1 1 TAG20121107T034949
11月6日的檔案已經不在磁帶上,想把它刪除,先讓RMAN檢查過期或無效的Backupset
RMAN> crosscheck backup;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=339 devtype=DISK
由上可知,沒有任何的過期或無效的備份,但是11月6日的檔案確定已經刪除了。
發現allocated channel是ORA_DISK_1,並不是磁帶機。
RMAN> show default device type ;
RMAN configuration parameters are:
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
把Device Type改為SBT_TAPE
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1
再次執行檢查
RMAN> crosscheck backup;
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=339 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.05.50/330
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=301 devtype=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=7420_DB_Backup_incr_2
(略)
查詢備份的狀態
RMAN> list backup summary;
using target database controlfile instead of recovery catalog
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Tag
------- -- -- - ----------- --------------- ------- ------- ---
1516 B 2 X SBT_TAPE 06-NOV-12 1 1 TAG20121105T225453
1517 B A X SBT_TAPE 06-NOV-12 1 1 TAG20121106T030419
1518 B F X SBT_TAPE 06-NOV-12 1 1 TAG20121106T031446
1520 B 2 A SBT_TAPE 07-NOV-12 1 1 TAG20121106T225451
1521 B A A SBT_TAPE 07-NOV-12 1 1 TAG20121107T033351
1522 B F A SBT_TAPE 07-NOV-12 1 1 TAG20121107T034949
可以刪除過期或無效的備份了
RMAN> DELETE FORCE EXPIRED BACKUPSET;