10

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!

tesla747
  • 1,910
  • 10
  • 42
  • 77

5 Answers5

9

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

Petar Spasov
  • 176
  • 1
  • 6
8

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);
Kris Johnston
  • 1,153
  • 1
  • 10
  • 26
4

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’; 
Commando
  • 41
  • 1
2

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

kunz
  • 121
  • 3
-3

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