茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1672401 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
GoodSmile_LuskyStar x StreetFighter_00031.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2017/10/12 3:26:12
How To Delete Specific Archivelogs and Backups Using RMAN

January 12, 2016 by Imran / Oracle 11g

As part of the regular backup file log maintenance, the recovery window and redundancy commands are usually used within backup scripts to define how long the RMAN backups would stay on disk or on tape.

For archive log retention, the DELETE ARCHIVELOG command is utilized.

DELETE Archive Logs using RMAN

To clean-up older archives the “backup archivelog delete input” is very commonly used to manage the archive log retention on disk.

This however has a very serious drawback because as soon as the backup is finished all the archive logs are purged.

In this scenario if recovery is required then the backup of the archive from tape has to be restored and then they can be applied. This increases the downtime due to the slower recovery rate from tape.

Also for environments that extract data from archive logs, immediate purging of these log files could interfere with processes like Golden Gate and Streams, in case these processes are down for some reason and the backup job fires, it will remove the archive logs that will be required on the process start-up.

Thus to retain these archive logs for a longer time the following can used in the RMAN backup script to manage the archive logs on disk.
RMAN>DELETE ARCHIVELOG ALL COMPLETED BEFORE ‘sysdate-1’;
RMAN>DELETE ARCHIVELOG ALL BACKED UP 2 TIMES to disk;
RMAN>DELETE NOPROMPT ARCHIVELOG UNTIL SEQUENCE = 3790;

Oracle does not allow deleting of older archive, the workaround is to use the “FORCE” keyword if we are sure that we no longer need those archives.
RMAN> DELETE FORCE ARCHIVELOG ALL BACKED UP 2 TIMES to disk;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=72 device type=DISK
List of Archived Log Copies for database with db_unique_name SAN_HA01
=========================================

Key Thrd Seq S Low Time
——- —- ——- – ——————–
1195 1 533 A 25-APR-2013 11:46:48
Name: /oradata/oltp/ps3arc_533.arc

1196 1 534 A 25-APR-2013 11:48:20
Name: /oradata/oltp/ps3arc_534.arc

….
….

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

deleted archived log
archived log file name=/oradata/oltp/ps3arc_533.arc RECID=1195 STAMP=813671303
deleted archived log
archived log file name=/oradata/oltp/ps3arc_534.arc RECID=1196 STAMP=813671412
deleted archived log
….
….
Deleted 39 objects

Delete Archivelog Backups

The following command can be used to manage the backup of the archive log when storage space needs to be released.
RMAN>DELETE BACKUP OF archivelog UNTIL TIME=’sysdate-5′;

Obsolete database backups

Backups that fall outside the specified recovery window can be purged using the obsolete command
RMAN>DELETE OBSOLETE RECOVERY WINDOW OF 4 DAYS;

You may want to look into this as well Restore database validate v/s Restore archive validate

原文出處:How To Delete Specific Archivelogs and Backups Using RMAN - VitalSoftTech
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|