vicker313 tech blog

October 21, 2009

Recover Strategy of Oracle Database with Archive Log Enabled

Filed under: Oracle — Tags: , , , , — vicker313 @ 8:00 am

After we setup the Backup Strategy, we need to prepare for recovering. Basically it involves 2 major steps: restore and recover.

Restore database simply means uncompress (such as UNTAR) the full backup from the backup tape:

  1. Uncompressed the full backup from tape (assume the tape is known as /dev/st0)
    tar xvf /dev/st0
  2. Don’t try to start the database first before you finish the next step, recovering database.

Different between restore and recover is that: restore is directly extracted from a backup, while recover is rebuilding data of an outdated database (such as from a full backup) to a status of particular moment.

  1. Remove all the archived log in the archived log directory (assume it is /u01/oracle/archive)
    rm -fv /u01/oracle/archive/*
  2. Uncompressed the daily backup (which is the archived log) .
    tar xvf /dev/st0
  3. Start SQLPLUS as SYSDBA.
    sqlplus / as sysdba
  4. Start database in mount mode
    startup mount;
  5. In case you have problem in startup the database because of the parameter file is not set, issue the command below and try again:
    create spfile from pfile = 'dest_of_your_parameter_file';
  6. Then issue command below to start recover from archived log:
    recover database using backup controlfile until cancel
  7. It will keep asking for your comfirmation on the name of the archived log to be recovered. Either press Enter, the location of the archived log, or key in cancel to stop the recover.
  8. After recover open the database by issuing command below, aware that you won’t able the continue recover the archived log after issue this command, or else you need to start all over again from restoring database:
    alter database open resetlogs;
  9. In case you face problem in open the database, add _allow_resetlogs_corruption=true to the parameter file, issue command below and try again.
    create sp file from pfile = 'dest_of_your_parameter_file';
Advertisements

Leave a Comment »

No comments yet.

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

Blog at WordPress.com.

%d bloggers like this: