Database Reference
In-Depth Information
Step 2. Copy the Files Back from the Backup
Copy the control files and data files from the backup location to the live data file locations:
$ cp <backup directory>/*.* <live database file directory>
Step 3. Start Up the Database in Mount Mode
Connect to your database as SYS or a user with SYSDBA privileges, and start the database in mount mode:
$ sqlplus / as sysdba
SQL> startup mount
Step 4. Open the Database with the OPEN RESETLOGS Clause
Open your database for use with the OPEN RESETLOGS clause:
SQL> alter database open resetlogs;
If you see the Database altered message, the command was successful. However, you may see this error:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery
In this case, issue the following command:
SQL> recover database until cancel;
You should see this message:
Media recovery complete.
Now, attempt to open your database with the OPEN RESETLOGS clause:
SQL> alter database open resetlogs;
This statement instructs Oracle to recreate the online redo logs. Oracle uses information in the control file for the
placement, name, and size of the redo logs. If there are old online redo log files in those locations, they're overwritten.
If you're monitoring your alert.log throughout this process, you may see ORA-00312 and ORA-00313 . This means
that Oracle can't find the online redo log files; this is okay, because these files aren't physically available until they're
recreated by the OPEN RESETLOGS command.
Scripting a Cold Backup and Restore
It's instructional to view how to script a cold backup. The basic idea is to dynamically query the data dictionary
to determine the locations and names of the files to be backed up. This is preferable to hard-coding the directory
locations and file names in a script. The dynamic generation of a script is less prone to errors and surprises (e.g., the
addition of new data files to a database but not to an old, hard-coded backup script).
 
Search WWH ::




Custom Search