Database Reference
In-Depth Information
From the OS, rename the file:
$ mv /u01/dbfile/O12C/users01.dbf /u01/dbfile/O12C/users01.dbf.old
And, attempt to stop your database:
$ sqlplus / as sysdba
SQL> shutdown immediate;
You should see an error such as this:
ORA-01116: error in opening database file ...
If this were a real disaster, it would be prudent to navigate to the data file directory, list the files, and see if the file
in question was in its correct location. You should also inspect the alert.log file to see if any relevant information is
logged there by Oracle.
Now that you've simulated a media failure, the next several steps walk you through a restore and complete
recovery.
Step 1. Place Your Database in Mount Mode
Before you place your database in mount mode, you may need to first shut it down, using ABORT :
$ sqlplus / as sysdba
SQL> shutdown abort;
SQL> startup mount;
Step 2. Restore the Data File from the Backup
The next step is to copy from the backup the data file that corresponds to the one that has had a failure:
$ cp /u01/hbackup/O12C/users01.dbf /u01/dbfile/O12C/users01.dbf
At this point, it's instructional to ponder what Oracle would do if you attempted to start your database. When
you issue the ALTER DATABASE OPEN statement, Oracle inspects the SCN in the control file for each data file. You can
examine this SCN by querying V$DATAFILE :
SQL> select checkpoint_change# from v$datafile where file#=4;
CHECKPOINT_CHANGE#
------------------
3543963
 
Search WWH ::




Custom Search