How to Force Oracle RMAN to Delete All Archive log files

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
As a DBA, in many situations you get archive destination going to be filled or filled with archivelogs. Immedidately you are force to remove some or all archives. Here are the commands to remove the archivelogs.
Note: If you remove archivelogs with out backing up it is better to take a fresh level 0 backup of the database to avoid the data lose.

Commands:

RMAN> delete archivelog all;

released channel: ORA_DISK_1
released channel: ORA_DISK_2
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=396 instance=PROD41 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=464 instance=PROD41 device type=DISK
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=+RECO/PROD4/archivelog/2011_12_03/thread_1_seq_1720.4904.768890065 thread=1 sequence=1720

Normally you get warning message if you try to delete the archive log files which are not backed up. In that case you have to FORCE keyword to delete the archive logs.


RMAN> delete force archivelog all;

released channel: ORA_DISK_1
released channel: ORA_DISK_2
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=396 instance=PROD41 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=464 instance=PROD41 device type=DISK
List of Archived Log Copies for database with db_unique_name PROD4

Suppose if you wanted to remove the archive logs using some pattern you can use the below mentioned command.

RMAN> delete  force  archivelog like '+RECO/prod4/archivelog/2011_10_03/*17*';

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer