- Problem:
- Some of my (ExaCC) customers reported that Oracle archive logs are automatically deleted for some databases running on ExaCC cluster, even they haven't deleted or not configured a job to backup and delete archive logs.
- Overview:
- Whenever we create a database on ExaCC cluster from OCI console, Oracle will add a crontab job in VM cluster nodes to auto delete archive logs every 30 minutes.
- Oracle uses "bkup_api" tool to auto delete archive logs.
- Checking:
- As root user run below command to get the contents of "bkup_api" config file for your database.
/var/opt/oracle/bkup_api/bkup_api get config --file=/<output_file> --dbname=<DB_NAME>
- Search output config file for parameter "bkup_archlog_cron_entry". If the value is "yes", then this confirms that there is a scheduled job to automatic cleanup of archive logs.
$ cat /tmp/exadb_bkp.conf | grep bkup_archlog_cron_entry
bkup_archlog_cron_entry=yes
- As root user search "/etc/crontab" file for a cleanup entry specific to your database.
$ cat /etc/crontab_dba_bkp | grep exadb
19,49 * * * * oracle /var/opt/oracle/bkup_api/bkup_api bkup_archlogs --cron --dbname=exadb
As you can see above, there is a crontab job that cleanup archive logs for database exadb every 30 minutes.
- Solution:
- The recommended solution is configuring archive log deletion policy in RMAN repository.
For example,
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DEVICE TYPE DISK;
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DEVICE TYPE 'SBT_TAPE';
- A workaround solution, which is not recommended:
1. As a root user, take a backup of "/etc/crontab" file on ExaCC VM 1st node.
2. As a root user, edit file "/etc/crontab" and remove entry related to archive maintenance for each database.
In our example, remove below line.
19,49 * * * * oracle /var/opt/oracle/bkup_api/bkup_api bkup_archlogs --cron --dbname=exadb
NOTE: You need to remove line completely from crontab, commenting out may not work in ExaCC.
3. Check "/etc/crontab" file on other DB nodes also and make sure there are no entries for archive maintenance.