Databases Reference
In-Depth Information
if finished then
dbms_output.put_line('Control file restored.');
else
dbms_output.put_line('Problem');
end if;
--
dbms_backup_restore.deviceDeallocate('d1');
END;
/
If the previous code was stored in a file named rc.sql, then you would execute it as follows:
SQL> connect / as sysdba
SQL> startup nomount;
SQL> @rc.sql
How It Works
Much of RMAN is internally implemented via the DBMS_BACKUP_RESTORE package. For example, when you issue
an RMAN backup or restore command, Oracle calls the DBMS_BACKUP_RESTORE package to initiate the real work.
This package is installed when you create a database and run the catproc.sql script and is available in every Oracle
database since version 8.0.3.
In very rare situations you may be required to access DBMS_BACKUP_RESTORE package. If you ever need to
restore a control file and cannot do it with the normal procedures described throughout this chapter, then you can use
DBMS_BACKUP_RESTORE directly. While using this package isn't exactly straightforward, it's not
rocket surgery either. You should be able to modify the example in the Solution section of this recipe to meet
your requirements.
Keep in mind that if you're using Oracle Database 10 g or higher, you can directly restore from a backup piece via
the from <backup piece> clause. Also in Oracle Database 10 g or higher, you can repopulate a control file with RMAN
backup metadata via the catalog command. Additionally, if you're using a recovery catalog, then you can populate a
re-created control file with RMAN metadata via the resync catalog command. For all of these reasons, you shouldn't
normally have to use the DBMS_BACKUP_RESTORE package.
Ti One important aspect of DBMS_BACKUP_RESTORE is that this package can be accessed even if your
database is in nomount mode. This provides you some flexibility on being able to run RMAN commands even if you can't
alter your database into mount mode.
 
 
Search WWH ::




Custom Search