Below is a backup strategy of Oracle Database with the conditions:
- The database is Archived Log Enabled.
- The database can be shutdown during weekend.
Archived log records down all the transactions that be performed in the database, which can serve as backup or trace log. It can even be backup when the database is up (hot backup). This strategy is using Linux environment, but you may apply the method to other OS. It involves 2 parts: daily backup (the hot backup) and weekend backup (or full backup, cold backup):
Daily Backup: AKA hot backup, which the backup is performed when database is up.
- This will be performed every night of weekday.
- Identify where is your archived log placed (refer to
log_archive_destparameter in the parameter file).
- Set CRON job to TAR all the archived log into Tape (assume
/dev/st0is your tape drive and
/u01/oracle/archiveis your archive log directory):
tar cvf /dev/st0 /u01/oracle/archive
- You may check the status of the Tape using command below:
Try to install
mt-stpackage in case the command is not installed.
- To verify the content of the tape and save it as a log by using command below:
tar tvf /dev/st0 > dailybackup.log
Weekend Backup: AKA cold backup because it is performed when the database is shutdown.
- This will be performed during weekend.
- Shutdown the database (command might be different depend on your Oracle Environment Setting).
service dbora stop
- TAR the whole database directory (assume
/u01/oracleis where your database placed).
tar cvf /dev/st0 /u01/oracle
- Verify the tape and save it as log.
tar tvf /dev/st0 > fullbackup.log
- Remove the archived log (or the archived log will getting more and more until take out all your spaces).
rm -fv /u01/oracle/archive/*
- Start the database.
service dbora start
Continue to Recover Strategy.