Database Reference
In-Depth Information
As mentioned earlier, starting with Oracle 12c, you can run SQL commands directly, without the RMAN sql
command and associated quotation marks; for example,
RMAN> alter database datafile 4 offline;
RMAN> restore datafile 4;
RMAN> recover datafile 4;
RMAN> alter database datafile 4 online;
Here are the corresponding 12c examples, with the data file names:
RMAN> alter database datafile '/u01/dbfile/O12C/users01.dbf' offline;
RMAN> restore datafile '/u01/dbfile/O12C/users01.dbf';
RMAN> recover datafile '/u01/dbfile/O12C/users01.dbf';
RMAN> alter database datafile '/u01/dbfile/O12C/users01.dbf' online;
Restoring and Recovering Data Files While the Database Is Not Open
In this scenario the database is first shut down and then started in mount mode. You can restore and recover any
data file in your database while the database is not open. This example shows the restoring of data file 1, which is
associated with the SYSTEM tablespace:
$ rman target /
RMAN> shutdown abort;
RMAN> startup mount;
RMAN> restore datafile 1;
RMAN> recover datafile 1;
RMAN> alter database open;
You can also specify the file name when performing a data file recovery:
$ rman target /
RMAN> shutdown abort;
RMAN> startup mount;
RMAN> restore datafile '/u01/dbfile/O12C/system01.dbf';
RMAN> recover datafile '/u01/dbfile/O12C/system01.dbf';
RMAN> alter database open;
Restoring Data Files to Nondefault Locations
Sometimes a failure will occur that renders the disks associated with a mount point inoperable. In these situations,
you will need to restore and recover the data files to a location different from the one where they originally resided.
Another typical need for restoring data files to nondefault locations is that you're restoring to a different database
server, on which the mount points are completely different from those of the server on which the backup originated.
Use the SET NEWNAME and SWITCH commands to restore data files to nondefault locations. Both of these
commands must be run from within an RMAN run{} block. You can think of using SET NEWNAME and SWITCH as a way
to rename data files (similar to the SQL*Plus ALTER DATABASE RENAME FILE statement).
 
Search WWH ::




Custom Search