Databases Reference
In-Depth Information
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).
the scripts in this section aren't meant to be production-strength backup and recovery scripts. rather, they
illustrate the basic concepts of scripting a cold backup and subsequent restore.
Note
The first script in this section makes a cold backup of a database. Before you use the cold backup script, you need
to modify these variables in the script to match your database environment:
ORACLE_SID
ORACLE_HOME
cbdir
 
 
Search WWH ::




Custom Search