Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2) Part Number B14191-01 |
|
|
View PDF |
This section contains the following topics:
In any situation where you need transportable tablespaces, you can use the RMAN TRANSPORT
TABLESPACE
command to create them, as long as you have RMAN backups of your database that can be recovered to the SCN at which you need the tablespaces. Scenarios for using transportable tablespaces are described in Oracle Database Administrator's Guide.
However, there are two specific scenarios in which this feature is particularly useful:
Creating transportable tablespace sets for use with a tablespace repository. For example, you have a database with some tablespaces used for quarterly reporting. You use TRANSPORT
TABLESPACE
to create transportable tablespace sets for those tablespaces quarterly for storage in a tablespace repository. Subsequently, versions of the tablespace can be requested from the repository and attached to some other database for use in the reporting process.
See also: Oracle Streams Replication Administrator's Guide for more details on RMAN and tablespace repositories |
When preparing to use Streams to keep a destination database synchronized with a source database, you must perform Streams instantiation, to bring the destination database up to a given SCN at which the two databases were known to be synchronized, before you can actually use Streams to move subsequent updates from the source to the target. Creating the transportable tablespace set from backup can be used as part of the process of Streams instantiation.
See also: Oracle Streams Replication Administrator's Guide for more details on RMAN and Streams instantiation |
The following diagram illustrates the process of creating transportable tablespace sets from backup using RMAN.
Figure 14-1 RMAN Transportable Tablespace From Backup: Architecture
The elements in the diagram and the process RMAN performs are described in the discussion which follows.
Note: The process by which transportable tablespace sets are created with RMAN is closely related to the process for performing TSPITR, as discussed in Chapter 8, "RMAN Tablespace Point-in-Time Recovery (TSPITR)". If you are familiar with that process, you will find this one similar. |
The figure contains the following entities:
The Recovery Manager client
The source database, containing the tablespaces to be transported
Archived redo logs and backups from the source database, used in restore and recovery of the tablespaces being transported
The auxiliary instance, an Oracle database instance which is created by RMAN on the same host as the source database, to perform the restore and recovery of the tablespaces, and, if the process succeeds, cleaned up afterwards.
The auxiliary set, which includes datafiles and other files required for the tablespace transport process but which are not themselves part of the recovery set. The auxiliary set typically includes:
A copy of the SYSTEM and SYSAUX tablespaces
Undo tablespaces and datafiles containing rollback or undo segments from the source database
The auxiliary instance has other files associated with it, such as its own control file, parameter file, and online logs, but they are not part of the auxiliary set.
The auxiliary destination, a location on disk where auxiliary set files, such as the parameter file, datafiles (other than those of the tablespaces being transported), control files and online logs of the auxiliary instance can be stored while the RMAN TRANSPORT
TABLESPACE
process is running. If the transport process succeeds, these files are deleted.
Note: Specifying an auxiliary destination is optional; however, if you do not use one, you must ensure that locations are specified for all auxiliary instance files, including all datafiles and online log files, using the initialization parameters of the auxiliary instance.Oracle recommends the use of an auxiliary destination to simplify the use of |
The tablespace destination, a location on disk which (by default) contains the datafile copies and other output files when the tablespace transport command completes
The transportable set, which consists of the datafiles from the tablespaces to be transported and an export dump file (generated using Data Pump Export) for use when plugging in the tablespaces at a destination database,
The sample import script (generated by RMAN) for use in plugging the tablespaces in at a target database, and an export log containing the output from Data Pump Export
All of these terms will be referenced throughout the remainder of this discussion.
RMAN creates transportable tablespaces from backup using a three-phase process:
In the startup phase, RMAN constructs an auxiliary database instance. First, an initialization parameter file is automatically created for the instance by RMAN, and used to start the auxiliary instance in NOMOUNT
mode. Then, RMAN restores a backup of the source database control file to serve as the auxiliary instance control file, and mounts that control file.
Once the auxiliary instance control file is mounted, RMAN restores auxiliary and transportable set datafiles from the backups of the source database, storing the auxiliary datafiles in the selected auxiliary destination and the transportable set files in the tablespace destination. RMAN then performs a SWITCH
operation at the auxiliary instance, so that the auxiliary instance uses the restored datafiles as the datafiles for the auxiliary instance.
RMAN then performs database point-in-time recovery at the auxiliary instance. This updates auxiliary and transportable set datafiles to their contents as of the target time specified for the TRANSPORT
DATABASE
command. (If no target time is specified, complete recovery is performed.) Archived redo logs are restored from backup as necessary at the auxiliary destination (or other location), and are deleted after they are applied.
Once the recovery is complete, RMAN performs an OPEN
RESETLOGS
operation on the auxiliary database. The datafiles now reflect the tablespace contents as of the target SCN for the tablespace transport operation.
Recovery set tablespaces of the auxiliary instance are put into read-only mode, and Data Pump Export is invoked in transportable tablespace mode to generate the export dump file for the recovery set tablespaces.
The dump file is located in the tablespace destination location by default. To specify the location of the dump files, see "RMAN TRANSPORT TABLESPACE: Specifying Locations for Data Pump Files".
At this time RMAN also generates the sample Data Pump import script for use when plugging in the transported tablespaces at a target database. The contents of this script are written to a file named impscript.sql
in the tablespace destination. The commands for the script are also included in the RMAN output for the TRANSPORT
TABLESPACE
command.
If all of these operations are completed successfully, RMAN shuts down the auxiliary instance and deletes all files created during TRANSPORT
TABLESPACE
except for the transportable set files, the Data Pump Export log, and the sample import script.
Note:
|
The limitations on creating transportable tablespace sets described in Oracle Database Administrator's Guide apply to transporting tablespaces from backup, with the exception of the requirement to make the tablespaces read-only.
There are also limitations specific to creating a transportable tablespace set using RMAN:
You must have a backup of all needed tablespaces (including those in the auxiliary set) and archived redo log files available for use by RMAN that can be recovered to the target point in time for the TRANSPORT
TABLESPACE
operation.
Note: If RMAN is not part of the backup strategy for your database, you can still use RMANTRANSPORT TABLESPACE , as long as the needed datafile copies and archived redo logs are available on disk. Use the RMAN CATALOG command to record the datafile copies and archived logs in the RMAN repository. You can then use TRANSPORT TABLESPACE . See Oracle Database Backup and Recovery Basics for details on using CATALOG .
You also have the option of using RMAN to back up your database specifically to create backups for use in creating a transportable tablespace set from backup. |
Because the RMAN process for creating transportable tablespaces from backup uses the Data Pump Export and Import utilities, you cannot use this process if the tablespaces to be transported use XMLTypes. In such a case, you must use the process documented in Oracle Database Administrator's Guide.
Because RMAN creates the automatic auxiliary instance used for restore and recovery on the same host as the source instance, there is some performance overhead during the operation of the TRANSPORT
TABLESPACE
command.
If you drop a tablespace, then you cannot later use TRANSPORT
TABLESPACE
to include that tablespace in a transportable tablespace set, even if the SCN for TRANSPORT
TABLESPACE
is earlier than the SCN at which the table was dropped.
If you rename a tablespace, you cannot use TRANSPORT
TABLESPACE
to create a transportable tablespace set as of a point in time before the tablespace was renamed. (RMAN has no information about the previous name of the tablespace.)
You cannot TRANSPORT
tables without their associated constraints, or constraints without their associated tables.
Neither the transportable set nor the auxiliary set datafiles can contain any of the following:
Replicated master tables
Partial tables
Tables with VARRAY columns, nested tables, or external files
Snapshot logs and snapshot tables
Tablespaces containing undo or rollback segments
Tablespaces that contain objects owned by SYS, including rollback segments
If you are performing TRANSPORT
TABLESPACE
without a recovery catalog, the following additional restrictions apply:
If creating a transportable set with tablespace contents as of a point in time in the past, then the set of tablespaces with undo segments at the time TRANSPORT
TABLESPACE
is executed must be the same as the set of tablespaces with undo segments at the time selected for transport.
Tablespaces including undo segments as of the target SCN for TRASNPORT
TABLESPACE
must be part of the auxiliary set. Unlike the recovery catalog, the RMAN repository in the control file only contains a record of tablespaces that include undo segments at the current time. If the set of tablespaces with undo segments was different at the target time, then TRANSPORT
TABLESPACE
fails.
If the database has re-used the control file records for the RMAN repository that contained information about backups required for the TRANSPORT
TABLESPACE
process, then the process fails because RMAN cannot locate the required backups. You may be able to use CATALOG
to add the needed backups to the RMAN repository if they are still available, but if the database is already overwriting control file records you may lose records of other needed backups.