vicker313 tech blog

October 14, 2009

Backup Strategy of Oracle Database with Archived Log Enabled

Filed under: Oracle — Tags: , , , , — vicker313 @ 11:03 am

Below is a backup strategy of Oracle Database with the conditions:

  1. The database is Archived Log Enabled.
  2. 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.

  1. This will be performed every night of weekday.
  2. Identify where is your archived log placed (refer to log_archive_dest parameter in the parameter file).
  3. Set CRON job to TAR all the archived log into Tape (assume /dev/st0 is your tape drive and /u01/oracle/archive is your archive log directory):
    tar cvf /dev/st0 /u01/oracle/archive
  4. You may check the status of the Tape using command below:
    mt status
    Try to install mt-st package in case the command is not installed.
  5. 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.

  1. This will be performed during weekend.
  2. Shutdown the database (command might be different depend on your Oracle Environment Setting).
    service dbora stop
  3. TAR the whole database directory (assume /u01/oracle is where your database placed).
    tar cvf /dev/st0 /u01/oracle
  4. Verify the tape and save it as log.
    tar tvf /dev/st0 > fullbackup.log
  5. Remove the archived log (or the archived log will getting more and more until take out all your spaces).
    rm -fv /u01/oracle/archive/*
  6. Start the database.
    service dbora start

Continue to Recover Strategy.

Advertisements

2 Comments »

  1. Hi,

    Very interesting. Nice article and discussion.
    Thanks a lot for same.

    Regards,
    Gitesh Trivedi
    http://www.dbametrix.com

    Comment by dbametrix — October 20, 2009 @ 5:36 am

  2. […] Strategy of Oracle Database with Archive Log Enabled After we setup the Backup Strategy, we need to prepare for recovering. Basically it involves 2 major steps: restore and […]

    Pingback by Recover Strategy of Oracle Database with Archive Log Enabled « vicker313 tech blog — October 21, 2009 @ 8:23 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: