4.3. User-Managed Recovery

User-managed recovery is the traditional recovery method where you directly manage the database files required to recover the database. You can use various operating system commands to restore the required files from tape or disk to perform the recovery process. In some cases, operating scripts are created to perform some of this functionality.

The basic procedure to perform user-managed recovery consists of first identifying the database files that need to be restored. Next, the database must be placed in the appropriate mode, either mounted or opened. Then the database files are restored from tape or disk to the appropriate location. Finally, the database can be recovered using the RECOVER command to apply archived redo logs to the database files if necessary.

Let's walk through an example of a user-managed recovery:

  1. The first step is to identify the file that needs recovery. In this case, you will attempt to start the database with a missing datafile. The database cannot be started because of the missing datafile, so it should be shut down:

    C:Documents and Settingsdstuns> sqlplus /nolog
    
    SQL*Plus: Release 10.1.0.2.0 - Production on Sat Sep 4 11:06:26 2004
    
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    
    SQL> connect / as sysdba
    Connected to an idle instance.
    SQL> startup
    ORACLE instance started.
    
    Total System Global Area    88080384 bytes
    Fixed Size                    787588 bytes
    Variable Size               78642044 bytes
    Database Buffers             8388608 bytes
    Redo Buffers                  262144 bytes
    Database mounted.
    ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
    ORA-01110: data file 4: 'C:ORACLEORADATAORA101TUSERS01.DBF'

  2. Restore the USERS01.DBF file, which needs to be recovered. When the database is shut down, copy the datafile from the backup directory on the disk where the last database backup is stored:

    C:oracleoradataora101t> copy ..ackupora101tUSERS01.DBF.
     1 file(s) copied.
    C:oracleoradataora101t>

  3. Then you can recover the database. The database must be mounted to perform a RECOVER DATABASE command. You are prompted to apply an archived redo log:

    SQL> startup mount
    ORACLE instance started.
    
    
    Total System Global Area    88080384 bytes
    Fixed Size           787588 bytes
    Variable Size      78642044 bytes
    Database Buffers    8388608 bytes
    Redo Buffers         262144 bytes

    Database mounted.
    SQL>
    SQL> recover database;
    ORA-00279: change 489556 generated at 09/04/2004 10:39:15 needed for thread 1
    ORA-00289: suggestion: C:ORACLEORAARCHORA101TARC00050_0527361115.001
    ORA-00280: change 489556 for thread 1 is in sequence #50
    
    
    
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    AUTO
    ORA-00279: change 489835 generated at 09/04/2004 11:12:03 needed for thread 1
    ORA-00289: suggestion :
      C:ORACLEORAARCHORA101TARC00051_0527361115.001
    ORA-00280: change 489835 for thread 1 is in sequence #51
    ORA-00278: log file
      'C:ORACLEORAARCHORA101TARC00050_0527361115.001' no
    longer needed for this recovery
    
    
    
    Log applied.
    SQL>

  4. Once the database has been recovered, it may be opened for normal use:

    SQL> alter database open;
    
    Database altered.
    
    SQL>

As you can see, the restore process for user-managed recovery requires some user interaction. You must identify the missing file and determine the backup location. The file must be manually copied to the appropriate location. Then the RECOVER command can be executed. This method requires you to be directly involved with the activities in the recovery process. In contrast, RMAN does this work for you, which can simplify the effort.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset