Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 2

Oracle DB Recovery From Hot Backup

Step By Step 18-Feb-2014

• Check DB is in Archive log mode.


• ARCHIVE LOG LIST or
• Select log_mode from v$database; (If DB is not in archivelog mode then
do following)
• SHUTDOWN IMMEDIATE
• STARTUP MOUNT
• ALTER DATABASE ARCHIVELOG;
• ALTER DATABASE OPEN;

SQL> select * from v$backup;

FILE# STATUS CHANGE# TIME


---------- ------------------ ---------- ---------
1 NOT ACTIVE 0
2 NOT ACTIVE 0
.
.

• ALTER DATABASE BEGIN BACKUP;


SQL> select * from v$backup;

FILE# STATUS CHANGE# TIME


---------- ------------------ ---------- ---------
1 ACTIVE 0
2 ACTIVE 0
.
Create directory at OS level & Copy all datafiles into that directory
• ALTER DATABASE END BACKUP;
SQL> select * from v$backup;
FILE# STATUS CHANGE# TIME
---------- ------------------ ---------- ---------
1 NOT ACTIVE 0
2 NOT ACTIVE 0

• ALTER DATABASE BACKUP CONTROLFILE TO '/Path/Control_bak';

Optional
Do some Crete/Insert/Delete and commit + log switch alter each DDL.
Optional End
Take OS level backup of archive logs.Now Delete all datafiles, controlfil & archive
log file.

SQLPLUS / AS SYSDBA
STARTUP
ORA-00205 Error will occur
SHUTDOWN ABORT

Copy all datafiles and archivelog files back to its original position.
Copy control_bak to its original position as control01.ctl,control02.ctl and
control03.ctl (three identical copies, b/c oracle aspect 3 copies with these names)

SQLPLUS / AS SYSDBA

STARTUP
ORA-01589----------------
SHUTDOWN ABORT
SQLPLUS / AS SYSDBA
STARTUP MOUNT
RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE;

(if we want to apply some logs and want to see result, just enter and after
applying a logfile, cancel media recovery)

• ALTER DATABASE OPEN READ ONLY; (Use select cmd to check recovery at this
point)
• RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE;
Give AUTO and press enter.
ALTER DATABASE OPEN;

You might also like