Database Reference
In-Depth Information
If, for any reason, your temporary tablespace becomes unavailable, you can also re-create it yourself. Because
there are never any permanent objects in temporary tablespaces, you can simply re-create them as needed. Here is an
example of how to create a locally managed temporary tablespace:
CREATE TEMPORARY TABLESPACE temp TEMPFILE
'/u01/dbfile/O12C/temp01.dbf' SIZE 1000M
EXTENT MANAGEMENT
LOCAL UNIFORM SIZE 512K;
If your temporary tablespace exists, but the temporary data files are missing, you can just add them, as shown:
alter tablespace temp
add tempfile '/u01/dbfile/O12C/temp02.dbf' SIZE 5000M REUSE;
Restoring and Recovering Data Files
A data file-level restore and recovery works well when a media failure is confined to a small set of data files. With data
file-level recoveries, you can instruct RMAN to restore and recover either with data file name or data file number.
For data files not associated with the
SYSTEM
or
UNDO
tablespaces, you have the option of restoring and recovering
while the database remains open. While the database is open, however, you must first take offline any data files being
restored and recovered.
Restoring and Recovering Data Files While the Database Is Open
Use the
RESTORE DATAFILE
and
RECOVER DATAFILE
commands to restore and recover at the data file level. When
your database is open, you're required to take offline any data files that you're attempting to restore and recover. This
example restores and recovers data files while the database is open:
RMAN> sql 'alter database datafile 4, 5 offline';
RMAN> restore datafile 4, 5;
RMAN> recover datafile 4, 5;
RMAN> sql 'alter database datafile 4, 5 online';
■
Use the rMaN
REPORT SCHEMA
command to list data file names and file numbers. you can also query the
NAME
and
FILE#
columns of
V$DATAFILE
to take names and numbers.
Tip
You can also specify the name of the data file that you want to restore and recover; for example,
RMAN> sql "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> sql "alter database datafile ''/u01/dbfile/O12C/users01.dbf'' online";
■
When using the rMaN
sql
command, if there are single quotation marks within the sQL statement, then you
are required to use double quotation marks to enclose the entire sQL statement and two single quotation marks where
you would ordinarily use just one quotation double mark.
Note