Oracle Recovery

Da Emigar.
Jump to navigation Jump to search

UNTIL TIME Recovery

   SQL> shutdown immediate;
   SQL> startup mount;
   —No restore b/c OS or other means are used to restore necessary files—
   SQL> recover database UNTIL TIME '2006-08-15:14:07:00'
       The time format must be in the format YYYY-MM-DD:HH24:MM:SS irrespective of NLS_DATE_FORMAT
   SQL> alter database open resetlogs;


restore from plsql

da: http://docs.oracle.com/cd/A87860_01/doc/server.817/a76990/rmanreco.htm#441496


Restoring the Control File from a Backup Set Without Using RMAN

You must use a non-standard procedure to restore a control file from an RMAN backup set in the following situations:

You are using a pre-8.0.5 version of RMAN to restore a database when more than one database with the same name is registered in the recovery catalog (see "Restoring When Multiple Databases Share the Same Name" for a discussion of this problem).

You are not using a recovery catalog, and your only control file backup is in an RMAN backup set.

If you have no other backup of the control file except in a RMAN backup set, and you need the control file to perform a restore operation, use the following PL/SQL program to extract the control file from the backup set. Run this program from SQL*Plus while connected as SYSDBA to the target database:

DECLARE

 devtype varchar2(256);
 done    boolean;

BEGIN

 devtype := dbms_backup_restore.deviceallocate('devtype', params=>);
 # Replace 'devtype' with the device type you used when creating the backup: NULL or 
 # sbt_tape.  If you used an sbt_tape device and specified a 'parms' option on the RMAN 
 # allocate channel command, then put that parms data in the 'params' operand here.
 dbms_backup_restore.restoresetdatafile;
 dbms_backup_restore.restorecontrolfileto('/tmp/foo.cf');
 # This path specifies the location for the restored control file. If there are multiple
 # control files specified in the init.ora file, copy the control file to all specified 
 # locations before mounting the database.
 dbms_backup_restore.restorebackuppiece('handle',done=>done);
 # Replace 'handle' with the your backup piece handle. This example assumes that the 
 # backup set contains only one backup piece. If there is more than one backup piece in 
 # the backup set (which only happens if the RMAN command set limit kbytes is used), then 
 # repeat the restorebackuppiece statement for each backup piece in the backup set.

END; /