4

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!

4

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).

  • 1
    right but what if there are archives present in the file system which RMAN doesnt detect in the first place? – tesla747 Oct 21 '15 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. – Petar Spasov Oct 21 '15 at 10:25
3

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);
0

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’; 
-2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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