RelationalDBDesign RelationalDBDesign


Recovery with Archiving  «Prev  Next»

Recover Open Database

The steps to recover an open database are
  1. To make sure you are pointing to the correct database ORCL, you need to set ORACLE_SID. Type SET ORACLE_SID=ORCL you should you use at the prompt. After you finish, press Enter.
  2. To access the Server Manager in the NT environment, type SVRMGR30 at the prompt. After you finish, press Enter.
  3. Type CONNECT INTERNAL at the prompt to connect as sysdba. After you finish, press Enter.
  4. The password ORACLE is entered for you. Now you need to check whether the damaged datafile USR1ORCL.ORA is offline. Type SELECT A.FILE#, A.NAME, A.STATUS, B.STATUS FROM V$DATAFILE A, V$DATAFILE_HEADER B WHERE A.FILE# = B.FILE#; at the prompt. After you finish, press Enter.
  5. Since the damaged datafile USRORCL.ORA is still on line, you need to take it offline before you start recovery. Enter ALTER DATABASE DATAFILE C:\ORANT\DATABASE\USR1ORCL.ORA OFFLINE; at the prompt to to take this datafile offline. After you finish, press Enter.
  6. Now you are ready to restore the damaged datafile using the operating system command. To access the operating system, type HOST at the prompt. After you finish, press Enter.
  7. Suppose you have your backup at the path C:\ORANT\BACKUP and you original datafile path at C:\ORANT\DATABASE. Type
    host copy C:\ORANT\BACKUP\USR1ORCL.ORA C:\ORANT\DATABASE\USR1ORCL.ORA
    
    to restore the damaged datafile. After you finish, press Enter.
  8. Type EXIT to go back to the Server Manager. After you finish, press Enter.
  9. Type RECOVER DATAFILE C:\ORANT\DATABASE\USR1ORCL.ORA; to start to recover the datafile. After you finish, press Enter.
  10. Type auto to continue the recovery automatically. After you finish, press Enter.
  11. You finished the recovery successfully. Now you need to put the datafile online. Type ALTER DATABASE DATAFILE 'C:\ORANT\DATABASE\USR1ORCL.ORA' ONLINE; at the prompt. After you finish, press Enter.
  12. You have completed the whole process of recovery. This is the end of the Simulation.