Database Reference
In-Depth Information
Here is the basic procedure for a complete recovery:
1.
Place the database in mount mode; this prevents normal user transaction processing from
reading/writing to data files being restored. (If you're not restoring the SYSTEM or UNDO
tablespace, you have the option of opening the database and manually taking the data files
offline before restoring them. If you do this, make sure you place the data files online after
the recovery is complete.)
2.
Restore the damaged data files with an OS copy utility.
3.
Issue the appropriate SQL*Plus RECOVER command to apply any information required in
the archive redo logs and online redo logs.
4.
Alter the database open.
The next several sections demonstrate some common complete restore-and-recovery scenarios. You should be
able to apply these basic scenarios to diagnose and recover from any complex situation you find yourself in.
Restoring and Recovering with the Database Offline
This section details a simple restore-and-recovery scenario. Described next are the steps to simulate a failure and then
perform a complete restore and recovery. Try this scenario in a development database. Ensure that you have a good
backup and that you aren't trying this experiment in a database that contains critical business data.
Before you start this example, create a table, and insert some data. This table and data are selected from the end
of the complete recovery process to demonstrate a successful recovery:
SQL> create table foo(foo number) tablespace users;
SQL> insert into foo values(1);
SQL> commit;
Now, switch the online logs several times. Doing so ensures that you have to apply archive redo logs as part of the
recovery:
SQL> alter system switch logfile;
The forward slash ( / ) reruns the most recently executed SQL statement:
SQL> /
SQL> /
SQL> /
Next, simulate a media failure by renaming the data file associated with the USERS tablespace. You can identify
the name of this file with this query:
SQL> select file_name from dba_data_files where tablespace_name='USERS';
FILE_NAME
----------------------------------
/u01/dbfile/O12C/users01.dbf
 
Search WWH ::




Custom Search