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:
- Uncompressed the full backup from tape (assume the tape is known as
tar xvf /dev/st0
- 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.
- Remove all the archived log in the archived log directory (assume it is
rm -fv /u01/oracle/archive/*
- Uncompressed the daily backup (which is the archived log) .
tar xvf /dev/st0
- Start SQLPLUS as SYSDBA.
sqlplus / as sysdba
- Start database in mount mode
- 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';
- Then issue command below to start recover from archived log:
recover database using backup controlfile until cancel
- 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.
- 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;
- In case you face problem in open the database, add
_allow_resetlogs_corruption=trueto the parameter file, issue command below and try again.
create sp file from pfile = '