Recovering Production Database on Another NT Server Using Online Backup Files
=============================================================================

PURPOSE
-------

To aid DBAs in recovering a 7/24 production database from a failed
NT server to an identical NT server using online backup datafiles and/or
controlfiles. 

 
SCOPE & APPLICATION
-------------------

This article is intended for DBA's attempting to recover a 7/24 production
database when the Windows NT Server box fails. The procedure outlined
below has been tested on versions from 7.3.4 to 8.1.6.

PRECONDITION
------------

You have to be connected/logged on as the administrator user.


SCENARIO 1: 
-----------

1. The NT server crashes
2. Database is in archivelog mode
3. Online backup of datafiles and controlfile(s) is available

Option 1A:
Re-create the database in an identical machine, with the database files placed
in the same directory. However, the archivelog files needed for rolling
forward are located in a shared drive.

1. Create oracle service using oradim utility. Check that the services are 
created (START\CONTROL PANEL\SERVICES).

oradim80 -new -sid [INST_NAME] -intpwd [PASSWD] -startmode auto -pfile d:\ora805....

2. Copy the datafiles and controlfile(s) into proper directories. 

3. Once all database files are in place, change the log_archive_dest in the
   init.ora file to point to the shared drive (e.g. j:\archive).

4. Go to control panel\services and double click on the oracleservice[SID].

   Change info in "Log on As" from "SYSTEM ACCOUNT" to "THIS ACCOUNT" and enter
   the administrator user (e.g. "administrator"). Also enter and confirm the 
   administrator password. Click on "APPLY" and "CLOSE".

5. Do the same for the oraclestart[SID] .

6. Stop then restart the service oracleservice[SID].

7. Open a DOS window, type "set oracle_sid= [SID]"

   An alternative would be to set this environment variable permanently. 
   Click on Start/Settings/Control Panel/System. Then click on the environment 
   tab and fill in VARIABLE (oracle_sid) and VALUE (SID). Then click on APPLY 
   and OK.

8. Open server manager and connect internal/[passwd]

9. Startup in mount mode.

   (SVRMGR startup mount pfile=d:\ora805\database...)

10. Do incomplete recovery.

   (SVRMGRrecover database using backup controlfile until cancel;)

11. Apply archive logs when prompted.

12. When oracle asks for archive log that does not exist, type "CANCEL".

13. Open the database.

   (SVRMGR alter database open resetlogs).

14. Shutdown the database, and exit from Server Manager.

15. Modify the log_archive_dest parameter in the init.ora file back to local 
    drive.

16.  Go back to control panel\services\oracleservice[SID] and modify 
     "Log on As" section back to "SYSTEM" account.

17.  Do the same for oraclestart[SID].

18.  Shutdown both services. Restart just oracleservice[SID].

19.  Go back to server manager and restart the database. 

20.  Shutdown the database and perform a full backup.


Note:

1. If the service "LOG ON AS" section is not changed from "SYSTEM" account, you
   will get the errors below:

ORA-00256 error occurred in translating archive text string 'j:\archive_dest'
ORA-09291 sksachk: invalid device specified for archive destination
OSD-04018 Unable to access the specified directory or device

2. If "UNTIL CANCEL" is not specified during recovery, you will get: 

   ORA-01113 file d:\orant\database\sys.dbf needs media recovery 

Option 1B: 

If there is sufficient space to put the archivelog files in a local drive 
(same location as in production).

1. Create service using oradim utility.

2. Copy the datafiles, controlfiles, and archivelog files into proper 
   directories. (It was not necessary to backup the redo log files nor was it 
   possible to do so because the production database was open all the time.)

3. Open a DOS window, type "set oracle_sid= [SID]".

   (See Step 7, Option 1A for alternative)

4. Open server manager and connect internal/[password].

5. Startup in mount mode. 

   (SVRMGR startup mount pfile=d:\ora805\database...)

6. Do incomplete recovery.

   (SVRMGRrecover database using backup controlfile until cancel;)

7. Apply archive logs when prompted.

8. When oracle asks for archive log that does not exist, type "CANCEL".

9. Open the database.

   (SVRMGR alter database open resetlogs;) 

10. Shutdown the database and perform a full backup.



Scenario 2:
-----------

1. The NT server crashes
2. DB in archivelog mode
3. Online backup of datafiles is available
4. No backup of controlfile or a controlfile trace is available

1. Create service using oradim utility. (See Step 1, Option 1A for syntax)

2. Copy the datafiles into proper directories. 

3. Open a DOS window, type "set oracle_sid= [SID]".

4. Open Server Manager and connect internal/[password].

5. Startup in nomount mode.

  (SVRMGR startup mount pfile=d:\ora805\database...)

6. Run the create controlfile script. You need to modify a few lines in this 
   script. For example, be sure to have "RESETLOGS" and "ARCHIVELOG" in the 
   CREATE CONTROLFILE statement. If you do not have RESETLOGS option for 
   example, you will get the following errors since oracle will look for your 
   redo log files.

CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS ARCHIVELOG
*
ORA-01503: CREATE CONTROLFILE failed
ORA-01565: error in identifying file 'D:\ORA_805\DATABASE\LOG4ORCL.ORA'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.

7. Do incomplete recovery.

  (SVRMGRrecover database using backup controlfile until cancel;)

8. Apply archive logs when prompted.

9. When oracle asks for archive log that does not exist, type "CANCEL".

10. Open database 

    (SVRMGR alter database open resetlogs;) 

11. Shutdown the database and perform a full backup.
 
Hosted by www.Geocities.ws

1