27 Transporting Data Across Platforms
Data can be transported across platforms by using image copies or backup sets.
You can use RMAN to transport tablespaces across platforms with different endian formats. You can also use RMAN to transport an entire database to a different platform so long as the two platforms have the same endian format.
27.1 About Cross-Platform Data Transport
Cross-platform transportable tablespace is a variation of ordinary transportable tablespace. All of the restrictions that apply to transportable tablespaces apply here also, such as the need to ensure that all of the objects being transported are completely contained within the set of tablespaces being transported. Cross-platform transportable tablespace can be performed between platforms that have the same, or different, endian format.
Cross-platform transportable database is not the same thing as transportable tablespace. In this case you are copying an entire database, including the SYSTEM
tablespace from one platform to another. Containment checks are irrelevant, and because the SYSTEM
tablespace is being copied, no export/import step is required. Cross-platform transportable database can only be performed between platforms that have the same endian format.
27.1.1 Purpose of Cross-Platform Data Transport
You can transport tablespaces in a database that runs on one platform into a database that runs on a different platform. Typical uses of cross-platform transportable tablespaces include the following:
-
Publishing structured data as transportable tablespaces for distribution to customers, who can convert the tablespaces for integration into their existing databases regardless of platform
-
Moving data from a large data warehouse server to data marts on smaller computers such as Linux-based workstations or servers
-
Sharing read-only tablespaces across a heterogeneous cluster in which all hosts share the same endian format
-
Migrating tablespaces across platforms with minimal application downtime
A full discussion of transportable tablespaces, their uses, and the different techniques for creating and using them is found in Oracle Database Administrator's Guide.
You can also use RMAN to transport an entire database from one platform to another. For example, business requirements demand that you run your databases on less expensive servers that use a different platform. In this case, you can use RMAN to transport the entire database rather than re-create it and use import utilities or transportable tablespaces to repopulate the data.
You can convert a database on the destination host or source host. Reasons for converting on the destination host include:
-
Avoiding performance overhead on the source host due to the conversion process
-
Distributing a database from one source system to multiple recipients on several different platforms
-
Evaluating a migration path for a new platform
27.1.2 Methods of Transporting Data Across Platforms
RMAN enables you to transport data files, tablespaces, or an entire database from one platform to another. When you transport an entire database to a different platform, the destination platform must have the same endian format as the source platform.
Use one of the following methods to transport data across platforms:
-
Transport data using image copies
-
Transport data using backup sets
27.1.3 Platforms that Support Cross-Platform Data Transport
The Oracle Database maintains a list of internal names for each platform that supports cross-platform data transport. These names are stored in the V$TRANSPORTABLE_PLATFORM
view. Use this view to determine the internal name of the source platform or destination platform. While transporting data across platforms, you may need to specify the exact name of the source or destination platform. Any platform names specified as a parameter of the CONVERT
or BACKUP
command must be entered exactly as shown in the V$TRANSPORTABLE_PLATFORM
view.
Use the following query to obtain the platform name of the connected database:
SELECT PLATFORM_NAME FROM V$TRANSPORTABLE_PLATFORM WHERE PLATFORM_ID = ( SELECT PLATFORM_ID FROM V$DATABASE );
Use the following query to obtain the name of the Linux platform:
SELECT PLATFORM_ID, PLATFORM_NAME, ENDIAN_FORMAT FROM V$TRANSPORTABLE_PLATFORM WHERE UPPER(PLATFORM_NAME) LIKE '%LINUX%';
27.2 Overview of Cross-Platform Data Transport Using Image Copies
RMAN enables you to use image copies to transport tablespaces, data files, or an entire database. You use the RMAN CONVERT
command to perform cross-platform transport with image copies. Tablespace transport is sometimes performed by individually transporting the data files that store the tablespace data. However, it is not possible to transport a single data file that is part of a tablespace that consists of multiple data files.
You must use the RMAN CONVERT
command in a transportable tablespace operation when the source platform is different from the destination platform and the endian formats are different. If you are converting part of the database between platforms that have the same endian format, you can use operating system methods to copy the files from the source to the destination. If you are converting an entire, same endian database, any data files with undo information must be converted. You cannot copy these files directly from the source to the destination platform.
27.2.1 Overview of Tablespace and Data File Conversion Using Image Copies
You can perform tablespace conversion with the RMAN CONVERT
TABLESPACE
command on the source host, but not on the destination host. The CONVERT TABLESPACE
command does not perform in-place conversion of data files. Rather, the command produces output files in the correct format for use on the destination platform. The command does not alter the contents of data files in the source database.
You can use the CONVERT
DATAFILE
command to convert files. Typically, the CONVERT DATAFILE
command is used on the destination host and the CONVERT TABLESPACE
command is used on the source host. When you use the CONVERT DATAFILE
command on the source host, ensure that data files are cleanly offline or the tablespaces containing those data files are read-only. The Data Pump Export utility generates an export dump file that, with data files manually copied to the destination host, can be imported into the destination database. Until the Data Pump export dump file is imported into the destination database, the data files are not associated with a tablespace name in the database. In this case, RMAN cannot translate the tablespace name into a list of data files. Therefore, you must use CONVERT
DATAFILE
and identify the data files by file name.
Note:
Using CONVERT TABLESPACE
or CONVERT DATAFILE
is only one step in using cross-platform transportable tablespaces. Read the discussion of transportable tablespaces in Oracle Database Administrator's Guide in its entirety before attempting to follow the procedures in this chapter.
See Also:
The following sections describe how to perform cross-platform transport of tablespaces and data files using image copies:
27.2.2 Overview of Database Conversion Using Image Copies
To convert a whole database to a different platform, both platforms must use the same endian format. The RMAN CONVERT
DATABASE
command automates the movement of an entire database from a source platform to a destination platform. The transported database contains the same data as the source database and also has, with a few exceptions, the same settings as the source database.
Files automatically transported to the destination platform include:
-
Data files that belong to permanent tablespaces
Unlike transporting tablespaces across platforms, transporting entire databases requires that certain types of blocks, such as blocks in undo segments, be reformatted to ensure compatibility with the destination platform. Even though the endian formats for the source and destination platforms are the same, certain types of files must undergo a conversion process. See "Checking the Database Before Cross-Platform Database Conversion" for details about the types of files that need conversion.
-
Initialization parameter file or server parameter file
If the database uses a text-based initialization parameter file, then RMAN transports it. If the database uses a server parameter file, then RMAN generates an initialization parameter file based on the server parameter file, transports it and creates a new server parameter file at the destination based on the settings in the initialization parameter file.
Usually, some parameters in the initialization parameter file require manual updating for the new database. For example, you may change the
DB_NAME
and parameters such asCONTROL_FILES
that indicate the locations of files on the destination host.
You can convert the format of the data files either on the source platform or on the destination platform. The CONVERT DATABASE ON DESTINATION PLATFORM
command does not convert the format of data files. Rather, it generates scripts that you can run manually to perform the conversion. The CONVERT SCRIPT
parameter creates a convert script that you can manually execute at the destination host to convert data file copies in batch mode. The TRANSPORT SCRIPT
parameter generates a transport script that contains SQL statements to create the new database on the destination platform.
See Also:
My Oracle Support Note 1079563.1, "RMAN DUPLICATE/RESTORE/RECOVER Mixed Platform Support" for the following information:
-
List of platform combinations that do not require the
CONVERT DATABASE
command -
Prerequisites for the source database and destination databases
See Also:
http://www.oracle.com/goto/maa
for best practices on using cross-platform transportable tablespace and database procedures as part of data migration tasks
See Also:
The following sections describe how to perform cross-platform transport of a database using image copies:
27.3 Performing Cross-Platform Tablespace Conversion with Image Copies
You can transport tablespaces across platforms by performing the required conversion on the source database.
CONVERT
command prerequisites described in Oracle Database
Backup and Recovery Reference. Meet all these prerequisites before
doing the steps in this section.
For purposes of illustration, assume that you must transport tablespaces from the
source database prod_source
, which runs on a Sun Solaris host. You
plan to transport them to the destination database prod_dest
running on a Linux PC. You plan to store the converted data files in the temporary
directory /tmp/transport_linux/
on the source host.
To perform cross-platform tablespace conversion with image copies:
-
Start SQL*Plus and connect to the source database
prod_source
with administrator privileges. -
Query the name for the destination platform in the
V$TRANSPORTABLE_PLATFORM
view.The
PLATFORM_NAME
for Linux on a PC isLinux IA (64-bit)
.See Also:
"Platforms that Support Cross-Platform Data Transport" for information about determining the platform name
-
Check if the tablespaces to be transported are self-contained by executing the
DBMS_TTS.TRANSPORT_SET_CHECK
procedure. If theTRANSPORT_SET_VIOLATIONS
view contains rows corresponding to the specified tablespaces, then you must resolve the dependencies before proceeding with the conversion.For tablespaces in a pluggable databae (PDB), you must change the container to the PDB by using the
ALTER SESSION SET CONTAINER
command.See Also:
Example 20-1 for information about executing the
DBMS_TTS.TRANSPORT_SET_CHECK
procedure -
Place the tablespaces to be transported in read-only mode. For example, enter:
ALTER TABLESPACE finance READ ONLY; ALTER TABLESPACE hr READ ONLY;
-
Choose a method for naming the output files.
-
Start RMAN and connect as
TARGET
to the source database (not the destination database) and as a common user with theSYSDBA
orSYSBACKUP
privilege. If the tablespace is in a PDB, connect to the PDB as a common user or local user with theSYSDBA
orSYSBACKUP
privilege.The following example connects to a PDB as the
SYS
user:RMAN> connect target "sys@my_pdb as sysdba" target database Password: connected to target database: DB203:MY_PDB (DBID=1139070871)
-
Run the
CONVERT TABLESPACE
command to convert the data files into the endian format of the destination host.In the following example, the
FORMAT
argument controls the name and location of the converted data files:RMAN> CONVERT TABLESPACE finance, hr 2> TO PLATFORM 'Linux IA (64-bit)' 3> FORMAT '/tmp/transport_linux/%U';
The result is a set of converted data files in the
/tmp/transport_linux/
directory, with data in the correct endian format for the Linux IA (64-bit) platform.See Also:
Oracle Database Backup and Recovery Reference for the full semantics of the
CONVERT
command -
Follow the rest of the general outline for transporting tablespaces:
-
Use the Oracle Data Pump Export utility to create the export dump file on the source host.
-
Move the converted data files and the export dump file from the source host to the desired directories on the destination host.
-
Plug the tablespace in to the new database with the DataPump Import utility.
-
If applicable, place the transported tablespaces into read/write mode.
See Also:
Oracle Database Administrator's Guide for information about using transportable tablespaces
-
27.4 Performing Cross-Platform Data File Conversion with Image Copies
You can use the CONVERT DATAFILE
command to perform cross-platform
conversion of tablespaces with image copies.
27.4.1 About Renaming Output Files During RMAN Cross-Platform Data File Conversion
Data file conversion necessitates that you choose a technique for naming the output files. You must use the FORMAT
or DB_FILE_NAME_CONVERT
arguments to the CONVERT
command to control the naming of output files. The rules are listed in order of precedence:
-
Any file that matches any pattern provided in the
DB_FILE_NAME_CONVERT
clause is named based upon this pattern. -
If you specify a
FORMAT
clause, then any file not named based on the pattern provided in theDB_FILE_NAME_CONVERT
clause is named based on theFORMAT
pattern.
Note:
You cannot use the DB_FILE_NAME_CONVERT
clause to generate output file names for the CONVERT
command when both the source and destination files are Oracle Managed Files.
If the source and destination platforms differ, then you must specify the FROM PLATFORM
parameter. View platform names by querying the V$TRANSPORTABLE_PLATFORM
. The FROM PLATFORM
value must match the format of the data files to be converted to avoid an error. If you do not specify FROM PLATFORM
, then this parameter defaults to the value of the destination platform.
See Also:
"Platforms that Support Cross-Platform Data Transport" for information about determining the platform name
27.4.2 Performing Tablespace Transportation on the Destination Host Using RMAN CONVERT DATAFILE
Tablespaces can be transported by using the CONVERT DATAFILE
on the
destination database, to convert the data files that are associated with the
tablespace.
This section explains how to use the CONVERT DATAFILE
command. The
section assumes that you intend to transport tablespaces finance
(data files fin/fin01.dbf
and fin/fin02.dbf
) and
hr
(data files hr/hr01.dbf
and
hr/hr02.dbf
) from a source database named
prod_source
. The database runs on a Sun Solaris host. You plan
to transport these tablespaces into a destination database named
prod_dest
, which runs on a Linux PC. You plan to perform
conversion on the destination host.
When the data files are plugged in to the destination database, you plan to store them in /orahome/dbs
and preserve the current directory structure. That is, data files for the hr
tablespace are stored in the /orahome/dbs/hr
subdirectory, and data files for the finance
tablespace are stored in the /orahome/dbs/fin
directory.
To perform cross-platform data file conversion with image copies:
- See the list of
CONVERT
command prerequisites described in Oracle Database Backup and Recovery Reference. Meet these prerequisites before performing the steps in this section. -
Start SQL*Plus and connect to the source database
prod_source
with administrator privileges. -
Query the name for the source platform in
V$TRANSPORTABLE_PLATFORM
.For this scenario, assume that the
PLATFORM_NAME
for the source host isSolaris[tm] OE (64-bit)
.See Also:
"Platforms that Support Cross-Platform Data Transport" for information about determining the platform name
-
Identify the tablespaces to be transported from the source database and place them in read-only mode. For tablespaces in a pluggable databae (PDB), you must change the container to the PDB by using the
ALTER SESSION SET CONTAINER
command.For example, enter the following SQL statements to place
finance
andhr
in read-only mode:ALTER TABLESPACE finance READ ONLY; ALTER TABLESPACE hr READ ONLY;
-
On the source host, use Data Pump Export to create the export dump file.
In this example, the dump file is named
expdat.dmp
. -
Make the export dump file and the data files to be transported available to the destination host.
You can use NFS to make the dump file and current database files (not copies) accessible. Alternatively, you can use an operating system utility to copy these files to the destination host.
In this example, you store the files in the
/tmp/transport_solaris/
directory of the destination host. You preserve the subdirectory structure from the original location of the files; that is, the data files are stored as:-
/tmp/transport_solaris/fin/fin01.dbf
-
/tmp/transport_solaris/fin/fin02.dbf
-
/tmp/transport_solaris/hr/hr01.dbf
-
/tmp/transport_solaris/hr/hr02.dbf
-
-
Start RMAN and connect to the destination database (not the source database) as
TARGET
, as a common user with theSYSDBA
orSYSBACKUP
privilege. If the tablespaces must be transported into a PDB, connect asTARGET
to the PDB, as a common user with theSYSDBA
orSYSBACKUP
privilege.For example, the following command connects to the target database
prod_dest
using thesbu
user who is granted theSYSBACKUP
privilege:% rman RMAN> CONNECT TARGET "sbu@prod_dest AS SYSBACKUP";
-
Execute the
CONVERT DATAFILE
command to convert the data files into the endian format of the destination host.In this example, you use
DB_FILE_NAME_CONVERT
to control the name and location of the converted data files. You also specify theFROM
PLATFORM
clause.RMAN> CONVERT DATAFILE 2> '/tmp/transport_solaris/fin/fin01.dbf', 3> '/tmp/transport_solaris/fin/fin02.dbf', 4> '/tmp/transport_solaris/hr/hr01.dbf', 5> '/tmp/transport_solaris/hr/hr02.dbf' 6> DB_FILE_NAME_CONVERT 7> '/tmp/transport_solaris/fin','/orahome/dbs/fin', 8> '/tmp/transport_solaris/hr','/orahome/dbs/hr' 9> FROM PLATFORM 'Solaris[tm] OE (64-bit)';
The result is a set of converted data files in the
/orahome/dbs/
directory that are named as follows:-
/orahome/dbs/fin/fin01.dbf
-
/orahome/dbs/fin/fin02.dbf
-
/orahome/dbs/hr/hr01.dbf
-
/orahome/dbs/hr/hr02.dbf
-
-
Follow the rest of the general outline for transporting tablespaces:
-
Plug the tablespace in to the new database with the DataPump Import utility.
-
If applicable, place the transported tablespaces into read-only mode.
-
See Also:
-
Oracle Database Backup and Recovery Reference for the syntax and semantics of the
CONVERT
command -
Oracle Database Administrator's Guide for information about transportable tablespaces
27.5 Performing Cross-Platform Database Conversion with Image Copies
When you perform cross-platform database conversion with image copies, you can convert the data files on either the source host or the destination host.
27.5.1 Checking the Database Before Cross-Platform Database Conversion
Use the RMAN CONVERT DATABASE
command to automate the copying of an
entire database from one platform to another.
Prerequisites:
-
Before converting the database, confirm that you meet all the
CONVERT DATABASE
command prerequisites described in Oracle Database Backup and Recovery Reference. -
Both the source and destination platform must share the same endian format. For example, you can transport a database from Microsoft Windows to Linux for x86 (both little-endian), or from HP-UX to AIX (both big-endian), but not from HP-UX to Linux for x86 (big-endian to little-endian).
Note:
If you cannot use the
CONVERT DATABASE
command because the platforms do not share endian formats, then you can create a new database on the destination platform and then use cross-platform transportable tablespace to copy your data. -
When you transport entire databases, note that certain files require RMAN conversion to ensure compatibility with the destination platform. Even though the endian formats for the source and destination platform are the same, these files cannot be simply copied from the source to the destination system. The following kinds of files require RMAN conversion:
-
Any file containing undo segments
-
Any file containing automatic segment space management (ASSM) segment headers that is being transported to or from the HP Tru64 platform
Note:
When converting to or from Tru64 UNIX platform, even if the databases use the same endian format, you must use the
CONVERT
command to convert data files with automatic segment space management (ASSM) headers. See My Oracle Support Note 732053.1 for information about identifying data files that contain undo data or ASSM headers.
-
-
The
CONVERT DATABASE
command, by default, processes all data files in the database using RMAN conversion. The RMAN conversion copies the files from one location to another, even when it does not make any changes to the file. If you have other preferred means to copy those files that do not require RMAN conversion, you can use theSKIP UNNECESSARY DATAFILES
option of theCONVERT DATABASE
command. If you select this option, then theCONVERT DATABASE
command only processes the files that require conversion. All other files must either be made accessible to the user or copied from the source to the destination database.Whether the data file conversion is performed at the source or destination host, you must copy the files while the source database is open in read-only mode.
To check the database before cross-platform conversion:
27.5.2 Converting Data Files on the Source Host When Transporting a Database
Use the CONVERT DATBASE
command to perform cross-platform transport of
a database by converting data files on the source host.
When you transport entire databases, certain types of blocks such as blocks in undo segments must be reformatted to ensure compatibility with the destination platform. Even though the endian formats for the source and destination platform are the same, certain data files must undergo a conversion process and cannot be simply copied from one platform to another.
Data files with undo information and those from the HP Tru64 platform must be converted. By default, all data files are converted when the CONVERT DATABASE
command is executed. If, however, SKIP UNNECESSARY DATAFILES
is used in the CONVERT DATABASE
command, then the data files with undo segments and those from the HP Tru64 platform are converted. All other data files do not require conversion and can be copied to the new database using FTP, an operating system copy command, or some other mechanism.
This section assumes that you have met all of the CONVERT DATABASE
prerequisites and followed the steps in "Checking the Database Before Cross-Platform Database Conversion". The goal of this procedure is to convert the format of data files on the source host as part of a cross-platform database transport.
Assume that you want to convert a database running on Solaris to a database that runs on Windows.
To convert the database on the source host:
When the transport script finishes, the creation of the new database is complete.
See Also:
Oracle Database Administrator's Guide for information about operating system authentication and password file authentication
27.5.3 Converting Data Files on the Destination Host When Transporting a Database
The procedure converts the format of data files on the destination host as part of a cross-platform database transport.
Perform the data file conversion in the following phases:
- Ensure that you have met all of the prerequisites described in "Checking the Database Before Cross-Platform Database Conversion".
- Convert data files on the source host and generate the required scripts, as described in "Performing Preliminary Data File Conversion Steps on the Source Host".
- Run the generated scripts on the destination host, as described in "Running the Conversion Scripts on the Destination Host".
27.5.3.1 Performing Preliminary Data File Conversion Steps on the Source Host
When you use the CONVERT DATBASE
command on the source host, RMAN
generates an initialization parameter file and scripts that you can edit for use on the
destination host. You also copy the unconverted data files from the source host to the
destination host..
To perform preliminary data file conversion steps on the source host:
27.5.3.2 Running the Conversion Scripts on the Destination Host
Convert data files on the destination host and complete the cross-platform database transport by running the scripts that were generated on the source host during database conversion.
The convert script created in the previous phase uses the original data file names of
the source database files. The FORMAT
parameter specifies the name that was
generated with the FORMAT
or DB_FILE_NAME_CONVERT
parameter of
the CONVERT DATABASE
command.
If the data files of the source database are accessible from the destination host with the same path names, then so long as the source database is read-only you can run the convert script on the destination host without any changes. For example, if the source and destination hosts both use NFS to mount a disk containing the source data files, and if the mount point for both hosts is /fs1/dbs/
, then no editing is needed.
To run the conversion scripts on the destination host:
When the transport script completes, the destination database is created.
27.6 Overview of Cross-Platform Data Transport Using Backup Sets
RMAN can transport databases, data files, and tablespaces across platforms by using backup sets. With backup sets, you can reduce the size of backups using block compression. This improves backup performance and reduces the time taken to transport backups over the network.
Note:
To perform cross-platform data transport using backup sets, the version of the destination database must be Oracle Database 12c Release 1 (12.1) or later.
When you transport an entire database to a different platform, the source platform and the destination platform must use the same endian format. However, user tablespaces can be transported to a destination platform that uses a different endian format from the source platform.
A cross-platform backup is an RMAN backup that can be restored on a
destination platform that is different from the source platform. Cross-platform backups can
be restored on any platform that is supported in the
V$TRANSPORTABLE_PLATFORM
view.
RMAN does not catalog backup sets created for cross-platform transport in the control file. This ensures that backup sets created for cross-platform transport are not used during regular restore operations.
27.6.1 Basic Terms Used in Cross-Platform Data Transport Using Backup Sets
Before using backup sets to perform cross-platform data transport, it is useful to understand the following terms.
Foreign Data File
Data files that do not belong to the destination database are called foreign data files. These data files are being plugged in to the destination database as part of a data transfer to the destination database. In the source database, this data file is identified by its original data file number.
Foreign Tablespace
A foreign tablespace is a set of foreign data files that comprise a tablespace in the source database. These foreign data files do not belong to the destination database, but are being transported into the destination database and are identified by the original tablespace name in the source database.
Foreign Data File Copy
A foreign data file copy is a data file that was restored from a cross-platform backup. It cannot be directly plugged in to the destination database because it is inconsistent. You must apply a cross-platform incremental backup to this data file and recover it before you can plug it in to the destination database.
Data Pump Destination
A Data Pump destination is a location on the disk of the server host of the destination database on which the Data Pump export dump file and the Data Pump log files are stored.
27.6.2 High-Level Steps to Transport Data Across Platforms Using Backup Sets
High-level steps to transport data across using backup sets include creating a cross-platform backup of the source database, making the source database backups accessible to the destination, and restoring backups on the destination database.
Transporting data across platforms using backup sets consists of the following high-level steps:
-
On the source database, use the
BACKUP
command to create a cross-platform backup of the database, tablespaces, or data files that need to be transported to a different platform. The backup is created as backup sets on the source host.Use the
FOR TRANSPORT
orTO PLATFORM
clause in theBACKUP
command to create cross-platform backups. When you create a cross-platform backup of read-only tablespaces using either of these clauses, RMAN can also create a Data Pump export dump file containing the metadata required to plug these tablespaces into the destination database. -
Transfer the backup sets created on the source host to the destination host.
You can transport the backup sets using operating system utilities. For example, if your operating system is Linux or UNIX, you can use the
cp
command to transfer backup sets. -
On the destination database, restore the backup sets that were transferred from the source host. Use the
RESTORE
command to restore cross-platform backups.When you are transporting tablespaces across platforms by using inconsistent tablespace backups, the additional step of recovering the tablespaces is required as described in "Performing Cross-Platform Transport of Tablespaces Using Inconsistent Backups".
Note:
Although the TO PLATFORM
and FOR
TRANSPORT
clauses are not supported in Oracle Database 10g
Release 2 (10.2) or Oracle Database 11g, you can transport data from
these versions of the database to Oracle Database 12c Release 1 (12.1).
On the source database, you first create backup sets of the tablespaces to be
transported and then create the Data Pump export dump file by using the
expdp
command. To restore these backups on the destination
database, you perform a restore operation using the RESTORE
command and then use the impdp
command to import the Data Pump
export dump file.
27.6.3 Scenarios in Which RMAN Automatically Creates a Cross-Platform Backup of the Database
Under certain conditions, RMAN automatically creates a cross-platform backup of the entire database.
When you use backup sets to back up an entire database, RMAN automatically creates a cross-platform backup of the database (in addition to the specified backup) if the following conditions are met:
-
Prerequisites for transporting an entire database as a backup set are satisfied, as described in Performing Cross-Platform Transport of a Whole Database with Backup Sets.
-
The
BACKUP
command does not contain any clause that is incompatible with theFOR TRANSPORT
orTO PLATFORM
clause.See Also:
Oracle Database Backup and Recovery Reference for information about the incompatible clauses
Example 27-1 Implicit Creation of a Cross-Platform Database Backup
The following BACKUP
command creates a cross-platform
backup of the database. Although the command does not contain either the FOR
TRANSPORT
or TO PLATFORM
clause to indicate that it is
a cross-platform backup, because the prerequisites for transporting an entire
database using backup sets are met, an implicit cross-platform backup of the
database is created.
RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK;
ALLOCATE CHANNEL c3 DEVICE TYPE DISK;
BACKUP
SKIP OFFLINE
FILESPERSET 1
FORMAT '/tmp/xplat_backups/implicit_full_db_%U'
DATABASE;}
27.6.4 Guidelines for Cross-Platform Data Transport Using Backup Sets
Follow guidelines for performing cross-platform transport with backup sets.
You can specify the names and locations of restored data files and specify the objects that must be imported into the destination database.
27.6.4.1 About Backing Up Data on the Source Database for Cross-Platform Data Transport
Use the BACKUP
command on the source database to create a backup set
containing data that must be transported to the destination database. To indicate that you
are creating a cross-platform backup, include either the FOR TRANSPORT
or
TO PLATFORM
clause.
Use one of the following clauses with the BACKUP
command:
-
FOR TRANSPORT
clauseThe backup set that is created can be transported to any destination database. If the destination database uses an endian format that is different from that of the source database, then the required endian format conversion is performed on the destination database. The benefit of this method is that the processing overhead of the conversion operation is offloaded to the destination database.
-
TO PLATFORM
clauseThe endian format conversion is performed on the source database. The target platform specified by the
TO PLATFORM
clause must be a supported platform for cross-platform transport. TheV$TRANSPORTABLE_PLATFORM
view contains the list of supported platforms.
See Also:
-
Oracle Database Backup and Recovery Reference for an example of cross-platform backups that contain multiple backup pieces
- Oracle
Database Backup and Recovery Reference for a list of clauses
that are not supported when creating cross-platform backups using the
BACKUP
command
27.6.4.2 About the Data Pump Export Dump File Used for Cross-Platform Tablespace Transport
An export dump file is used to store the metadata required to plug in restored tablepaces into the destination database.
When you create a cross-platform consistent tablespace backup, the backup set contains the data files that contain data related to the specified tablespaces. A consistent tablespace backup is a backup of one or more tablespaces that is created when the tablespaces are in read-only mode. After you restore this backup in your destination database, the tablespaces must be plugged in to the destination database. To do this, in addition to the backup set containing the tablespace data, you need the metadata for these tablespaces from the source database.
On the source database, use the DATAPUMP
clause in the
BACKUP
command to create the metadata required to plug tablespaces
in to the target database. The metadata is stored in a Data Pump export dump file as a separate backup set. Use this backup set to
plug the transported tablespaces in to the target database.
You can specify how the backup set containing the tablespace metadata is named by
using the FORMAT
option with the DATAPUMP
clause. If
you omit the FORMAT
option, then the format specified in the
BACKUP
command is used to name the export dump file. When no
FORMAT
option is specified in the BACKUP
command,
the default format is used.
Note:
When you use the DATAPUMP
clause, the tablespaces that are being transported must be made read-only.
27.6.4.3 About Restoring Data on the Destination Host During Cross-Platform Data Transport
Use the foreignFileSpec
clause of the RESTORE
command to restore the database, tablespaces, or data files contained in a cross-platform
backup consisting of backup sets.
Specify the following information when you restore cross-platform backups:
-
Backup set that contains data that was backed up on the source database
Use the
BACKUPSET
option of theforeignFileSpec
subclause to specify the name of the cross-platform backup set from which data must be restored. If the cross-platform backup consists of multiple backup sets, use a separateBACKUPSET
clause for each backup set. To restore tablespaces, you must specify the backup sets that contain the tablespace data using theBACKUPSET
clause and the backup set that contains the tablespace metadata using theDUMP FILE
option of theforeignFileSpec
subclause.Using multiple backup sets is not supported during recovery. You cannot apply multiple backup sets to a set of foreign data files.
-
Data file numbers or names of tablespaces as they exist in the source database
If you are restoring data files or tablespaces, you can restore specific tablespaces or data files that are contained in a cross-platform backup.
-
Location where the restored data files must be stored
Use the
FORMAT
clause to specify the location and the names used to store the restored data files.If you do not provide a destination, then the
DB_CREATE_FILE_DEST
initialization parameter must be set in the target platform. RMAN restores the data files to the location specified by this parameter using new Oracle Managed File (OMF) names. -
Name of the source platform (only when conversion is performed on the destination database)
Use
FROM PLATFORM
to specify the name of the source platform on which the backup sets were created. The platform name must exactly match the name specified while creating the backup set. If there is a difference in the platform names, the restore operation fails.
See Also:
- Oracle Database Backup and Recovery Reference for
information about
RESTORE
command clauses - "About Names and Locations for Restored Objects on the Destination Database"
- "About Backing Up Data on the Source Database for Cross-Platform Data Transport"
27.6.4.4 About Selecting Objects to Be Restored from Cross-Platform Backups
While restoring data from a cross-platform backup, you can either restore all the data contained in the cross-platform backup or only certain objects.
Restoring All Data Contained in the Cross-Platform Backup
To restore the entire database, use the FOREIGN DATABASE
clause in
the RESTORE
command. This clause can only be used when restoring
from a whole database backup set and when both the source platform and destination
database use the same endian format. You can optionally use the
FORMAT
clause to specify the pattern used to name restored
files.
To restore all the data files contained in the cross-platform backup, use the
ALL FOREIGN DATAFILES
clause in the RESTORE
command.
Restoring Part of the Data Contained in the Cross-Platform Backup Set
You can restore some data files or tablespaces contained in a cross-platform backup.
To restore only some data files, use the FOREIGN DATAFILE
clause in
the RESTORE
command. Specify the absolute file number of the data
file in the source database while restoring data. To restore only some tablespaces
contained in a cross-platform backup, use the FOREIGN TABLESPACE
clause in the RESTORE
command. Specify the names of the tablespaces
that must be restored as part of this clause.
See Also:
Oracle Database Backup and Recovery Reference for more information about the clauses described in this section
27.6.4.5 About Names and Locations for Restored Objects on the Destination Database
While restoring a cross-platform backup, specify the data file names and the location to which the data files must be restored.
Use one of the following clauses in the RESTORE
command:
-
Use the
TO NEW
option with theALL FOREIGN DATAFILES
clause to restore the data files to the location specified by theDB_CREATE_FILE_DEST
parameter. By default, RMAN uses OMF names for the data files. -
Use the
FORMAT
option to specify the pattern used to name restored data files. You can also specify the directory for these files as part of theFORMAT
specification.
See Also:
Oracle Database Backup and Recovery Reference for more information about the clauses described in this section
27.6.4.6 About Importing the Data Pump Export Dump File Created During Cross-Platform Tablespace Transport
When restoring a cross-platform backup of read-only tablespaces on the destination database, the backup set that contains the Data Pump export dump file created must be restored.
Use the DUMP FILE ... FROM BACKUPSET
option of the
foreignFileSpec
subclause to restore the backup set that contains
the Data Pump export dump file that was created on the source database. This file
contains the metadata required to plug the tablespace in to the destination
database.
Use the DATAPUMP
clause in the RESTORE
command to
specify the location, in the destination host, to which the export dump file is
restored. If you omit this clause, the dump file is restored to a default operating
system-specific location.
By default, RMAN automatically imports the export dump file after all the required
foreign data files are restored. You can choose not to import the export dump file by
specifying the NOIMPORT
clause. If you do not import the export dump
file as part of the restore operation, then you must manually import the dump file when
you want to plug the tablespaces in to the destination database.
Note:
If the export dump file is automatically imported (that is, the NOIMPORT
clause is not used), then the destination database must be open in read/write mode.
27.7 Performing Cross-Platform Database Transport with Backup Sets
You can transport a whole multitenant container database (CDB), the root only, or one or more pluggable databases (PDBs) across platforms.
27.7.1 About Cross-Platform Transport of PDBs
To transport an entire PDB to a different platform, the source platform and destination platform must use the same endian format. The COMPATIBLE
parameter on the source and destination CDB must be set to 12.1 or higher.
Use one of the following techniques to transport PDBs across platforms:
-
Connect to the root and use the
BACKUP FOR TRANSPORT ... PLUGGABLE DATABASE
orBACKUP TO PLATFORM ... PLUGGABLE DATABASE
command to create a cross-platform backup of one or more PDBs.When you are connected to the root, the following command creates a cross-platform backup of the PDBs
hr_pdb
andsales_pdb
. The PDBs must be read-only mode before the cross-platform backup is created.BACKUP FOR TRANSPORT PLUGGABLE DATABASE hr_pdb, sales_pdb FORMAT '/tmp/backups/pdb_%U';
-
Connect to the PDB and use the
BACKUP FOR TRANSPORT
orBACKUP TO PLATFORM
commands to create backup sets that can be used to transport the PDB data to another platform.
Note:
Performing cross-platform data transport of one or more PDBs by using the CONVERT
command is not supported.
See Also:
27.7.2 Performing Cross-Platform Transport of a Whole Database with Backup Sets
When transporting an entire database across platforms using backup sets, you can convert the database either on the source database or the destination database. The benefit of performing the conversion on the destination database is that the processing overhead of the convert operation is offloaded from the source to the destination database.
-
The
COMPATIBLE
parameter in the server parameter file of the source database and the destination database must be set to 12.0.0 or higher. -
The source database must be open in read-only mode.
-
The
DBMS_TDB.CHECK_DB
procedure must run successfully. See "Checking the Database Before Cross-Platform Database Conversion". -
The source platform and destination platform must use the same endian format.
To transport a whole database from one platform to another:
27.7.3 Performing Cross-Platform Transport of a Closed PDB
Pluggable database (PDBs) can be transported and plugged in to a destination multitenant container database (CDB) which is on a different platform than the source CDB. In addition to an RMAN backup of the PDB, you need the metadata required to plug the PDB into the destination CDB.
The COMPATIBLE
parameter on the source CDB and destination CDB must be set to 12.2. The source CDB and the destination CDB must use the same endian format.
To perform cross-platform transport of a closed PDB into a destination CDB:
27.7.4 Performing Cross-Platform Transport of a PDB Using Inconsistent Backups
You can use a combination of inconsistent and consistent backups to transport a PDB and plug it into a CDB that is on a different platform. Inconsistent backups enable you to reduce application downtime because the PDB can be open while the backup is performed
When the PDB is open, you create cross-platform inconsistent backups. The first backup is an incremental level 0 backup. Subsequent backups are incremental level 1 backups that contain changes made to the PDB since the last incremental backup. There is no restriction on the number of inconsistent level 1 backups. Finally, close the PDB, create the last consistent incremental level 1 backup and the XML file containing the metadata required to plug the source PDB into a destination CDB.
COMPATIBLE
parameter on the source CDB and destination CDB must be set to 12.2. The source CDB and the destination CDB must use the same endian format.
27.8 Performing Cross-Platform Transport of Tablespaces Using Backup Sets
You can transport tablespaces in the root or pluggable database (PDB) using backup sets.
27.8.1 Performing Cross-Platform Transport of Read-Only Tablespaces Using Backup Sets
Use the BACKUP
command to create backup sets used to transport
read-only tablespaces from one platform to another. You must also export the metadata
required to plug these tablespaces in to the destination database.
Prerequisites:
-
COMPATIBLE
parameter in the server parameter file of the source database and destination database is set to 12.0.0 or greater. -
The tablespaces to be transported are self-contained.
Execute the
DBMS_TTS.TRANSPORT_SET_CHECK
procedure to check for dependencies. If theTRANSPORT_SET_VIOLATIONS
view contains rows corresponding to the specified tablespaces, then you must resolve the dependencies before creating the cross-platform backup.See Also:
Example 20-1 for information about executing the
DBMS_TTS.TRANSPORT_SET_CHECK
procedure -
The tablespaces to be transported are in read-only mode, unless the
ALLOW INCONSISTENT
clause is used in theBACKUP
command.
To transport read-only tablespaces across platforms using backup sets:
See Also:
Oracle Database Backup and Recovery Reference for additional examples on performing cross-platform backup and restore operations
27.8.2 Performing Cross-Platform Transport of Tablespaces Using Inconsistent Backups
You can transport inconsistent tablespaces across platforms using backup sets or
image copies. Use the BACKUP
command to create a cross-platform backup
using backup sets.
See Also:
For more information about using scripts to perform cross-platform transport using backup sets, refer to the My Oracle Support Note 1389592.1 at https://support.oracle.com/rs?type=doc&id=1389592.1
27.8.2.1 Overview of Cross-Platform Transport of Tablespaces Using Inconsistent Backups
You can perform cross-platform transport of read-write tablespaces. Create one or more incremental cross-platform backups when the tablespaces are in read-write mode. Then create one final incremental backup when the tablespace is in read only mode.
An inconsistent tablespace backup is a backup of one or more tablespaces that is created when the tablespaces are in read/write mode. The term inconsistent refers to the fact that data files in the backup contain changes that were made after the files were checkpointed. The foreign data files produced during a cross-platform inconsistent backup operation cannot be directly plugged in to the destination database. They must be made consistent before they can be opened on the destination database. You make the foreign data files consistent by applying a cross-platform incremental backup, created when the tablespaces are placed in read-only mode, to these foreign data files. This backup must also include the export dump file containing the metadata required for plug the transported tablespaces in to the destination database.
Inconsistent tablespace backups enable you to reduce application downtime. When the tablespaces are online and available to the users, you create cross-platform inconsistent backups on the source database. The first backup must be a level 0 incremental backup. Subsequently, create smaller level 1 incremental backups that contain the changes made to the tablespaces since the most recent level 1 backup. These level 0 and level 1 incremental backups can be restored and applied on the destination database even as other level 1 incremental backups are being created on the source database. You need not wait until all the level 1 incremental backups are created on the source database before you start applying previously-created level 1 backups on the destination database. Since the tablespaces are still online while these incremental backups are being created, there is no application downtime at this stage. The final level 1 incremental backup is created with the tablespaces placed in read-only mode. The application downtime begins at this stage. This final backup must include the metadata required to plug the tablespaces in to the destination database.
On the destination database, you first restore the level 0 incremental backup to create a set of foreign data files. Next, apply the level 1 incremental backups that were created when the tablespaces were in read/write mode to these restored foreign data files. Apply these backups in the same order in which they were created. In most cases, the destination database catches up with the last level 1 incremental backup before the final incremental backup, taken with the tablespaces placed in read-only mode, is created on the source database. The last step is to restore the final level 1 incremental backup, created when the tablespaces were placed in read-only mode, to make the foreign data files consistent. This backup contains the tablespace metadata required to plug the tablespaces in to the destination database.
The CONVERT
command creates cross-platform backups using
image copies.
About Creating Inconsistent and Incremental Backups on the Source Database
Use the ALLOW INCONSISTENT
clause in a
BACKUP
or CONVERT
command to create a
cross-platform inconsistent backup of one or more tablespaces. The tablespaces being
transported are in read/write mode when an inconsistent backup is created. To create
incremental backups, use the INCREMENTAL LEVEL 1
clause in the
BACKUP
command.
The first inconsistent backup is a level 0 incremental backup.
Subsequently, you can create multiple cross-platform level 1 incremental backups.
The final cross-platform incremental backup must be a consistent backup that is
created when the tablespaces are read-only. When you create this final incremental
backup, use the DUMP FILE
clause in the BACKUP
command to create the dump file containing the tablespace metadata.
When you use the CONVERT
command, you must explicitly
create the export dump file that contains the metadata for the tablespaces by using
the Data Pump Export utility.
Note:
The ALLOW INCONSISTENT
clause cannot be used for
cross-platform whole database backups.
About Restoring and Recovering Inconsistent Backups on the Destination Database
You first restore the cross-platform level 0 incremental backup, taken when the tablespaces are placed in read/write mode, on the destination database. This operation creates restores the backup and creates foreign data file copies. These foreign data files are inconsistent because the tablespaces were not placed in read-only mode when the backup was created. To make these foreign data files consistent and achieve a consistent checkpointed SCN, apply the incremental backups in the order in which they were created. The final incremental backup applied must be a cross-platform incremental backup that was created when the tablespaces were in read-only mode. Next, to plug the tablespaces in to the destination database, you restore and import the dump file that contains the metadata of the tablespaces being transported.
27.8.2.2 Requirements for Applying Cross-Platform Incremental Backups to the Restored Data Files
Certain requirements must be met to apply cross-platform incremental backups to the restore data files on the destination database.
To successfully apply a cross-platform incremental tablespace backup to a set of restored foreign data files:
-
For each data file that is included in the cross-platform incremental backup, the start SCN must be lower than the current checkpoint SCN of the foreign data file copy.
-
The foreign data file copies created by the restore operation must not be modified.
For example, if a foreign data file copy has been plugged in to the destination database, made read/write, and then made read-only, then RMAN considers that this file has been modified.
27.8.2.3 Steps to Transport Inconsistent Tablespaces to a Different Platform
This section describes the high-level steps to perform cross-platform transport of inconsistent tablespaces using backup sets or image copies.
Prerequisites:
- Confirm that the prerequisites for transporting inconsistent tablespaces using backup sets, described in "Performing Cross-Platform Transport of Read-Only Tablespaces Using Backup Sets", are met.
- Confirm that conditions required to apply cross-platform incremental backups to restore data files, as described in Requirements for Applying Cross-Platform Incremental Backups to the Restored Data Files, are met.
To transport inconsistent tablespaces to a different platform:
-
Create the files required to transport one more tablespaces in the source database as described in Creating Files Required to Transport Tablespaces to a Different Platform
-
Transfer files from the source host to the destination host as described in Transferring Files Created on the Source Host to the Destination Host.
-
Restore tablespaces and plug them into the destination database as described in Restoring Tablespaces and Plugging them in to the Destination Database.
27.8.2.3.1 Creating Files Required to Transport Tablespaces to a Different Platform
This step consists of performing the following tasks in the source database:
27.8.2.3.2 Transferring Files Created on the Source Host to the Destination Host
Use FTP, an operating system copy command, or some other mechanism to move the backup sets, data files, and the dump file that were created in the source database to the destination host.
27.8.2.3.3 Restoring Tablespaces and Plugging them in to the Destination Database
This step consists of performing the following tasks on the destination database:
27.8.2.4 Example: Performing Cross-Platform Inconsistent Tablespace Transport Using Backup Sets
This example transports the inconsistent tablespace my_tbs
from the source database, which is on the Sun Solaris platform, to a destination database on the Linux x86 64-bit platform.
See Also:
"Steps to Transport Inconsistent Tablespaces to a Different Platform " for conceptual information about each step in this example
The following steps enable you to transport the inconsistent tablespace my_tbs
across platforms using backup sets:
27.8.3 Performing Cross-Platform Transport of Tablespaces in a PDB
RMAN enables you to transport user tablespaces contained in a PDB to a different platform by using either the CONVERT
or BACKUP
command. In this case, the source platform and the destination platform can use different endian formats.
Use one of the following techniques to transport a tablespace in a PDB:
-
Connect to the PDB as
TARGET
and use theBACKUP TABLESPACE
command to create a cross-platform backup of the selected tablespaces.See "Steps to Transport Read-Only Tablespaces to a Different Platform Using Backup Sets".
-
Connect to the PDB as
TARGET
and use theCONVERT TABLESPACE
command to transport a read-only tablespace.The following command, when connected to the PDB, converts the read-only tablespace
my_tbs
:CONVERT TABLESPACE my_tbs TO PLATFORM 'Solaris[tm] OE (64-bit)' FORMAT '/tmp/xplat_backups/my_tbs_%U.bck';
-
Connect to the PDB as
TARGET
and use theCONVERT DATAFILE
command.The following command, when connected to the PDB, converts the data file
sales.df
:CONVERT FROM PLATFORM 'Solaris[tm] OE (64-bit)' DATAFILE '/u01/app/oracle/oradata/orcl/sales.df' FORMAT '/tmp/xplat_backups/sales_df_solaris.dat'
However, when connected as TARGET
to a PDB, you cannot use the CONVERT DATAFILE
command to convert a tablespace that contains undo segments.
27.9 Performing Cross-Platform Transport of Data Files Over the Network
RMAN enables you to perform cross-platform transport of data files over the network.
FROM SERVICE
clause along with the RESTORE FOREIGN DATAFILE
command.
tnsnames.ora
and listener.ora
files. The COMPATIBLE
initialization parameter of the source and destination databases must be set to 12.2.