|
|
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已! |
|
恭喜您是本站第 1729934
位訪客!
登入 | 註冊
|
|
|
|
發表者 |
討論內容 |
冷日 (冷日) |
發表時間:2017/10/12 3:26 |
- 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
|
|
討論串
-
[轉貼]Oracle 11g 啟用 Archive Log Mode (冷日 (冷日), 2016/2/1 4:37)
-
[轉貼]Archive Log Mode (冷日 (冷日), 2016/2/1 4:40)
-
[轉貼]ORACLE ARCHIVE LOG Mode 筆記 (冷日 (冷日), 2016/2/1 4:42)
-
[轉貼]關於 Archive Log (冷日 (冷日), 2016/2/1 4:44)
-
[轉貼]Archive Log 路徑設錯解法 (冷日 (冷日), 2016/2/1 9:38)
-
[轉貼]Managing Archived Redo Logs (冷日 (冷日), 2017/10/12 3:22)
- »
[轉貼]How To Delete Specific Archivelogs and Backups Using RMAN (冷日 (冷日), 2017/10/12 3:26)
-
[轉貼]RESTORE DATABASE VALIDATE vs RESTORE ARCHIVE VALIDATE (冷日 (冷日), 2017/10/12 3:30)
-
[轉貼]Archivelog deletion policy for Standby Database in Oracle Data Guard (冷日 (冷日), 2017/10/12 3:35)
-
[轉貼]2 ways to move archivelogs – both need RMAN (冷日 (冷日), 2017/10/12 3:41)
|