Previous Topic: Recover Complete DatabasesNext Topic: Recover Tablespaces or Data Files


Recover Complete Databases and Control Files

If a control file has been lost or corrupted, you must first shut down the database and recover the control files before recovering the database.

To shut down the database and recover the control files

  1. Shut down the database by entering the following command at the SQL*Plus prompt:
    SHUTDOWN;
    
  2. Go to the Oracle home directory. Copy the control file from the agent home directory to its original location.
  3. Rename the restored control files to their original control file names.

    Note: The restore process restores the original control file. You must rename the restored version of the control file to its original file name.

  4. Start and mount the database and begin the recovery process:

    At the SQL*Plus prompt enter:

    CONNECT SYS/SYS_PASSWORD AS SYSDBA;
    STARTUP MOUNT;
    RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
    
  5. Oracle prompts you to enter the log file names. Oracle first looks for the archive log files and automatically supplies the correct names for those that exist. If Oracle cannot find the necessary archive log files, you must manually apply the online redo logs it needs.

    When you apply the online redo logs manually, you must supply the full path and file name. If you enter an incorrect log, reenter the command:

    RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
    

    Supply the correct online redo log file name at the prompt. Continue this procedure until Oracle has applied all logs successfully.

  6. Enter the following command at the SQL*Plus prompt to bring the database back online and reset the logs:
    ALTER DATABASE OPEN RESETLOGS; 
    
  7. In the directories where the archived redo logs are stored, delete all of the log files.
  8. If any tablespaces are still offline, enter the following command at the SQL*Plus prompt to bring them back online:
    ALTER TABLESPACE TABLESPACE_NAME ONLINE;