dbaXchange.com


Database Resources
- RDBMS Server
-
Database Administration
-
Performance Tuning
- Backup and Recovery
-
Oracle Utilities

-
SQL and PLSQL
-
Network Administration
-
Client Applications
-
Miscellaneous Stuff

Oracle's technology Sites

http://technet.oracle.com

http://metalink.oracle.com

http://asktom.oracle.com/

http://www.oramag.com


Search this site or the web


Site search Web search powered by FreeFind



 

Category     : Database Resources -> Backup and Recovery

DB Version  : Oracle 8 / 8i / 9i

OS Details    : Sun Solaris9

 

Here's the scenario : You want to recover a database that has a datafile added to it since the last database backup which means that the backup does not have the datafile in it. Here's how you recover the database:

These is the scenario:

(1) A valid hot or cold backup of the database exists, except for the datafile that was created since the backup was taken.

(2) The controlfile is a backup from before the creation of the new datafile.

(3) The database is in archivelog mode.

Step 1. Restore the datafiles and the controlfiles from the last hot or cold backup. The current online redo logs must be intact.

Step 2. Mount the database

Step 3. Start media recovery, specifying backup controlfile

    SQL> recover database using backup controlfile;
    ORA-00279: Change 1234 generated at 10/10/05 10:10:10 needed for thread 1
    ORA-00289: Suggestion : /archive/devdb/arch0000124.arc
    ORA-00280: Change 1234 for thread 1 is in sequence #124
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

At this point, apply the archived logs as requested. Eventually Oracle will encounter redo to be applied to the non-existent datafile. The recovery session will exit with the following message, and will return the user to the SQL prompt:

    ORA-00283: Recovery session canceled due to errors
    ORA-01244: unnamed datafile(s) added to controlfile by media recovery
    ORA-01110: data file 8: '/oradata/oracle9i/tables/users01.dbf'
 
Step 4. Recreate the missing datafile. To do this, select the relevant filename from v$datafile:

    SQL> select name from v$datafile where file#=8;
    NAME
    -------------------------------------------------------
    UNNAMED0008

    Now recreate the file:

    SQL> alter database create datafile 'UNNAMED0008' as  '/oradata/oracle9i/tables/users01.dbf';

Step 5. Restart the recovery process

    SQL> recover database using backup controlfile

    ORA-00279: Change 2234 generated at 10/10/05 12:10:10 needed for thread 1
    ORA-00289: Suggestion : /archive/devdb/arch0000224.arc
    ORA-00280: Change 2234 for thread 1 is in sequence #224
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

Apply archived logs as requested. Continue the recovery process to either do a complete database recovery or an incomplete point in time recovery.