Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2) Part Number B14191-01 |
|
|
View PDF |
The focus in this discussion is on presenting the basics of planning for and performing TRANSPORT
TABLESPACE
operations with RMAN in the most automated case, where RMAN manages the auxiliary instance for you, and then how to customize various aspects of the process. This discussion contains the following sections:
RMAN TRANSPORT TABLESPACE: Specifying Locations for Data Pump Files
RMAN TRANSPORT TABLESPACE with Customized Initialization Parameters
Customize Auxiliary Control File Location in TRANSPORT TABLESPACE
Customize Other Auxiliary File Locations in TRANSPORT TABLESPACE
This section describes the use of TRANSPORT
TABLESPACE
in the most automated case.
Note: The process described here is only one part of the process of transporting tablespaces. Before you useTRANSPORT TABLESPACE , you must meet the requirements described in Oracle Database Administrator's Guide:
|
In this scenario, the AUXILIARY
DESTINATION
clause is specified, which causes RMAN to use default values that work for most cases in managing the auxiliary instance. Only required options are specified. Oracle recommends that you use an auxiliary destination with TRANSPORT
TABLESPACE
to simplify management of auxiliary instance files.
To use RMAN TRANSPORT TABLESPACE:
Start the RMAN client, connecting to the source database and, if used, the recovery catalog. Then enter the TRANSPORT
TABLESPACE
command, specifying the required arguments. For example, to transport the tablespaces tbs_2
and tbs_3
, use the TRANSPORT
TABLESPACE
command as follows:
transport tablespace tbs_2, tbs_3 tablespace destination '/disk1/transportdest' auxiliary destination '/disk1/auxdest' ;
When the TRANSPORT
TABLESPACE
command completes, the following outputs result:
The transportable set datafiles are left in the location /disk1/transportdest
with their original names.
The Data Pump Export dump file for the transportable set is named dmpfile.dmp
, the export log is named explog.log
and the sample import script is named impscrpt.sql
. All are created in the tablespace destination /disk1/transportdest
.
Note: If there is already a file under the name of the export dump file in the tablespace destination, thenTRANSPORT TABLESPACE fails when it calls Data Pump Export. If repeating a previous TRANSPORT TABLESPACE operation, make sure you delete the previous output files, including the export dump file. |
The auxiliary set files are removed from /disk1/auxdest
.
You can now return to the process for transporting tablespaces described in Oracle Database Administrator's Guide.
If you specify a target time with the TRANSPORT
TABLESPACE
command, then during the tablespace transport operation, RMAN will restore the tablespace at the auxiliary instance using backups from prior to the target time and perform point-in-time recovery on the auxiliary database to the specified target time. (Backups and redo logs needed for this point-in-time recovery must be available.)
The target time can be specified using an SCN (in the current incarnation or its ancestors), log sequence number, restore point or time expression. For example:
TRANSPORT TABLESPACE tbs_2 TABLESPACE DESTINATION '/disk1/transportdest' AUXILIARY DESTINATION '/disk1/auxdest' UNTIL SCN 11379;
TRANSPORT TABLESPACE tbs_2 TABLESPACE DESTINATION '/disk1/transportdest' AUXILIARY DESTINATION '/disk1/auxdest' UNTIL RESTORE POINT 'before_upgrade';
TRANSPORT TABLESPACE tbs_2 TABLESPACE DESTINATION '/disk1/transportdest' AUXILIARY DESTINATION '/disk1/auxdest' UNTIL TIME 'SYSDATE-1';
You can change the names of the Data Pump Export dump file for the transportable set, the sample import script for use at the target database, and the log file generated by Data Pump Export, and the directory to which they are written.
By default, these files are stored in the tablespace destination and named as follows:
The Data Pump Export dump file is named dmpfile.dmp
The export log file is named explog.log
The sample import script is called impscrpt.sql
You can place the dump file and the export log in a different directory by using the DATAPUMP
DIRECTORY
clause, passing in the name of a database directory object.
Note: The database directory object used byDATAPUMP DIRECTORY is not the directory path of an actual filesystem directory. The value passed corresponds to the DIRECTORY command line argument of Data Pump Export. See Oracle Database Utilities for more details on the use of directory objects with Data Pump Export. |
These files can be renamed using the DUMP
FILE
, EXPORT
LOG
and IMPORT
SCRIPT
clauses of TRANSPORT
TABLESPACE
.
Note:
|
The following example illustrates the use of TRANSPORT
TABLESPACE
with the DATAPUMP
DIRECTORY
, DUMP
FILE
, EXPORT
LOG
and IMPORT
SCRIPT
filenames specified.
Assume that a database directory object has been created as follows, for use with Data Pump Export:
SQL> CREATE OR REPLACE DIRECTORY mypumpdir as '/datapumpdest';
The following TRANSPORT
TABLESPACE
command illustrates the use of the optional arguments that control file output locations:
TRANSPORT TABLESPACE tbs_2 TABLESPACE DESTINATION '/transportdest' AUXILIARY DESTINATION '/auxdest' DATAPUMP DIRECTORY mypumpdir DUMP FILE 'mydumpfile.dmp' IMPORT SCRIPT 'myimportscript.sql' EXPORT LOG 'myexportlog.log';
After a successful run, the auxiliary destination is cleaned up, the Data Pump Export Dump file and the export log are located in the directory referenced by DATAPUMP
DIRECTORY
(/datapumpdest/mydumpfile.dmp
and /datapumpdest/myexportlog.log
) and the transportable set datafiles are stored in /transportdest
.
When RMAN creates the auxiliary instance, it creates an initialization parameter file with default parameters that should work for nearly all TRANSPORT TABLESPACE
cases, especially if you provide an AUXILIARY DESTINATION
argument to TRANSPORT TABLESPACE
.
RMAN TRANSPORT
TABLESPACE
can also use an auxiliary instance parameter file, which can contain values for additional initialization parameters, and values that override the values of those parameters defined in the default initialization parameter file.
Note: The auxiliary instance parameter file is not expected to be a complete initialization parameter file for the auxiliary instance. Any parameters specified are added to or override the default parameters for the auxiliary instance. It is not necessary to specify parameters in the initialization file that you do not intend to override. |
Reasons for using an auxiliary instance parameter file include:
To manage locations for auxiliary instance datafiles (if, for instance, you do not want all auxiliary instance datafiles stored in the same location on disk, but you do not want to specify the location of every file individually).
To specify control naming for online redo logs using LOG_FILE_NAME_CONVERT
To increase SHARED_POOL_SIZE
if needed for Data Pump Export.
RMAN defines the following basic initialization parameters for the automatic auxiliary instance:
DB_NAME
- Same as DB_NAME
of the source database
COMPATIBLE
- Same as the compatible setting of the source database
DB_UNIQUE_NAME
- Generated, based on the DB_NAME
, to be unique
DB_BLOCK_SIZE
- Same as the DB_BLOCK_SIZE
of the source database
DB_FILES
- Set to same value as DB_FILES
for the source database
SHARED_POOL_SIZE
- Set to 110MB, because Data Pump Export can require this much space or more.
LARGE_POOL_SIZE
- Set to 1MB
If the AUXILIARY
DESTINATION
argument to TRANSPORT
TABLESPACE
is used, RMAN also defines:
DB_CREATE_FILE_DEST
- Set to the auxiliary destination
CONTROL_FILES
- A generated filename in the auxiliary destination
When an auxiliary destination is specified, RMAN uses these two parameters in creating the auxiliary instance online logs and control files in the auxiliary destination.
Note: Overriding one of these basic initialization parameters with an inappropriate value in the auxiliary instance parameter file can causeTRANSPORT TABLESPACE to fail. If you encounter a problem, try returning to the default value. |
By default, RMAN looks for the auxiliary instance parameter file at an operating system-dependent location on the host running the RMAN client (which may not be the host running the auxiliary instance). For Unix, this location is ?/rdbms/admin/params_auxint.ora
, where '?
' stands for ORACLE_HOME
on the host running RMAN. (If no file is found in the default location, RMAN does not generate an error.)
Note: If you want to use the default initialization parameters for the auxiliary instance, check whether an auxiliary instance parameter file exists before runningTRANSPORT TABLESPACE . The same location is used for an auxiliary instance parameter file in TSPITR, so it is possible that a file remains from a previous TSPITR or TRANSPORT TABLESPACE operation. In such a case, you may see unexpected behavior, depending upon the parameters specified. |
You can use the RMAN SET
AUXILIARY
INSTANCE
PARAMETER
FILE
command in a RUN block before TRANSPORT
TABLESPACE
to specify a different location for the auxiliary instance parameter file. (Note that, as with the default location of the auxiliary instance parameter file, the path specified when using SET AUXILIARY INSTANCE PARAMETER FILE
is a client-side path.)
For example, you can create a file /tmp/auxinstparams.ora
on the host running the RMAN client, containing the following initialization parameters:
SHARED_POOL_SIZE=150M;
You can then use the parameter file with TRANSPORT
TABLESPACE
as in this example:
RUN { SET AUXILIARY INSTANCE PARAMETER FILE TO '/tmp/auxinstparams.ora'; TRANSPORT TABLESPACE tbs_2 TABLESPACE DESTINATION '/disk1/transportdest' AUXILIARY DESTINATION '/disk1/auxdest'; }
The SHARED_POOL_SIZE
parameter specified in /tmp/auxinstparams.ora
overrides the default value used for SHARED_POOL_SIZE
in TRANSPORT
TABLESPACE
when RMAN sets up the auxiliary instance.
If the default shared pool size of 100MB is not sufficient for Data Pump Export to run successfully, then specify a larger value. Use an auxiliary instance parameter file as described in "RMAN TRANSPORT TABLESPACE with Customized Initialization Parameters". Include the SHARED_POOL_SIZE
initialization parameter in your auxiliary instance parameter file, listing the control file locations desired.
For more on the use of the SHARED_POOL_SIZE
initialization parameter, see Oracle Database Reference.
By default, one control file is created for the auxiliary instance, in an operating system dependent location. (In Unix, the default location is ?/dbs/cntrl_@.dbf
, where '?
' stands for ORACLE_HOME
and '@
' stands for ORACLE_SID
. For an automatic auxiliary instance, ORACLE_SID
is randomly generated by RMAN).
To change the location of the auxiliary instance control file, use an auxiliary instance parameter file as described in "RMAN TRANSPORT TABLESPACE with Customized Initialization Parameters". Include the CONTROL_FILES
initialization parameter in your auxiliary instance parameter file, listing the control file locations desired.
For more on the use of the CONTROL_FILES
initialization parameter, see Oracle Database Reference.
Several different rules affect the location of auxiliary instance files such as datafiles and online logs, created during TRANSPORT
TABLESPACE
. While the simplest method is to use AUXILIARY
DESTINATION
and let RMAN manage all file locations automatically, you may need to relocate some or all auxiliary instance files. The options for specifying locations for these files are described here in order of precedence, so that, if several are used, then for each file, the first rule in the list that applies determines the filename.
Transport Tablespace with SET NEWNAME for Auxiliary Datafiles
Transport Tablespace with CONFIGURE AUXNAME for Auxiliary Datafiles
Transport Tablespace Naming Auxiliary Files with Initialization Parameters
Note: If you do not useAUXILIARY DESTINATION , then you must use LOG_FILE_NAME_CONVERT to specify the location of the online redo log files for the auxiliary instance.
Neither |
You can use the SET
NEWNAME
command in a RUN block to specify filenames for use in TRANSPORT
TABLESPACE
, as in this example:
RUN { SET NEWNAME FOR DATAFILE '/oracle/dbs/tbs_12.f' TO '/bigdrive/auxdest/tbs_12.f'; SET NEWNAME FOR DATAFILE '/oracle/dbs/tbs_11.f' TO '/bigdrive/auxdest/tbs_11.f'; TRANSPORT TABLESPACE tbs_2 TABLESPACE DESTINATION '/disk1/transportdest' AUXILIARY DESTINATION '/disk1/auxdest'; }
The SET
NEWNAME
commands cause these auxiliary instance datafiles to be restored to the locations named instead of /disk1/auxdest
.
Note: SET NEWNAME is best used with one-time operations. If you expect to create transportable tablespaces from backup regularly for a particular set of tablespaces, consider using CONFIGURE AUXNAME instead of SET NEWNAME in order to make persistent settings for the location of the auxiliary instance datafiles. |
You can use the CONFIGURE
AUXNAME
command to specify persistent locations for recovery set or auxiliary set datafiles. Each datafile for which a CONFIGURE
AUXNAME
command has been used is restored from backup to the specified location prior to recovery. Recovery set datafiles are left at the specified location after TRANSPORT
TABLESPACE
is complete, instead of being stored in the tablespace destination. Auxiliary set datafiles are deleted when the operation is complete, unless the operation failed.
For example, consider a database where tablespace tbs_12
, containing datafile tbs_12.f
, is part of the auxiliary set required when creating a transportable set for a tablespace tbs_11
. This CONFIGURE
AUXNAME
statement sets a persistent non-default location for the auxiliary set datafile '/oracle/dbs/tbs_12.f'
during TRANSPORT
TABLESPACE
:
CONFIGURE AUXNAME FOR '/oracle/dbs/tbs_12.f' TO '/disk1/auxdest/tbs_12.f';
In the future, you execute the following TRANSPORT
TABLESPACE
command:
TRANSPORT TABLESPACE tbs_1 AUXILIARY DESTINATION '/myauxdest';
In such a case, the auxuiliary set copy of datafile '/oracle/dbs/tbs_12.f'
is restored at the location /disk1/auxdest/tbs_12.f
instead of being stored in the location specified by AUXILIARY
DESTINATION
.
Note: You can view any currentCONFIGURE AUXNAME settings using the SHOW AUXNAME command, described in Oracle Database Backup and Recovery Reference. |
If you use an AUXILIARY
DESTINATION
argument with TRANSPORT
TABLESPACE
, as in the example in "Using RMAN TRANSPORT TABLESPACE: Basic Scenario", then any auxiliary set file which is not moved to another location using SET NEWNAME
or CONFIGURE AUXNAME
commands is stored in the auxiliary destination during the TRANSPORT
TABLESPACE
operation.
You can use the LOG_FILE_NAME_CONVERT
and DB_FILE_NAME_CONVERT
initialization parameters in an auxiliary instance parameter file to control the naming for online logs and other database files at the auxiliary instance. To do so, use an auxiliary instance parameter file, and specify the initialization parameters LOG_FILE_NAME_CONVERT
, which controls naming for online log files, and DB_FILE_NAME_CONVERT
, which controls naming for other database files at the auxiliary instance.
If no AUXILIARY
DESTINATION
clause is provided to the TRANSPORT
TABLESPACE
command, then these parameters determine the location of any files for which no CONFIGURE AUXNAME
or SET NEWNAME
value was provided.
Note: You must either use an auxiliary instance parameter file and specifyLOG_FILE_NAME_CONVERT to convert the names of all online logs, or use an AUXILIARY DESTINATION clause. Otherwise, RMAN cannot determine a location for the online logs for the automatic auxiliary instance. |
See "RMAN TRANSPORT TABLESPACE with Customized Initialization Parameters" for details on using SET
AUXILIARY
INSTANCE
PARAMETER
FILE
with TRANSPORT
TABLESPACE
, and Oracle Database Reference for more details on the LOG_FILE_NAME_CONVERT
and DB_FILE_NAME_CONVERT
initialization parameters.