ORACLE RMAN下针对带库设备的操作
带库或VTL作为关键业务的备份。虽在普通用户接触较少,但整体使用量还是比較大。
非常多实例在做专业备份软件的同一时候会採用disk方式在本地或共享地址上再备一次,假设专业备份软件採用的是带库或VTL方式进行存储。在cross check后发现存在大量的备份集仍然无法删除,能够參考本文。
export ORACLE_SID=bzzh1
date >> /home/oracle/rman_log/rman_delete.log
rman target / append << EOF
configure device type disk parallelism 16;
allocate channel for maintenance device type disk;
run
{
crosscheck backup;
delete expired backup;
crosscheck archivelog all;
delete noprompt obsolete device type disk;
delete noprompt expired archivelog all;
}
release channel;
##for TAPE##
allocate channel for maintenance device type 'sbt_tape';
run
{
crosscheck backup;
delete expired backup;
crosscheck archivelog all;
delete noprompt obsolete device type 'sbt_tape';
delete noprompt expired archivelog all;
}
release channel;
EOF
date >> /home/oracle/rman_log/rman_delete.log
须要注意,仅当backupset的Device Type为SBT_TAPE是參考本文才有意义。
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3177 Incr 0 256.00K SBT_TAPE 00:00:47 30-JUL-15
BP Key: 3137 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Handle: bk_3229_1_886451722 Media:
SPFILE Included: Modification time: 10-JUL-15
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
3179 83.75M SBT_TAPE 00:00:57 30-JUL-15
BP Key: 3139 Status: AVAILABLE Compressed: NO Tag: TAG20150730T203744
Handle: al_3230_1_886451865 Media:
List of Archived Logs in backup set 3179
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 4005 12030094721658 30-JUL-15 12030095358801 30-JUL-15
1 4006 12030095358801 30-JUL-15 12030095373861 30-JUL-15