Linux – Oracle – Archivelog files , can we delete them

linuxoracle

We have RHEL 7.2 machine where Oracle is installed. Recently this machine ran out of space and we figured out that most of the space is going into "/home/oracle/ORA12C/fast_recovery_area//archivelog"

Within this folder , we have multiple datewise folder and each folder contains .arc files
Is it ok to directly delete folder which are one year ago?

Best Answer

It sounds like you have not been doing regular housekeeping by performing an rman backup of the archivelogs and using the DELETE INPUT option of the BACKUP ARCHIVELOG command. If this is truly a test machine, I wou ld first manually delete the archives using the proper OS command. That will physically free up the disk space. Then you need to inform Oracle of that fact:

rman target /

rman> crosscheck archivelog all; -- this will detect that the logs have gone missing and mark their records in the control file as 'expired'

rman> delete noprompt expired archivelog all; -- this will remove the record of the archivelogs from the control file and adjust the FRA usage accordingly

rman> backup database plus archivelog all delete all input;

An important concept that many miss is that the FRA is merely a bookeeping mechanism. It does not physically reserve space on the disk and does not guarantee that the specified space is actually available. As regards the archlogs, when one is created, a record of that is written to the control file. If the log is deleted manuall, the FRA bookeeping mechanism doesn't know and thinks the file is still there consuming space.

If you are in archlog mode, you need to be taking regular backups, including backups of the archlogs with the DELETE INPUT option.