8

So I have an Oracle database (standalone) running in RHEL and I have scheduled RMAN for backups on daily and weekly basis. Sometimes my file system (archive mount-point) becomes full because of high archive generation. Now what is the right way to delete the archives from the file system?

My RMAN script has this

delete archivelog all completed before 'SYSDATE-5'

but the above command isnt deleteing the archives properly as I see, some of the very old archives are still there..

How to delete them properly?

Should I run crosscheck archivelog all? and then run the above command once again? What is the right way?

Thanks!

5 Answers 5

8

In order to delete them you can do: RMAN>crosscheck archivelog all; RMAN>delete noprompt expired archivelog all; , you can also include the delete input clause when you back them up, and they will be deleted after they have been backed up (it is up to you). You can try and run the command you have shown manually to see what will happen in RMAN (in other words, does it work or does it give an error).

2
  • 1
    right but what if there are archives present in the file system which RMAN doesnt detect in the first place?
    – tesla747
    Oct 21, 2015 at 10:04
  • 2
    Do you perform a backup of those archivelogs beforehand? If not that might be the reason , oracle won't allow you to delete such archive logs that are not backed up so you have to use the FORCE switch DELETE force archivelog ALL completed before 'SYSDATE-5' . But bear in mind that you cannot recover the database without these archive logs. Also if you have manually deleted the archivelogs from the FS or ASM you will need to crosscheck them and delete them as expired as I`ve pointed out above. Oct 21, 2015 at 10:25
7

If RMAN doesn't know about the archives on disk (were copied from some other location), then you can tell RMAN about the archive files via the catalog command:

RMAN> CATALOG START WITH '/disk2/archlog' NOPROMPT;

Then run your archivelog backup:

RMAN> backup check logical as compressed backupset (archivelog all delete all input);
3

you can simply just issue this command if what you are looking for is to delete until a certain date

RMAN>delete archivelog until time ‘SYSDATE-10’;

or you can run this with the noprompt option if you do not want to be asked for a yes or no

RMAN>delete noprompt archivelog until time ‘SYSDATE-10’; 
1

so this is what i did

RMAN> delete archivelog all completed before 'sysdate-15';

The above command should be used once the archive logs has been applied to the standby database

If the above gives an error like

RMAN-08120: warning: archived log not deleted, not yet applied by standby

We can do a forceful delete:

RMAN> delete force archivelog all completed before 'sysdate-15';

<< This will delete archivelogs older then 15 days. Can adjust time per your requirement >>

-3

type rman from oracle user then hit connect target then delete archivelog all;

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.