Deleting the Archive log Using RMAN

Once you are connected, then you can use the following to delete archivelogs with one of the following commands. You can choose the commands depending on your situation.

  1. To delete all Archivelogs withou backing them up:
delete archivelog all;
  1. To backup all archivelogs which are not already backed up atleast one time –And then perfome deletion
delete archivelog all backed up 1 times to device type disk;
  1. To delete archivelog upto a time which are not already backed up.

If they are already backed up, RMAN will juste delete them. If they are not backed up atleast one time, then RMAN will back them up first before deleting

delete archivelog until time ’2007-04-30:09:30:50′ backed up 1 times to device type disk;
  1. To delete archivelog upto a time (without backing them up):
delete archivelog until time “to_date(‘OCT 31 2008 23:00:00′,’Mon DD YYYY HH24:MI:SS’)”;
  1. To delete archivelog two days or older which are not already backed up.

[If they are already backed up, RMAN will juste delete them. If they are not backed up atleast one time, then RMAN will back them up first before deleting]

delete archivelog until time ‘sysdate-2′ backed up 1 times to device type disk;
  1. To delete archivelogs “immediately” which are older than 2 days
delete force archivelog until time ‘sysdate-2′;

 

  1. To delete all archivelogs that are not backed up atleast one time, and then delete them
backup archivelog all not backed up 1 times delete input;

 

Note-1: you can use “noprompt’ if you dont want RMAN to prompt you before deleting the archivelogs.

Note-2: you can use “force” if archivelogs are missing from the OS and you want to clean out the RMAN repository.

About tosasan

Just Me and my Bicycle
This entry was posted in ORACLE, RMAN and tagged . Bookmark the permalink.

Leave a comment