How to Restore From a Hot Backup on Another Server

PURPOSE
-------

How to restore from a hot backup on another server 
or the same server but without having the online redologs on Windows NT.


REQUIRED SOFTWARE/FILES
-----------------------

You need the following files included in the backup: 

  -initSID.ora 

  -Your sqlnet.ora,tnsnames.ora and listner.ora files (optional)
   database data files 

  -1 binary backup of the control file ( alter database backup controlfile to 
   target directory\filename' REUSE; ) all needed archived redolog files. 

Prepare the new server by installing exactly the same version of Oracle, patch 
set release included !!! 


STEP BY STEP EXPLANATION
------------------------

1. Prepare the configuration files from the backup. 
----------------------------------------------------

1.1. Copy the sqlnet.ora,tnsnames.ora and listner.ora file to 
     Oracle_Home\network\admin (or \net80, 8.0.x database or \net73, 7.3.x 
     database ) directory ( optional ) 

1.2. Make an initSID.ora file with ifile='new location of init.ora' in the 
     "oracle_home\database" directory or place the initSID.ora file here. 

1.3. Adjust the locations in the "initSID.ora" file to reflect any new location 
     of files: 

Adjust the "control_files =( ... )" entry.

Use the one binary backup controlfile from your backup and
duplicate (copy) and rename it if you want to use two or more control files.
Be sure to reflect your choice in the control_files parameter.

Adjust the "log_archive_dest" to the directory where you have put the archived 
redologs.

Adjust the "background_dump_dest" and the "user_dump_dest" to an existing 
directory.

1.4. Save the file. 

2. Create a new instance with Oradim. 
-------------------------------------

 c:\>oradim -NEW -SID your_sid -INTPWD internal_password -STARTMODE AUTO -PFILE=path_to_init.ORA 

Now start only the OracleServiceSID service:

  ( control panel, services ) 


3. Connect with svrmgrl to the new instance.
---------------------------------------------

  c:\>set ORACLE_SID=your_sid 
  c:\>svrmgrl internal/internal_password 
  svrmgr>startup mount; 


4. Check the locations of the datafiles.
----------------------------------------

4.1. Check the locations of the datafiles, if you restored them to an alternate 
     location use "alter database rename file 'Old Location' to 
     'New location';" for each datafile. 

     svrmgr>select * from v$datafile;

     svrmgr>alter database rename file 'Old Location' to 'New location';

4.2. You don't have any online redolog files yet but verify that the 
     directory exists. You can change the location later.

  svrmgr>select * from v$logfile;


5. Start recovery.
------------------

5.1. Recover up until the last archived redolog file included in your backup

   After applying the last existing one, cancel the recovery by using "Cancel".

     svrmgr>recover database using backup controlfile until cancel; 

5.2. Then open the database.

     svrmgr>alter database open resetlogs; 

Now the database is open....and the incomplete recovery succeeded. 


6. Start and/or Create Listener (optional).
--------------------------------------------

6.1. Check the tnsnames.ora and listner.ora and adapt any hostname/ip adress to
     reflect the new configuration.

6.2. To create the listener service just connect to LSNRCTL and start the 
     listener. If the service isn't created this will create the Listener and 
     start it.

     The name of the Listener is default "listner", you can check it in the 
     listner.ora.

The name of the listener is the first entry in this file.

  c:\>LSNRCTL

  lsnrctl>start name_of_listener

You will get some errors if the listener service is not yet created,
but after this use the "status" command to check.

  lsnrctl>status

In the Services summary you will see the SID of your database.

6.3. Now try to connect with sql/plus using the alias in the tnsnames.ora.


7. Take a backup!
-----------------

Shut down, take a cold backup and remove all old archived redolog files from 
the log_archive_dest. Don't forget this. After the resetlogs the database will 
generate archives starting again with number 1, so you can have a mix of older 
(not usable) archives!

Check the creation date to distinct new from old archived redologfiles.

After this you can change the location of the online redolog files if you want.
 
See note <1035935.6> for this.


8. Problems?
------------

If you run into problems verify: 

  -locations (did you made a typo?)

  -hostname and / or ip adreresses in tnsnames.ora and listner.ora

  -for ORA-12705 check the ORA-NLS3x in HKLM\SOFTWARE\ORACLE(\HOMEx) parameter 
   in the registry. 

  -that the SYSTEM account of Windows NT has FULL rights to the used 
   directories. 

  -delete the pwdSID.ora file (!hidden and system attributes) and recreate it 
   using orapwd.exe

  -is your backup valid?

Hosted by www.Geocities.ws

1