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

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_60D_00080.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

DB研討會 : [轉貼]Oracle 11g 啟用 Archive Log Mode

發表者 討論內容
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15773
[轉貼]How To Delete Specific Archivelogs and Backups Using RMAN
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
前一個主題 | 下一個主題 | | | |

討論串




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