28 Simplified Data Transport Using RMAN Backups

Starting with Oracle Database 23ai, RMAN provides a simplified approach for transporting data across platforms.

28.1 Simplified Data Transport Concepts

You can use regular RMAN backups stored on tape to transport tablespaces and pluggable databases (PDB) from a source platform to a destination platform.

In the simplified data transport method, you can leverage preexisting backups available as part of your regular production backup schedules. On a destination platform, RMAN restores the data files from the RMAN backups and plugs in a tablespace or a PDB on the destination database to complete the data transport process in a simplified and efficient manner.

For example, to quickly transport a PDB, you can restore the data files from a preexisting backup of a PDB, and then plug in the PDB to the destination CDB.

RMAN obtains the backup information either from a recovery catalog or from a transport file. In the NOCATALOG mode, the transport file provides RMAN with the backup information in XML format.

Using RMAN backups to transport data across platforms provides the following benefits:
  • You can offload all the complexities associated with transferring and restoring data from a source platform to a destination platform.
  • You can leverage regular RMAN backups to transport data. This eliminates any additional steps required to prepare tablespaces or PDBs for transport.
  • You can avoid extensive application downtime for transporting data. The source database can remain operational for the entire period when you create backups on a source platform and restore the data files from backups on a destination platform. The process requires minimal application downtime only when RMAN needs to perform a final restore operation on a destination platform.

28.1.1 Methods of Transporting Data Using RMAN Backups

Starting with Oracle Database 23ai, use one of these methods to transport PDBs and tablespaces using their corresponding RMAN backups:

  • Transport PDBs and tablespaces across platforms with a recovery catalog connection

    In this method, RMAN must be connected to the same recover catalog when you create backups and perform restores.

    On a destination database, you must first run the RESTORE PREVIEW command along with the TO TRANSPORT LIST option to generate an in-memory transport list. You can then run the RESTORE command using the transport list. RMAN restores the data files from backups ,rolls forward the restored data files by applying incremental backups, and then plugs in a tablespace or PDB on the destination database.

  • Transport PDBs and tablespaces across platforms in NOCATALOG mode

    In this method, you must create a transport file on the source database. Run the RESTORE PREVIEW command along with the TO TRANSPORT FILE option to store information about the source database backups in a transport file.

    On the destination database, run the RESTORE command using the transport file. RMAN restores the data files from backups ,rolls forward the restored data files by applying incremental backups, and then plugs in a tablespace or PDB on the destination database.

  • Transport pluggable databases and tablespaces over the network

    In this method, RMAN uses the source database files to optimally transfer data over the network. RMAN can connect to the source platform, create the required backups, transfer the backups over the network to the destination platform, and perform the restore operation.

28.1.2 Prerequisites for Transporting Data Using RMAN Backups

Ensure that you meet the generic prerequisites before you transport data using RMAN backups.
  • Before you transport a PDB to a different platform, ensure that:
    • The destination platform follows the same endian format as the source platform
    • The PDB uses local undo
  • Before you transport a tablespace, ensure that the tablespace is self-contained. To determine whether a set of tablespaces is self-contained, run the TRANSPORT_SET_CHECK procedure in the Oracle supplied package DBMS_TTS.

    You can transport tablespaces to a destination platform that uses a different endian format from the source platform.

These prerequisites are specific to the type of method you choose for transporting data.
  • In the recovery catalog based method, ensure that:
    • The COMPATIBLE initialization parameter of the source and destination databases must be set to 23.0.
    • The source database and the destination database are both registered in the same recovery catalog.
    .
  • In the NOCATALOG mode based method, RMAN requires a transport file that contains backup information stored in XML format. Before you restore the data files from backups on a destination database, ensure to store the transport file in a shared location or a network file location (NFS) path that is accessible to the destination host.
  • In the network-based method:
    • You must create a database link on the destination database before you perform the final transport of a PDB or a tablespace to a destination platform.

      Use the SQL*PLUS CREATE DATABASE LINK statement to create a PUBLIC dblink.

      For example, in the following statement, user rco on the destination database defines a database link called networklink that refers to the pluggable database pdb1 on the CDB cdb1.
      CREATE PUBLIC DATABASE LINK pluginlink CONNECT TO rco IDENTIFIED BY password USING 'cdb1_pdb1'

      The dblink is used to transport the export dump file or the PDB unplug XML file from the source database to the destination database.

    • Before you perform a final transport of a tablespace over the network, grant the EXP_FULL_DATABASE privilege to the SYSBACKUP user on the source database.

28.2 Transporting PDBs Across Platforms with a Recovery Catalog

Learn the different ways in which you can transport a PDB by using a backup of the PDB when RMAN is connected to a recovery catalog.

28.2.1 About Transporting PDBs with a Recovery Catalog Connection

In this method, RMAN queries the metadata stored in the recovery catalog to determine the exact backups required for the restore operation and to plug in a PDB on a destination CDB.

These are the essential steps you need to perform to transport a PDB by using a PDB backup when RMAN is connected to a recovery catalog:

On a source CDB:

  • Connect RMAN to a recovery catalog
  • Use a preexisting backup of a PDB or create a new backup using the BACKUP PLUGGABLE DATABASE command
  • Create a final incremental level 1 backup of the source PDB when the PDB is in a read-only mode.
    • Use the BACKUP PLUGGABLE DATABASE command to create a final incremental level 1 backup.
    • Use the DATAPUMP clause to create an export dump file along with the incremental backup.

On a destination CDB:

  • Connect RMAN to the same recovery catalog as the source CDB.
  • Use the SET command along with the FOREIGN DBID clause to set the DBID of the source PDB
  • Use the RESTORE command along with the PREVIEW clause and the TO TRANSPORT LIST clause to generate a transport list. The transport list remains in-memory and indicates the PDB backups that RMAN needs to perform a restore operation on the destination CDB.
  • Use the RESTORE command with the FROM TRANSPORT LIST clause to perform a restore operation using the transport list. RMAN restores the data files from backups, rolls forward, and plugs in the PDB on the destination CDB.

Note:

If the Oracle Active Data Guard logical database rolling upgrade process is running on a destination database, RMAN cannot successfully complete the final step involved in transporting data using backups. This is because the rolling upgrade process restricts RMAN from importing the backup metadata required to restore a final backup and plug in a PDB on the destination database.

28.2.2 Quickly Transport a PDB with a Recovery Catalog Connection

Oracle recommends this method for transporting small-sized PDBs that take less time to backup.

In this quick transport method, you must create an incremental level 0 backup of the source PDB, and an export dump file along with the backup. On the destination platform, generate a transport list and perform a single restore operation using the transport list. RMAN restores the data files from the level 0 backup, and then plugs in the PDB on the destination CDB.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.2.2.1 Source CDB: Preparing to Quickly Transport a PDB with a Recovery Catalog Connection

When the source PDB is in read-only mode, create an incremental level 0 backup and an export dump file along with the backup.

  1. On the source CDB, connect to the root as a user with the SYSDBA or SYSBACKUP privilege.
  2. Connect to a recovery catalog.
  3. Close the PDB that you want to transport to a destination platform.

    The following command closes the PDB hr_pdb.

    RMAN> ALTER PLUGGABLE DATABASE hr_pdb CLOSE IMMEDIATE;
  4. Create an incremental level 0 backup of the PDB, and unplug the PDB from the source CDB.

    For example, the following statement creates an incremental level 0 backup of the PDB hr_pdb. The PDB is unplugged from the source CDB. The UNPLUG INTO clause specifies the XML file to store the structural metadata of the PDB when it is unplugged from the source CDB. The TAG clause specifies the backup tag that is used to identify the RMAN backup.

    RMAN> BACKUP 
    UNPLUG INTO '/tmp/pdb_dumpfiles/hr_pdb_unplug.xml'
    INCREMENTAL LEVEL 0
    PLUGGABLE DATABASE hr_pdb
    XML BACKUP FORMAT '/tmp/pdb_backups/hr_pdb_unplug.bck'
    TAG 'hr_pdb_plugin_tag';
    In this example, the hr_pdb_unplug.xml file contains the metadata required to plug in the PDB on the destination CDB. The hr_pdb_unplug.bck file contains the backup of the unplug file hr_pdb_unplug.xml.
  5. Make a note of the source DBID as displayed by RMAN.
    For example, RMAN outputs a line of the following form when it connects to a target database that is open:
    connected to target database: PROD (DBID=39525561)
28.2.2.2 Destination CDB: Quickly Restore and Plug In a PDB with Recovery Catalog Connection

Perform the final steps required to quickly transport a PDB to a destination CDB when RMAN is connected to a recovery catalog.

  1. Connect the destination CDB to a recovery catalog.
  2. Use the SET command with the FOREIGN DBID clause to specify the DBID of source database.

    The following command sets the DBID of the source database:

    RMAN> SET FOREIGN DBID 39525561;

Perform these steps in a single RMAN session to ensure that the in-memory transport list is available for RMAN during the restore operation.

  1. Run the RESTORE... PREVIEW command along with the TO TRANSPORT LIST option to generate an in-memory list of backups required by RMAN for the restore operation.

    Use the PLUGIN TAG clause to specify the same tag associated with the final incremental backup of the source PDB. During the restore operation, RMAN will use the tag to restore the data files from the incremental backup created with the same tag.

    Use the PLUGGABLE DATABASE command to specify the source PDB.

    The following example generates an in memory transport list of the source PDB backup files which RMAN needs to restore on the destination CDB.

    RMAN> RESTORE PREVIEW
          TO TRANSPORT LIST
          PLUGIN TAG 'hr_pdb_plugin_tag'
          PLUGGABLE DATABASE 'hr_pdb';
  2. Run this command to clear the foreign database ID.
    RMAN> SET FOREIGN DBID CLEAR;
  3. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege.
  4. Ensure that the destination CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;

Restore data files from backups and plug in the PDB using the transport list.

  1. Run the RESTORE command with the FOREIGN PLUGGABLE DATABASE clause and the FROM TRANSPORT LIST clause.
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE hr_pdb 
    FORMAT '/oradata/%U' 
    FROM TRANSPORT LIST;
    RMAN restores the data files from the incremental level 0 backup, and then plugs in the PDB on the destination CDB.

28.2.3 Transport a PDB by Using a Preexisting Backup and Recovery Catalog Connection

RMAN enables you to transport a PDB by leveraging a preexisting PDB backup (level 0) that is available as part of your regular backup schedule.

When the source PDB is in read-only mode, you must create a final incremental level 1 backup of the source PDB and an export dump file along with the incremental backup.

On the destination CDB, generate a transport file and then perform a single restore operation using the transport file. RMAN restores the data files using the most recent preexisting level 0 backup of the PDB, rolls-forward the restored data files by applying the final incremental level 1 backup, and then plugs in the PDB on the destination CDB.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.2.3.1 Source CDB: Preparing to Transport a PDB Using a Preexsiting Backup and Recovery Catalog Connection

You can use a most recent preexsiting backup of a PDB to transport the PDB to a destination platform.

  1. Connect to the root as a user with the SYSDBA or SYSBACKUP privilege.
  2. Connect to a recovery catalog.
  3. Close the PDB that you want to transport to a destination platform.

    The following command closes the PDB hr_pdb.

    RMAN> ALTER PLUGGABLE DATABASE hr_pdb CLOSE IMMEDIATE;
  4. Create a final incremental level 1 backup of the PDB and unplug the PDB from the source CDB.

    The following statement creates a final incremental level 1 backup of the PDB hr_pdb. The PDB is unplugged from the source CDB. The UNPLUG INTO clause specifies the XML file to store the structural metadata of the PDB when it is unplugged from the source CDB. The TAG clause specifies the tag used to identify the RMAN backup.

    RMAN> BACKUP 
    UNPLUG INTO '/tmp/pdb_dumpfiles/hr_pdb_unplug.xml'
    INCREMENTAL LEVEL 1
    PLUGGABLE DATABASE hr_pdb
    XML BACKUP FORMAT '/tmp/pdb_backups/hr_pdb_unplug.bck'
    TAG 'hr_pdb_plugin_tag';
    In this example, the hr_pdb_unplug.xml file contains the metadata required to plug in the PDB on the destination CDB. The hr_pdb_unplug.bck file contains the backup of the unplug file hr_pdb_unplug.xml.
  5. Make a note of the DBID as displayed by RMAN at start up.
    For example, RMAN outputs a line of the following form when it connects to a target database that is open:
    connected to target database: PROD (DBID=39525561)
28.2.3.2 Destination CDB: Restore Data Files from a Preexisting Backup and Plug In a PDB with Recovery Catalog Connection

Restore the data files from a preexisting PDB backup and plug in the PDB on the destination CDB.

  1. Connect the destination CDB to a recovery catalog.
  2. Use the SET command with the FOREIGN DBID clause to specify the DBID of source database.

    The following command sets the DBID of the source database:

    RMAN> SET FOREIGN DBID 39525561;

Perform these steps in a single RMAN session to ensure that the in-memory transport list is available for RMAN during the restore operation.

  1. Run the RESTORE... PREVIEW command along with the TO TRANSPORT LIST option to generate an in-memory list of backups that will be used by RMAN in the restore operation.

    Use the PLUGIN TAG clause to specify the same tag associated with the final incremental level 1 backup of the PDB. During the restore operation, RMAN will use the tag to restore the data files from the incremental level 1 backup created with the same tag.

    Use the PLUGGABLE DATABASE command to specify the source PDB.

    The following example generates an in memory transport list of the source PDB backup files which RMAN must use for the restore operation on the destination CDB.

    RMAN> RESTORE PREVIEW
          TO TRANSPORT LIST
          PLUGIN TAG 'hr_pdb_plugin_tag'
          PLUGGABLE DATABASE 'hr_pdb';
  2. Run this command to clear the foreign database ID.
    RMAN> SET FOREIGN DBID CLEAR;
  3. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege.
  4. Ensure that the CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;
  5. Run the RESTORE command with the FOREIGN PLUGGABLE DATABASE clause and the FROM TRANSPORT LIST clause.
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE hr_pdb 
    FORMAT '/oradata/%U' 
    FROM TRANSPORT LIST;
    RMAN restores the data files from the level 0 backup of the PDB, rolls-forward the restored data files by applying the incremental level 1 backup, and then plugs in the PDB on the destination CDB.

28.2.4 Transport a PDB Using Multiple Incremental Backups and Recovery Catalog Connection

Oracle recommends this method for transporting large-size PDBs across platforms with minimum application downtime on the source PDB.

On the destination CDB, you must first restore the data files from a preexisting backup or new backup of the PDB. You can then roll forward the restored data files by applying multiple incremental level 1 backups periodically. While the source PDB remains open and operational, you can continue to apply any number of incremental level 1 backups on the destination CDB until you want to perform the final transport.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.2.4.1 Source CDB: Preparing to Transport a PDB Using Multiple Incremental Backups and Recovery Catalog Connection

You can leverage a preexisting PDB backup. Optionally, use this procedure to create an incremental level 0 backup of the source PDB.

If you want to begin by using a preexisting level 0 backup of a source PDB, then skip to step 2.
  1. Connect to the root as a user with the SYSDBA or SYSBACKUP privilege.
  2. Connect to a recovery catalog.
  3. On the source CDB, use the BACKUP PLUGGABLE DATABASE command to create a incremental level 0 backup of the PDB you want to transport to a destination CDB.

    The following statement creates an incremental level 0 backup of the PDB sales_pdb:

    RMAN> BACKUP
    INCREMENTAL LEVEL 0
    PLUGGABLE DATABASE sales_pdb;
  4. Make a note of the DBID as displayed by RMAN at start up.
    For example, RMAN outputs a line of the following form when it connects to a target database that is open:
    connected to target database: PROD (DBID=39525561)
28.2.4.2 Destination CDB: Restore Data Files from a Level 0 Backup of a PDB with Recovery Catalog Connection

The level 0 backup serves as a basis for RMAN to apply subsequent increment level 1 backups of the PDB.

  1. Connect the destination CDB to a recovery catalog.
  2. Use the SET command with the FOREIGN DBID clause to specify the DBID of source PDB.

    The following command sets the DBID of the source PDB:

    RMAN> SET FOREIGN DBID 39525561;

Perform these steps in a single RMAN session to ensure that the in-memory transport list is available for RMAN during the restore operation.

  1. Run the RESTORE... PREVIEW command along with the TO TRANSPORT LIST option to generate an in-memory list of backups that will be used by RMAN for the restore operation.

    Use the PLUGGABLE DATABASE command to specify the name of the PDB that you want to transport to the destination host.

    The following example generates an in memory transport list of the source PDB backup files which RMAN must transport and restore on the destination CDB.

    RMAN> RESTORE PREVIEW
          TO TRANSPORT LIST
          PLUGGABLE DATABASE 'sales_pdb';
  2. Run this command to clear the current setting of the foreign database ID.
    RMAN> SET FOREIGN DBID CLEAR;
  3. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege.
  4. Ensure that the CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;
  5. Run the RESTORE command with the FOREIGN PLUGGABLE DATABASE clause and the FROM TRANSPORT LIST clause.
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE sales_pdb
    FORMAT '/oradata/%U'
    FROM TRANSPORT LIST;
    On the destination CDB, RMAN restores the data files from the incremental level 0 backup of the source PDB sales_pdb.
28.2.4.3 Restore Incremental Backups of a PDB with Recovery Catalog Connection

On the destination CDB, roll forward the restored data files by applying incremental level 1 backups periodically.

While the source PDB remains open, you can create incremental level 1 backups of the source PDB and then perform a restore operation on the destination CDB. This method minimizes the application downtime and helps to reduce the amount of changed data that needs to be applied to the destination database when you perform the final transport of the PDB.

There is no restriction on the number of times you can repeat this procedure. When you are ready to perform the final transport of the PDB, proceed to step 4.

On the source CDB, create an incremental level 1 backup of the PDB

  1. Connect to the root as user with the SYSDBA or SYSBACKUP privilege.
  2. Connect to a recovery catalog.
  3. On the source CDB, use the BACKUP PLUGGABLE DATABASE command to create an incremental level 1 backup of the PDB.

    The following statement creates an incremental level 1 backup of the PDB sales_pdb:

    RMAN> BACKUP
    INCREMENTAL LEVEL 1
    PLUGGABLE DATABASE sales_pdb;
  4. Make a note of the DBID as displayed by RMAN at start up.
    For example, RMAN outputs a line of the following form when it connects to a target database that is open:
    connected to target database: PROD (DBID=39525561)

On the destination CDB, restore data files from the PDB backup

  1. Connect the destination CDB to a recovery catalog.
  2. Use the SET command with the FOREIGN DBID clause to specify the DBID of source database.

    The following command sets the DBID of the source database

    RMAN> SET FOREIGN DBID 39525561;

Perform these steps in a single RMAN session to ensure that the in-memory transport list is available for RMAN during the restore operation.

  1. Run the RESTORE... PREVIEW command along with the TO TRANSPORT LIST option to generate an in-memory list of the PDB backups that will be used by RMAN in the subsequent restore operation.

    Use the PLUGGABLE DATABASE command to specify the source PDB.

    The following example generates an in memory transport list of the source PDB backup files which RMAN must transport and restore on the destination CDB.

    RMAN> RESTORE PREVIEW
          TO TRANSPORT LIST
          PLUGGABLE DATABASE 'sales_pdb';
  2. Run this command to clear the foreign database ID.
    RMAN> SET FOREIGN DBID CLEAR;
  3. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege.
  4. Ensure that the CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;
  5. Run the RESTORE command with the FOREIGN PLUGGABLE DATABASE clause and the FROM TRANSPORT LIST clause.
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE sales_pdb
    FORMAT '/oradata/%U'
    FROM TRANSPORT LIST;
    On the destination CDB, RMAN rolls forward the previously restored data files by applying the incremental level 1 backup of the source PDB. If you have created multiple incremental level 1 backups, then RMAN applies the incremental backups in the same order in which the backups were created on the source PDB.
28.2.4.4 Source CDB: Create a Final Incremental Backup of a PDB with Recovery Catalog Connection

Prepare a PDB for the final transport to the destination CDB when RMAN is connected to a recovery catalog.

  1. Connect to the root as a user with the SYSDBA or SYSBACKUP privilege.
  2. Connect to a recovery catalog.
  3. Close the PDB that you want to transport to a destination platform.

    The following command closes the PDB sales_pdb.

    RMAN> ALTER PLUGGABLE DATABASE sales_pdb CLOSE IMMEDIATE;
  4. Create a final incremental level 1 backup of the PDB and unplug the PDB from the source CDB.

    The following statement creates an incremental level 1 backup of the PDB sales_pdb. The PDB is unplugged from the source CDB. The UNPLUG INTO clause specifies the XML file to store the structural metadata of the PDB when it is unplugged from the source CDB. The TAG clause specifies the backup tag that is used to identify the RMAN backup.

    RMAN> BACKUP 
    UNPLUG INTO '/tmp/pdb_dumpfiles/sales_pdb_unplug.xml'
    INCREMENTAL LEVEL 1
    PLUGGABLE DATABASE sales_pdb
    XML BACKUP FORMAT '/tmp/pdb_backups/sales_pdb_unplug.bck'
    TAG 'sales_pdb_plugin_tag';
    In this example, the sales_pdb_unplug.xml file contains the metadata required to plug in the PDB on the destination CDB. The sales_pdb_unplug.bck file contains the backup of the unplug file sales_pdb_unplug.xml.
  5. Make a note of the DBID as displayed by RMAN at start up.
    For example, RMAN outputs a line of the following form when it connects to a target database that is open:
    connected to target database: PROD (DBID=39525561)
28.2.4.5 Destination CDB: Perform the Final Transport of a PDB with Recovery Catalog Connection

As a final step, restore data files from the PDB backup and plug in the PDB to the destination CDB when RMAN is connected to a recovery catalog.

  1. Connect the destination CDB to a recovery catalog.
  2. Use the SET command with the FOREIGN DBID clause to specify the DBID of source PDB.

    The following command sets the DBID of the source PDB:

    RMAN> SET FOREIGN DBID 39525561;

Perform these steps in a single RMAN session to ensure that the in-memory transport list is available for RMAN during the restore operation.

  1. Run the RESTORE... PREVIEW command along with the TO TRANSPORT LIST option to generate an in-memory list of the PDB backups that will be used by RMAN in the restore operation.

    Use the PLUGIN TAG clause to specify the same tag associated with the final incremental level 1 PDB backup created on the source CDB. During the restore operation, RMAN will use the tag to apply the data files from the incremental level 1 backup created with the same tag.

    Use the PLUGGABLE DATABASE command to specify the source PDB.

    The following example generates an in memory transport list of the source PDB backup files which RMAN must transport and restore on the destination CDB.

    RMAN> RESTORE PREVIEW
          TO TRANSPORT LIST
          PLUGIN TAG 'sales_pdb_plugin_tag'
          PLUGGABLE DATABASE 'sales_pdb';
  2. Run this command to clear the foreign database ID.
    RMAN> SET FOREIGN DBID CLEAR;
  3. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege.
  4. Ensure that the destination CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;
  5. Run the RESTORE command with the FOREIGN PLUGGABLE DATABASE clause and the FROM TRANSPORT LIST clause.
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE sales_pdb 
    FORMAT '/oradata/%U' 
    FROM TRANSPORT LIST;
    RMAN rolls forward the previously restored data files using the final incremental level 1 backup, and then plugs in the PDB on the destination CDB.

28.3 Transporting PDBs Across Platforms in NOCATALOG Mode

In the NOCATALOG mode, you must create a transport file to store information about the source PDB backups. Learn the different ways to transport a PDB by using PDB backups and a transport file.

28.3.1 About Transporting PDBs in NOCATALOG MODE

To transport a PDB using PDB backups, RMAN needs to identify the exact backups from the source PDB and then perform a restore operation on the destination CDB.

In the NOCATALOG mode, you must create a transport file on the source CDB. The transport file is an XML format file to store the backup metadata of the PDB you want to transport to a destination CDB. RMAN requires the transport file to restore the data files from backups and plug in a PDB on the destination CDB.

These are the essential steps required to transport a PDB in NOCATALOG mode:

On the source CDB:
  • Use a preexisting level 0 backup or create a new backup using the BACKUP PLUGGABLE DATABASE command.
  • Create a final incremental level 1 backup of the source PDB when the PDB is set to read-only.
    • Use the BACKUP PLUGGABLE DATABASE command to create a final incremental level 1 backup.
    • Use the DATAPUMP clause to create an export dump file along with the incremental backup.
  • On the source CDB, use the RESTORE PREVIEW command along with the TO TRANSPORT FILE clause to create a transport XML file.
  • Use operating system specific utilities to manually copy the transport XML file from the source host to the destination host. Alternatively, store the XML file in a network file system (NFS) path or any shared location accessible to the destination host.

On the destination CDB, perform a single restore operation.

Use the RESTORE command with the FROM TRANSPORT FILE clause and the PLUGGABLE DATABASE clause. RMAN uses the specified transport file to restore the data files from backups, and plug in the PDB on the destination CDB.

Note:

If the Oracle Active Data Guard logical database rolling upgrade process is running on a destination database, then RMAN cannot successfully complete the final step involved in transporting data using backups. This is because the rolling upgrade process restricts RMAN from importing the backup metadata required to restore a final backup and plug in a PDB on to a destination CDB.

28.3.2 Quickly Transport a PDB in NOCATALOG MODE

Oracle recommends this method for transporting small-sized PDBs that take less time to backup.

In this quick transport method, you must create an incremental level 0 backup of the source PDB and an export dump file along with the backup. On the destination platform, perform a single restore operation to restore the data files from the level 0 backup, and plug in the PDB on the destination CDB to complete the PDB transport.

In the NOCATALOG mode, you must generate a transport file to store information about the PDB backups in XML format.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.3.2.1 Source CDB: Preparing to Quickly Transport a PDB in NOCATALOG Mode

Prepare to quickly transport a PDB by using a PDB backup and a transport file.

  1. Connect to the root as a user with the SYSDBA or SYSBACKUP privilege.
  2. Close the PDB that you want to transport to a destination platform.

    The following command closes the PDB hr_pdb.

    RMAN> ALTER PLUGGABLE DATABASE hr_pdb CLOSE IMMEDIATE;
  3. Create an incremental level 0 backup of the PDB and unplug the PDB from the source CDB.

    The following statement creates an incremental level 0 backup of the PDB hr_pdb. The PDB is unplugged from the source CDB. The UNPLUG INTO clause specifies the XML file to store the structural metadata of the PDB when it is unplugged from the source CDB. The TAG clause specifies the backup tag that is used to identify this RMAN backup.

    RMAN> BACKUP 
    UNPLUG INTO '/tmp/pdb_dumpfiles/hr_pdb_metadata.xml'
    INCREMENTAL LEVEL 0
    PLUGGABLE DATABASE hr_pdb
    XML BACKUP FORMAT '/tmp/pdb_backups/hr_pdb_unplug.bck'
    TAG 'hr_pdb_plugin_tag';
    In this example, the hr_pdb_unplug.xml file contains the metadata required to plug in the PDB on the destination CDB. The hr_pdb_unplug.bck file stores the backup of the unplug file hr_pdb_unplug.xml.
  4. On the source CDB, use the RESTORE command with the PREVIEW option and the TO TRANSPORT FILE option to create a transport file. The transport file is an XML file that stores information about backups corresponding to the PDB being transported. RMAN requires the transport XML file to restore data files, roll forward, and plug in the PDB on the destination CDB.

    The following statement creates a transport file named 'hr_pdb_transportfile.xml'. The PLUGIN TAG tag identifies the export dump file corresponding to the source PDB hr_pdb.

    RMAN> RESTORE PREVIEW
    TO TRANSPORT FILE '/tmp/xplat_backups/hr_pdb_transportfile.xml'
    PLUGIN TAG 'hr_pdb_plugin_tag'
    PLUGGABLE DATABASE hr_pdb;
  5. Use operating system specific utilities to manually copy the transport file from the source host to the destination host. Alternatively, store the transport file in a network file system (NFS) path or any shared location accessible to the destination host.
28.3.2.2 Destination CDB: Quickly Restore Data Files and Plug In a PDB in NOCATALOG Mode

Perform a single restore operation to complete the quick transport of a PDB using a PDB backup and a transport file.

  1. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege.
  2. Ensure that the destination CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;
  3. Run the RESTORE command along with the FOREIGN PLUGGABLE DATABASE clause and the FROM TRANSPORT FILE clause.
    In the FROM TRANSPORT FILE clause, specify the transport XML file created on the source host.
    The following example restores the data files from the level 0 backup of the source PDB, and then plugs in the PDB hr_pdb on to a destination CDB. The metadata required for the restore operation is specified using the FROM TRANSPORT FILE clause and stored in the hr_pdb_transportfile.xml file .
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE hr_pdb 
    FORMAT '/oradata/%U' 
    FROM TRANSPORT FILE '/tmp/xplat_backups/hr_pdb_transportfile.xml';
    If you are transporting a PDB using a backup and the PDB unplug XML file backup made in a previous release of Oracle Database, then you must run the RESTORE command to include:
    • The XMLFILE clause to specify that RMAN needs to restore the unplug XML file.
    • The XMLFILE DESTINATION clause to specify the directory where you want to extract and store the PDB unplug XML file on the destination database.
    • The FROM BACKUPSET clause to specify the name of the backup set that contains the PDB unplug XML file.
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE hr_pdb 
    FORMAT '/oradata/%U' 
    FROM TRANSPORT FILE '/tmp/xplat_backups/hr_pdb_transportfile.xml'
    XMLFILE 'hr_pdb_unplug.xml' XMLFILE DESTINATION '/tmp/xplat_backups/'
    FROM BACKUPSET 'hr_pdb_unplug.bck';

    In this example, /tmp/xplat_backups/ is the location specified to extract the unplug XML file hr_pdb_unplug.xml from the backup set hr_pdb_unplug.bck.

28.3.3 Transport a PDB Using a Preexisting PDB Backup and NOCATALOG Mode

Use this procedure to transport a PDB by using a preexisting PDB backup (level 0) and a transport file.

When the source PDB is in read-only mode, you can use RMAN to restore the data files from the most recent preexisting level 0 backup of a PDB, and then plug in the PDB on a destination CDB.

In the NOCATALOG mode, you must perform an additional step to generate a transport file to store information about the source PDB backups in XML format.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.3.3.1 Source CDB: Preparing to Transport a PDB Using a Preexisting Backup and NOCATALOG Mode

Transport a PDB using a most recent preexisting backup of a PDB and a transport file.

  1. Connect to the root as a user with the SYSDBA or SYSBACKUP privilege.
  2. Close the PDB that you want to transport to a destination platform.

    The following command closes the PDB hr_pdb.

    RMAN> ALTER PLUGGABLE DATABASE hr_pdb CLOSE IMMEDIATE;
  3. Create a final incremental level 1 backup of the PDB and unplug the PDB from the source CDB.

    The following statement creates an incremental level 1 backup of the PDB hr_pdb. The PDB is unplugged from the source CDB. The UNPLUG INTO clause specifies the XML file to store the structural metadata of the PDB when it is unplugged from the source CDB. The TAG clause specifies the backup tag that is used to identify this RMAN backup.

    RMAN> BACKUP 
    UNPLUG INTO '/tmp/pdb_dumpfiles/hr_pdb_unplug.xml'
    INCREMENTAL LEVEL 1
    PLUGGABLE DATABASE hr_pdb
    XML BACKUP FORMAT '/tmp/pdb_backups/hr_pdb_unplug.bck'
    TAG 'hr_pdb_plugin_tag';
    In this example, the hr_pdb_unplug.xml file contains the metadata required to plug in the PDB on the destination CDB. The hr_pdb_unplug.bck file stores the backup of the unplug file hr_pdb_unplug.xml.
  4. On the source database, use the RESTORE command with the PREVIEW option and the TO TRANSPORT FILE option to create a transport file. The transport file is an XML file to store information about backups corresponding to the PDB being transported.

    The following statement creates a transport file named hr_pdb_transportfile.xml. The plug in tag identifies the export dump file corresponding to the source PDB hr_pdb.

    RMAN> RESTORE PREVIEW
    TO TRANSPORT FILE '/tmp/xplat_backups/hr_pdb_transportfile.xml'
    PLUGIN TAG 'hr_pdb_plugin_tag'
    PLUGGABLE DATABASE hr_pdb;
  5. Use operating system specific utilities to manually copy the transport file from the source host to the destination host. Alternatively, store the transport file in a network file system (NFS) path or any shared location accessible to the destination host.
28.3.3.2 Destination CDB: Restore Data Files From a Preexisting Backup and Plug In a PDB in NOCATALOG Mode

Use a transport file to restore data files from PDB backups and plug in a PDB on the destination CDB.

  1. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege.
  2. Ensure that the CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;
  3. Run the RESTORE command with the FOREIGN PLUGGABLE DATABASE clause and the FROM TRANSPORT FILE clause.
    In the FROM TRANSPORT FILE clause, specify the transport XML file created on the source host.
    In the following example, RMAN restores the data files from the most recent preexisting level 0 backup of the source PDB, rolls forward the restored data files by applying the incremental level 1 backup, and then plugs in the PDB hr_pdb on to a destination CDB. The metadata required for the restore operation is specified using the FROM TRANSPORT FILE clause and stored in the hr_pdb_transportfile.xml file .
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE hr_pdb 
    FORMAT '/oradata/%U' 
    FROM TRANSPORT FILE '/tmp/xplat_backups/hr_pdb_transportfile.xml';
    If you are transporting a PDB using a backup and a unplug XML file made in a previous release of Oracle Database, then you must run the RESTORE command to include:
    • The XMLFILE clause to specify that RMAN needs to restore the unplug XML file.
    • The XMLFILE DESTINATION clause to specify the directory where you want to extract and store the PDB unplug XML file on the destination database.
    • The FROM BACKUPSET clause to specify the name of the backup set that contains the PDB unplug XML file.
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE hr_pdb 
    FORMAT '/oradata/%U' 
    FROM TRANSPORT FILE '/tmp/xplat_backups/hr_pdb_transportfile.xml'
    XMLFILE 'hr_pdb_unplug.xml' XMLFILE DESTINATION '/tmp/xplat_backups/'
    FROM BACKUPSET 'hr_pdb_unplug.bck';

    In this example, /tmp/xplat_backups/ is the location specified to extract the unplug XML file hr_pdb_unplug.xml from the backup set hr_pdb_unplug.bck.

28.3.4 Transport a PDB Using Multiple Incremental Backups In NOCATALOG Mode

Oracle recommends this method for transporting large size PDBs across platforms with minimum application downtime on the source PDB.

On the destination CDB, you must first restore the data files from a preexisting backup or new backup of the PDB. You can then roll forward the restored data files by applying multiple incremental level 1 backups periodically. While the source PDB remains open and operational, you can continue to apply any number of incremental level 1 backups on the destination CDB until you want to perform the final transport of the PDB.

In the NOCATALOG mode, you must create a transport file to store the information about the source PDB backups in XML format.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.3.4.1 Source CDB: Creating a Base Incremental Backup of a PDB

Use a preexisting level 0 backup or create a new backup of the source PDB.

  1. On the source CDB, connect to the root as a user with the SYSDBA or SYSBACKUP privilege.
  2. If you want leverage a preexisting incremental level 0 backup of the PDB, then proceed to step 3.
    Alternatively, use the BACKUP PLUGGABLE DATABASE command to create an incremental level 0 backup of the PDB you want to transport to a destination CDB.

    The following statement creates an incremental level 0 backup of the PDB sales_pdb:

    RMAN> BACKUP
    INCREMENTAL LEVEL 0
    PLUGGABLE DATABASE sales_pdb;
  3. Use the BACKUP PLUGGABLE DATABASE command to create an incremental level 1 backup of the PDB.
    The following statement creates an incremental level 1 backup of the PDB sales_pdb:
    RMAN> BACKUP
    INCREMENTAL LEVEL 1
    PLUGGABLE DATABASE sales_pdb;
  4. On the source database, use the RESTORE command with the PREVIEW option and the TO TRANSPORT FILE option to create a transport file. The transport file is an XML file created to store information about the backups corresponding to the PDB being transported.
    The following statement creates a transport file named sales_pdb_transportfile.xml
    RMAN> RESTORE PREVIEW
    TO TRANSPORT FILE '/tmp/xplat_backups/sales_pdb_transportfile.xml'
    PLUGGABLE DATABASE sales_pdb;
  5. Use operating system specific utilities to manually copy the transport file from the source host to the destination host. Alternatively, store the transport file in a network file system (NFS) path or any shared location accessible to the destination host.
28.3.4.2 Step 2: (Destination CDB) Restore Data Files From a Base Incremental Backup of a PDB in NOCATALOG Mode

On the destination CDB, the level 0 backup serves as a basis for RMAN to restore the data files from subsequent increment level 1 backups of the PDB.

  1. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege.
  2. Ensure that the CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;
  3. Run the RESTORE command with the FOREIGN PLUGGABLE DATABASE clause and the FROM TRANSPORT FILE clause.

    For example, the following statement restores the data files from the incremental level 0 backup of the PDB sales_pdb:

    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE sales_pdb
    FORMAT '/oradata/%U'
    FROM TRANSPORT FILE '/tmp/xplat_backups/sales_pdb_transportfile.xml';
28.3.4.3 Step 3: Restore Data Files Using Incremental Backups of a PDB in NOCATALOG Mode

On the destination CDB, you can periodically apply incremental level 1 backups to roll forward the base backup until you want to perform the final transport of the PDB.

While the source PDB remains open, you can create incremental level 1 backups of the source PDB and then perform a restore operation on the destination CDB. This method minimizes the application downtime and helps to reduce the amount of changed data that needs to be applied to the destination database when you perform the final transport of the PDB.

There is no restriction on the number of times you can repeat this procedure. When you are ready to perform the final transport of the PDB, proceed to Step 4: (Source CDB) Create a Final Incremental Backup of a PDB in NOCATALOG Mode.

In the NOCATALOG mode, you must create a transport file on the source host, and then use the transport file to perform a restore operation on the destination host.

On the source CDB, create an incremental level 1 backup of the PDB

  1. Connect to the root as a user with the SYSDBA or SYSBACKUP privilege.
  2. On the source CDB, use the BACKUP PLUGGABLE DATABASE command to create a incremental level 1 backup of the PDB.

    The following statement creates an incremental level 1 backup of the PDB sales_pdb:

    RMAN> BACKUP
    INCREMENTAL LEVEL 1
    PLUGGABLE DATABASE sales_pdb;
  3. On the source PDB, use the RESTORE command with the PREVIEW option and the TO TRANSPORT FILE option to create a transport file. The transport file is an XML file created to store information about the backups corresponding to the PDB being transported.
    The following statement creates a transport file named hr_pdb_transportfile.xml
    RMAN> RESTORE PREVIEW
    TO TRANSPORT FILE '/tmp/xplat_backups/sales_pdb_transportfile.xml'
    PLUGGABLE DATABASE sales_pdb;
  4. Use operating system specific utilities to manually copy the transport file from the source host to the destination host. Alternatively, store the transport file in a network file system (NFS) path or any shared location accessible to the destination host.

On the destination CDB, restore the data files from the PDB backup

  1. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege.
  2. Ensure that the destination CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;
  3. Run the RESTORE command with the FOREIGN PLUGGABLE DATABASE clause and the FROM TRANSPORT FILE clause.

    In the following example, RMAN rolls forward the previously restored data files by applying the incremental level 1 backup of the source PDB sales_pdb. If you have created multiple incremental level 1 backups, RMAN applies the incremental backups in the same order in which they were created on the source PDB.

    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE sales_pdb
    FORMAT '/oradata/%U'
    FROM TRANSPORT FILE '/tmp/xplat_backups/hr_pdb_transportfile.xml';
28.3.4.4 Step 4: (Source CDB) Create a Final Incremental Backup of a PDB in NOCATALOG Mode

Use this procedure to create a final incremental level 1 backup and an export dump file along with the backup to prepare a source PDB for the final transport.

  1. Connect to the root as a user with the SYSDBA or SYSBACKUP privilege.
  2. Close the PDB that you want to transport to the destination CDB.

    The following command closes the PDB sales_pdb.

    RMAN> ALTER PLUGGABLE DATABASE sales_pdb CLOSE IMMEDIATE;
  3. Create a final incremental level 1 backup of the PDB and unplug the PDB from the source CDB.

    The following statement creates an incremental level 1 backup of the PDB sales_pdb, and also creates an unplug backup.

    RMAN> BACKUP 
    UNPLUG INTO '/tmp/pdb_dumpfiles/sales_pdb_unplug.xml'
    INCREMENTAL LEVEL 1
    PLUGGABLE DATABASE sales_pdb
    XML BACKUP FORMAT '/tmp/pdb_backup/sales_pdb_unplug.bck'
    TAG 'sales_pdb_plugin_tag';
  4. Use the RESTORE command with the PREVIEW option and the TO TRANSPORT FILE option to create a transport file. The transport file is an XML file to store information about the backups corresponding to the PDB being transported.
    The following statement creates a transport file named sales_pdb_transportfile.xml
    RMAN> RESTORE PREVIEW
    TO TRANSPORT FILE '/tmp/xplat_backups/sales_pdb_transportfile.xml'
    PLUGIN TAG 'sales_pdb_plugin_tag'
    PLUGGABLE DATABASE sales_pdb;
  5. Use operating system specific utilities to manually copy the transport file from the source host to the destination host. Alternatively, store the transport file in a network file system (NFS) path or any shared location accessible to the destination host.
28.3.4.5 Step 5: (Destination CDB) Perform the Final Transport of a PDB in NOCATALOG Mode

As a final step, use the transport file to restore the data files from PDB backups, and plug in the PDB to the destination CDB.

Use operating system utilities to copy the transport XML file to a network file system (NFS), or shared location that is accessible to the destination CDB.
  1. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege.
  2. Ensure that the destination CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;
  3. Run the RESTORE command with the FOREIGN PLUGGABLE DATABASE clause and the FROM TRANSPORT FILE clause. RMAN restores the data files from the final incremental level 1 backup, rolls forward, and plugs in the PDB on the destination CDB.
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE sales_pdb 
    FORMAT '/oradata/%U' 
    FROM TRANSPORT FILE '/tmp/xplat_backups/sales_pdb_transportfile.xml'
    If you are transporting a PDB using a backup and a unplug XML file made in a previous release of Oracle Database, then you must run the RESTORE command to include:
    • The XMLFILE clause to specify that RMAN needs to restore the unplug XML file.
    • The XMLFILE DESTIANTION clause to specify the directory where you want to extract and store the PDB unplug XML file on the destination database.
    • The FROM BACKUPSET clause to specify the name of the backup set that contains the PDB unplug XML file.
    RMAN> RESTORE
    FOREIGN PLUGGABLE DATABASE hr_pdb 
    FORMAT '/oradata/%U' 
    FROM TRANSPORT FILE '/tmp/xplat_backups/hr_pdb_transportfile.xml'
    XMLFILE 'hr_pdb_unplug.xml' XMLFILE DESTINATION '/tmp/xplat_backups/'
    FROM BACKUPSET 'hr_pdb_unplug.bck';

    In this example, /tmp/xplat_backups/ is the location specified to extract the unplug XML file hr_pdb_unplug.xml from the backup set hr_pdb_unplug.bck.

28.4 Transporting Pluggable Databases Over the Network

RMAN enables you to transport pluggable databases from one platform to another platform using the network.

28.4.1 About Transporting PDBs Over the Network

RMAN can use the network to connect to a source PDB, create a backup of a PDB, transfer the source data files optimally over the network, and then restore the data files from backups on the destination CDB. RMAN also plugs in the a PDB on the destination CDB.

To transport a PDB through the network, RMAN uses the RESTORE command along with the FROM SERVICE clause, the FOREIGN PLUGGABLE DATABASE clause, and the PLUGIN DBLINK clause.

You use the RECOVER command to periodically roll forward the incremental backups of the PDB on the destination CDB. The source PDB can remain open and operational until you want to perform a final step to roll forward the final incremental backup and plug in the PDB on the destination CDB.

These are the essential steps required to transport a PDB from a source platform to a destination platform over the network:

On the destination database:
  • Run the RESTORE command along with the FOREIGN PLUGGABLE DATABASE clause and the FROM SERVICE clause. RMAN transfers an incremental level 0 backup of the source PDB and restores the data files on the destination CDB.
  • You can optionally run the RECOVER command along with the FOREIGN PLUGGABLE DATABASE clause and the FROM SERVICE clause. RMAN applies incremental level 1 backups of the source PDB and rolls forward the PDB backup on the destination CDB.
  • Before you perform a final restore of the PDB on a destination CDB, you must use SQL*PLUS to create a database link or dblink on the destination CDB. The dblink is required for RMAN to transport the export dump file or the PDB unplug file from the source host to the destination host.
  • When the source PDB is in read-only mode, use the RECOVER command with the FOREIGN PLUGGABLE DATABASE clause, the FROM SERVICE clause, and the PLUGIN DBLINK clause to recover the data files using the final incremental backup of the PDB, and then plug in the PDB on the destination CDB.

Note:

If the Oracle Active Data Guard logical database rolling upgrade process is running on a destination database, then RMAN cannot successfully complete the final step involved in transporting data using backups. This is because the rolling upgrade process restricts RMAN from importing the backup metadata required to restore a final backup and plug in a PDB on to a destination CDB.

28.4.2 Quickly Transport a Pluggable Database Over the Network

Transport a PDB by restoring the data files from a level 0 backup of a PDB over the network. Oracle recommends this method for transporting small-sized PDBs that take less time to backup.

  1. Perform these steps on a source CDB:
    1. Connect to the root as a user with the SYSDBA or SYSBACKUP privilege.
    2. Close the PDB that you want to transport to a destination database.
      The following statement closes the PDB hr_pdb:
      RMAN> ALTER PLUGGABLE DATABASE hr_pdb CLOSE IMMEDIATE;
  2. Perform these steps on the destination database.
    1. Use the CONNECT TARGET command to connect to the destination CDB as a user with the SYSDBA or SYSBACKUP privilege
    2. Ensure that the CDB is open in read-write mode.
      The following command displays the current mode of the CDB:
      RMAN> SELECT open_mode FROM V$DATABASE;
    3. Before you perform the final restore operation, use SQL*PLUS to create a database link on the destination CDB. In the network-based transport method, the dblink is used to transport the export dump file or the PDB unplug XML file from the source database to the destination database.

      Use the SQL*PLUS CREATE DATABASE LINK statement to create a PUBLIC dblink.

      For example, in the following statement, user rco on the destination database defines a database link called hrpdbpluginlink that refers to the pluggable database pdb1 on the CDB cdb1.
      CREATE PUBLIC DATABASE LINK hrpdbpluginlink CONNECT TO rco IDENTIFIED BY password USING 'cdb1_pdb1'
    4. Perform a single restore operation which enables RMAN to connect to the source CDB, transfer the data files over the network to the destination host, and then restore the data files on to the destination CDB. RMAN also plugs in the PDB on to the destination CDB.
      Use the FOREIGN PLUGGABLE DATABASE command to specify the name of the PDB on the source database.
      Use the FROM SERVICE clause to specify the service name of the source CDB.
      Optionally, use the PLUGIN FILE clause to specify a file name and location to store the structural metadata of the PDB when it is unplugged from the source CDB.
      Use the PLUGIN DBLINK clause to specify the database link to access the destination database.
      The following statement restores the data files from a level 0 backup of the PDB hr_pdb from a source database with the service name source_db. The PLUGIN FILE clause specifies that the structural metadata of the PDB must be stored in the location /tmp/pdb_dumpfiles/hr_pdb_metadata.xml. The PLUGIN DBLINK specifies the database link hrpdbpluginlink created on the destination database.
      RMAN> RESTORE 
      FOREIGN PLUGGABLE DATABASE 'hr_pdb' 
      FORMAT 'hrpdb%f.f' 
      FROM SERVICE 'source_db' 
      PLUGIN FILE '/tmp/pdb_dumpfiles/hr_pdb_metadata.xml'
      PLUGIN DBLINK 'hrpdbpluginlink';

28.4.3 Transport a Pluggable Database by Restoring Backups Incrementally Over the Network

Use the network to restore data files from a level 0 backup of a PDB, and then recover the restored data files on the destination CDB.

  1. Open RMAN and connect as TARGET to a destination database as a user with the SYSDBA or SYSBACKUP privilege.
  2. Ensure that the destination CDB is open in read-write mode.
    The following command displays the current mode of the CDB:
    RMAN> SELECT open_mode FROM V$DATABASE;
  3. On the destination CDB, perform a restore operation. RMAN restores data files from a level 0 backup of the source PDB.
    RMAN connects to the source CDB, creates the required backups, transfers the data files over the network to the destination host, and then restores the data files on the destination CDB. The first backup is always an incremental level 0 backup that serves as a base to apply subsequent incremental level 1 backups.
    Run the RESTORE command with the FOREIGN PLUGGABLE DATABASE clause to specify the name of the source PDB.
    Use the FROM SERVICE clause to specify the service name of the source CDB.
    The following statement restores the data files of a PDB hr_pdb from a source database with the service name source_db.
    RMAN> RESTORE 
    FOREIGN PLUGGABLE DATABASE 'hr_pdb' 
    FORMAT 'hr_pdb%f.f' 
    FROM SERVICE 'source_db'; 
    

While the source PDB remains open, you can periodically perform recover operations on the destination CDB. The RECOVER command enables RMAN to roll forward the previously restored data files by applying incremental level 1 backups of the source PDB. There is no restriction on the number of times you can perform the recover operation until you want to perform the final transport of the PDB.

  1. Run the RECOVER command along with the FOREIGN PLUGGABLE DATABASE clause to specify the name of the PDB on the source database.
    Use the FROM SERVICE clause to specify the service name of the source CDB.
    The following statement recovers the data files for the PDB hr_pdb from a source database with the service name source_db.
    RMAN> RECOVER 
    FOREIGN PLUGGABLE DATABASE 'hr_pdb' 
    FORMAT 'pdb1%f.f' 
    FROM SERVICE 'source_db';
  2. Before you perform the final recover operation, use SQL*Plus to create a database link on the destination CDB. In the network-based transport method, the dblink is required for RMAN to transport the export dump file or the PDB unplug XML file from the source database to the destination database.

    Use the SQL*PLUS CREATE DATABASE LINK statement to create a PUBLIC dblink.

    For example, in the following statement, user rco on the destination database defines a database link called hrpdbpluginlink that refers to the pluggable database pdb1 on the CDB cdb1.
    CREATE PUBLIC DATABASE LINK hrpdbpluginlink CONNECT TO rco IDENTIFIED BY password USING 'cdb1_pdb1'
  3. When the source PDB is in read-only mode, you can recover the data files using a final incremental backup of the PDB, and plug-in the PDB on to the destination CDB.
    Run the RECOVER command with the FOREIGN PLUGGABLE DATABASE clause to specify the name of the source PDB.
    Use the FROM SERVICE clause to specify the service name of the source CDB.
    Optionally, use the PLUGIN FILE clause to specify a file name and location to store the structural metadata of the PDB when it is unplugged from the source CDB.
    Use the PLUGIN DBLINK clause to specify the database link required to access the destination database.
    The following statement recovers the data files from the final incremental level 1 backup of the PDB hr_pdb from a source database with the service name source_db. The PLUGIN FILE clause specifies that the structural metadata of the PDB must be stored in the location /tmp/pdb_dumpfiles/hr_pdb_metadata.xml. The PLUGIN DBLINK specifies the database link hrpdbpluginlink created on the destination database.
    RMAN> RECOVER 
    FOREIGN PLUGGABLE DATABASE 'hr_pdb' 
    FORMAT 'hrpdb%f.f' 
    FROM SERVICE 'source_db' 
    PLUGIN FILE '/tmp/pdb_dumpfiles/hr_pdb_metadata.xml'
    PLUGIN DBLINK 'hrpdbpluginlink'; 
    
    RMAN connects to the source CDB, transfers the data files over the network to the destination CDB, recovers the data files from the final incremental backup, and then plugs in the PDB on to the destination CDB.

28.5 Transporting Tablespaces with Recovery Catalog Connection

Learn the different ways in which you can transport a tablespace by using a backup of the tablespace when RMAN is connected to a recovery catalog.

28.5.1 About Transporting Tablespaces with a Recovery Catalog

RMAN can transport a tablespace by restoring the data files from a tablespace backup when RMAN is connected to a recovery catalog.

RMAN queries the metadata stored in the recovery catalog to determine the exact backups required for the restore operation on a destination database.

These are the essential steps you need to perform to transport a tablespace when RMAN is connected to the recovery catalog:

On the source database:
  • Connect RMAN to a recovery catalog
  • Use a preexisting backup of the tablespace or create a new backup using the BACKUP TABLESPACE command
  • Create a final incremental level 1 backup of the tablespace when the tablespace is in read-only mode.
    • Use the BACKUP TABLESPACE command to create a final incremental level 1 backup
    • Use the DATAPUMP clause to create an export dump file along with the incremental backup

On the destination database:

  • Connect RMAN to the same recovery catalog as the source database
  • Use the SET command along with the FOREIGN DBID clause to set the DBID of the source PDB
  • Use the RESTORE command along with the PREVIEW clause and the TO TRANSPORT LIST clause to generate a transport list. The transport list remains in-memory and indicates the tablespace backups required by RMAN to perform the restore operation on the destination database
  • Use the RESTORE command with the FROM TRANSPORT LIST clause to perform a restore operation using the transport list. RMAN restores the data files from the tablespace backups, and plugs in the tablespace on the destination database.

Note:

If the Oracle Active Data Guard logical database rolling upgrade process is running on a destination database, then RMAN cannot successfully complete the final step involved in transporting data using backups. This is because the rolling upgrade process restricts RMAN from importing the backup metadata required to restore a final backup and plug in a tablespace or a PDB on to a destination database.

28.5.2 Quickly Transport a Tablespace with Recovery Catalog Connection

Oracle recommends this method for transporting small sized tablespaces that take less time to backup.

In this quick transport method, you create an incremental level 0 backup of the source tablespace and an export dump file along with the backup. You must then restore the data files from the tablespace backup, and plug in the tablespace on the destination database.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.5.2.1 Source Database: Preparing to Quickly Transport a Tablespace with Recovery Catalog Connection

When the source tablespace is in read-only mode, create an incremental level 0 backup and an export dump file along with the backup.

  1. Connect to the source database from which you need to transport tablespaces as TARGET.

    For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablepaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.

    In this example, sbu is a user who is granted the SYSBACKUP privilege on the source database prod_source.

    RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
    

    Enter the password for the sbu user when prompted.

  2. Connect to a recovery catalog.
  3. Place the tablespace in read-only mode.

    The following command places the tablespace mf_tbs in read-only mode.

    ALTER TABLESPACE mf_tbs READ ONLY;
    
  4. Use the BACKUP TABLESPACE command to create a incremental level 0 backup of the tablespace you want to transport to the destination platform.
    Use the DATAPUMP clause to indicate that an export dump file must be created. The export dump file contains the metadata required to plug the tablespace on the destination database.

    The following statement creates a incremental level 0 backup and an export dump file for the tablespace mf_tbs.

    RMAN> BACKUP
    INCREMENTAL LEVEL 0
    TABLESPACE mf_tbs
    FORMAT '/tmp/xplat_backups/mf_tbs_incr.bck'
    DATAPUMP FORMAT 'pump.dmp'
    TAG 'mf_plugin_tag';
    

    In this example, the mf_tbs_incr.bck file stores the incremental backup. The pump.dmp file stores the export dump file backup.

  5. Make a note of the source DBID as displayed by RMAN.
    For example, RMAN outputs a line of the following form when it connects to a target database that is open:
    connected to target database: PROD (DBID=699892390)
28.5.2.2 Destination Database: Restore and Plug In a Tablespace with Recovery Catalog Connection

Perform the final steps required to quickly transport a tablespace to a destination database when RMAN is connected to a recovery catalog.

  1. Connect to a recovery catalog.
  2. Use the SET command with the FOREIGN DBID option to specify the database identifier or DBID of the source database containing the tablespace backup you want to use for the restore operation.
    The following command sets the foreign DBID to 699892390, which is the DBID of the source database containing the tablespace mf_tbs whose backups are being restored:
    RMAN> SET FOREIGN DBID 699892390;

Perform these steps in a single RMAN session to ensure that the in-memory transport list is available for RMAN during the restore operation.

  1. Use the RESTORE command with the PREVIEW option and the TO TRANSPORT LIST clause to create an in-memory list of backups required by RMAN for the restore operation. The results of the RESTORE PREVIEW operation remains in-memory.
    Use the PLUGIN TAG to specify the tag applied to the data pump export dump file backup created on the source host. During the restore operation, RMAN uses the specified tag to uniquely identify the metadata corresponding to the tablespace that needs to be transported to the destination host.
    Use the TABLESPACE command to specify the tablespace name.
    The following example creates an in-memory transport list using the backups of the source tablespace mf_tbs. RMAN requires the transport list to restore the data files on the destination host.
    RMAN> RESTORE PREVIEW
    TO TRANSPORT LIST
    PLUGIN TAG 'mf_plugin_tag'
    TABLESPACE mf_tbs;
  2. Run this command to clear the current setting of the foreign database ID.
    RMAN> SET FOREIGN DBID CLEAR;
  3. Use the CONNECT TARGET command to connect to the destination database as a user with the SYSDBA or SYSBACKUP privilege.
  4. Run the RESTORE command with the FOREIGN TABLESPACE option and the TO TRANSPORT LIST clause.
    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT LIST;
    RMAN restores the data files from the level 0 backup of the tablespace mf_tbs, and then plugs in the tablespace on the destination database.

28.5.3 Transport a Tablespace Using a Preexisting Tablespace Backup and Recovery Catalog

RMAN enables you to easily transport a tablespace by leveraging a preexisting tablespace backup that is available as part of your regular backup schedule.

When a source tablespace is in read-only mode, you can create a final incremental level 1 backup of the tablespace and an export dump file along with the incremental backup.

On the destination database, you can perform a single restore operation to transport the tablespace. RMAN first restores the data files from a preexisting level 0 backup of the tablespace. During the same restore operation, RMAN rolls forward the restored data files by applying the final incremental level 1 backup, and then plugs in the tablespace on the destination database.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.5.3.1 Source Database: Preparing to Transport a Tablespace by Using a Preexisting Backup and Recovery Catalog

Use a most recent backup of a tablespace to transport the tablespace to a destination database.

  1. Connect to the source database from which you need to transport tablespaces as TARGET.

    For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablepaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.

    In this example, sbu is a user who is granted the SYSBACKUP privilege on the source database prod_source.

    RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
    

    Enter the password for the sbu user when prompted.

  2. Connect to a recovery catalog.
  3. Place the tablespace in read-only mode.

    The following command places the tablespace mf_tbs in read-only mode.

    ALTER TABLESPACE mf_tbs READ ONLY;
    
  4. Create a final incremental level 1 backup of the tablespace that you want to transport to a destination platform.
    Use the DATAPUMP clause to generate an export dump file along with the tablespace backup. The export dump file contains the metadata required to plug in restored tablespaces on the destination database.

    The following statement creates a incremental level 1 backup and an export dump file for the tablespace mf_tbs.

    RMAN> BACKUP
    INCREMENTAL LEVEL 1
    TABLESPACE mf_tbs
    FORMAT '/tmp/xplat_backups/mf_tbs_incr.bck'
    DATAPUMP FORMAT 'pump.dmp'
    TAG 'mf_plugin_tag';
    

    In this example, the mf_tbs_incr.bck file stores the incremental backup. The pump.dmp file stores the export dump file backup.

  5. Make a note of the source DBID as displayed by RMAN.
    For example, RMAN outputs a line of the following form when it connects to a target database that is open:
    connected to target database: PROD (DBID=699892390)
28.5.3.2 Destination Database: Restore Backup and Plug In a Tablespace Using Recovery Catalog

Perform a single restore operation to restore the data files from a preexisting backup and to plug in the tablespace to the destination database.

  1. Connect to a recovery catalog.
  2. Use the SET command with the FOREIGN DBID option to specify the database identifier or DBID of the source database containing the tablespace backup you want to use for the restore operation.
    The following command sets the foreign DBID to 699892390, which is the DBID of the source database containing the tablespace mf_tbs whose backups are being restored:
    RMAN> SET FOREIGN DBID 699892390;

Perform these steps in a single RMAN session to ensure that the in-memory transport list is available for RMAN during the restore operation.

  1. Use the RESTORE command with the PREVIEW option and the TO TRANSPORT LIST option to create an in-memory list of backups used by RMAN in the restore operation. The results of the RESTORE PREVIEW operation remains in-memory.
    Use the PLUGIN TAG to specify the tag applied to the data pump export dump file backup created on the source host. During the restore operation, RMAN uses the specified tag to uniquely identify the metadata corresponding to the tablespace that needs to be transported to the destination host.
    Use the TABLESPACE command to specify the tablespace name.
    The following example creates an in-memory transport list of backups which RMAN must use to restore the tablespace mf_tbs on the destination host.
    RMAN> RESTORE PREVIEW
    TO TRANSPORT LIST
    PLUGIN TAG 'mf_plugin_tag'
    FOREIGN TABLESPACE mf_tbs;
  2. Run this command to clear the foreign database ID.
    RMAN> SET FOREIGN DBID CLEAR;
  3. Use the CONNECT TARGET command to connect to the destination database as a user with the SYSDBA or SYSBACKUP privilege.
  4. Run the RESTORE command with the FOREIGN TABLESPACE option and the TO TRANSPORT LIST clause.
    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT LIST;
    RMAN restores the data files from a preexisting level 0 backup of the tablespace, rolls forward the restored data files by applying the incremental level 1 backup, and then plugs in the tablespace on the destination database.

28.5.4 Transport a Tablespace Using Multiple Incremental Backups and Recovery Catalog

Oracle recommends this method for transporting large tablespaces across platforms.

On the destination database, you must first restore the data files from a preexisting backup or a new backup of the tablespace. You can then roll forward the restored data files by applying multiple incremental level 1 backups periodically. The source tablespace can remain open for writes while you apply any number of incremental level 1 backups on the destination database. The application downtime begins only when you create the final incremental backup.

This method helps to improve database availability while transporting large tablespaces.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.5.4.1 Source Database: Preparing to Transport a Tablespace by Creating a Base Incremental Backup

RMAN needs to first restore a level 0 backup of the tablespace on the destination database. The level 0 backup serves as a basis for subsequent incremental level 1 backups.

  1. Connect to the source database from which you need to transport tablespaces as TARGET.

    For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablepaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.

    In this example, sbu is a user who is granted the SYSBACKUP privilege on the source database prod_source.

    RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
    

    Enter the password for the sbu user when prompted.

  2. Connect to a recovery catalog.
  3. Perform one of the following steps:
    • If you want to leverage a preexisting level 0 backup of the tablespace, then create an incremental level 1 backup to include all the latest changes that occurred in the tablespace since the level 0 backup was taken.

      The following statement creates an incremental level 1 backup of the tablespace mf_tbs:

      RMAN> BACKUP
      INCREMENTAL LEVEL 1
      TABLESPACE 'mf_tbs';
    • Alternatively, create a level 0 backup of the tablespace.

      The following statement creates an incremental level 0 backup of the tablespace mf_tbs:

      RMAN> BACKUP
      INCREMENTAL LEVEL 1
      TABLESPACE 'mf_tbs';
  4. Make a note of the source DBID as displayed by RMAN.
    For example, RMAN outputs a line of the following form when it connects to a target database that is open:
    connected to target database: PROD (DBID=699892390)
28.5.4.2 Destination Database: Restore Data Files From a Base Incremental Level 0 Backup of a Tablespace with Recovery Catalog

On the destination database, restore data files from the level 0 incremental backup of the tablespace created on the source database. The level 0 backup serves as a basis for RMAN to roll forward the data files with subsequent increment level 1 backups of the tablespace.

  1. Connect to a recovery catalog.
  2. Use the SET command with the FOREIGN DBID option to specify the database identifier or DBID of the source database containing the tablespace backup you want to use for the restore operation.
    The following command sets the foreign DBID to 699892390, which is the DBID of the source database containing the tablespace mf_tbs whose backups are being restored:
    RMAN> SET FOREIGN DBID 699892390;

Perform these steps in a single RMAN session to ensure that the in-memory transport list is available for RMAN during the restore operation.

  1. Use the RESTORE command with the PREVIEW option and the TO TRANSPORT LIST option to create an in-memory list of backups used by RMAN in the restore operation. The results of the RESTORE PREVIEW operation remains in-memory.
    Use the TABLESPACE command to specify the tablespace name.
    The following example creates an in-memory transport list of backups which RMAN must use to restore the tablespace mf_tbs on the destination host.
    RMAN> RESTORE PREVIEW
    TO TRANSPORT LIST
    FOREIGN TABLESPACE mf_tbs;
  2. Run this command to clear the foreign database ID.
    RMAN> SET FOREIGN DBID CLEAR;
  3. Use the CONNECT TARGET command to connect to the destination database as a user with the SYSDBA or SYSBACKUP privilege.
  4. Run the RESTORE command with the FOREIGN TABLESPACE option and the TO TRANSPORT LIST clause.
    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FROM TRANSPORT LIST;
    RMAN first restores the data files from the level 0 backup of the tablespace and then rolls forward the data files by applying the incremental level 1 backup.
28.5.4.3 Create and Restore Incremental Backups of a Tablespace with Recovery Catalog

On the destination database, you can periodically roll-forward the previously restored data files to keep the data in-sync with the source tablespace.

Performing frequent incremental backups when the tablespaces are in read/write mode is advantageous because this reduces the amount of changed data that needs to be applied to the destination database using the final incremental backup that is taken when the tablespace is read-only. There is no restriction on the number of incremental level 1 backups you can apply on the destination database.

On the source database, create an incremental level 1 backup of the tablespace

  1. Connect to the source database from which you need to transport tablespaces as TARGET.

    For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablepaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.

    In this example, sbu is a user who is granted the SYSBACKUP privilege on the source database prod_source.

    RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
    

    Enter the password for the sbu user when prompted.

  2. Connect to a recovery catalog.
  3. On the source database, use the INCREMENTAL LEVEL 1 clause in the BACKUP TABLESPACE command to create a incremental level 1 backup of the tablespace you want to transport to a destination platform.

    The following statement creates an incremental level 1 backup of the tablespace mf_tbs:

    RMAN> BACKUP
    INCREMENTAL LEVEL 1
    TABLESPACE mf_tbs;
  4. Make a note of the source DBID as displayed by RMAN.
    For example, RMAN outputs a line of the following form when it connects to a target database that is open:
    connected to target database: PROD (DBID=699892390)

On the destination database, restore data files using the incremental level 1 backup of the tablespace

  1. Connect to a recovery catalog.
  2. Use the SET command with the FOREIGN DBID option to specify the database identifier or DBID of the source database containing the tablespace backup you want to use for the restore operation.
    The following command sets the foreign DBID to 699892390, which is the DBID of the source database containing the tablespace mf_tbs whose backups are being restored:
    RMAN> SET FOREIGN DBID 699892390;

Perform these steps in a single RMAN session to ensure that the in-memory transport list is available for RMAN during the restore operation.

  1. Use the RESTORE command with the PREVIEW option and the TO TRANSPORT LIST option to create an in-memory list of backups used by RMAN in the restore operation. The results of the RESTORE PREVIEW operation remains in-memory.
    Use the TABLESPACE command to specify the tablespace name.
    The following example creates an in-memory transport list of backups which RMAN must use to restore the tablespace mf_tbs on the destination host.
    RMAN> RESTORE PREVIEW
    TO TRANSPORT LIST
    FOREIGN TABLESPACE mf_tbs;
  2. Run this command to clear the foreign database ID.
    RMAN> SET FOREIGN DBID CLEAR;
  3. Use the CONNECT TARGET command to connect to the destination database as a user with the SYSDBA or SYSBACKUP privilege.
  4. Run the RESTORE command with the FOREIGN TABLESPACE option and the TO TRANSPORT LIST clause.
    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FROM TRANSPORT LIST;
    RMAN rolls forward the previously restored data files by applying the incremental level 1 backup of the tablespace mf_tbs.
28.5.4.4 Source Database: Create a Final Incremental Backup of a Tablespace with Recovery Catalog

Prepare a tablespace for the final transport to the destination database when RMAN is connected to a recovery catalog.

  1. Connect to the source database from which you need to transport tablespaces as TARGET.

    For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablepaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.

    In this example, sbu is a user who is granted the SYSBACKUP privilege on the source database prod_source.

    RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
    

    Enter the password for the sbu user when prompted.

  2. Connect to a recovery catalog.
  3. Place the tablespace to be transported in read-only mode.
    The following command places the tablespace mf_tbs in read-only mode.
    ALTER TABLESPACE mf_tbs READ ONLY;
  4. Create a final incremental level 1 backup of the tablespace that is being transported to a destination platform.
    Use the DATAPUMP clause to generate an export dump file. The export dump file contains the metadata required to plug in the tablespaces on the destination database.

    The following statement creates a incremental level 1 backup and an export dump file for the tablespace mf_tbs.

    RMAN> BACKUP
    INCREMENTAL LEVEL 1
    TABLESPACE mf_tbs
    FORMAT '/tmp/xplat_backups/my_tbs_incr.bck'
    DATAPUMP FORMAT 'pump.dmp'
    TAG 'mf_plugin_tag';
    
  5. Make a note of the source DBID as displayed by RMAN.
    For example, RMAN outputs a line of the following form when it connects to a target database that is open:
    connected to target database: PROD (DBID=699892390)
28.5.4.5 Destination Database: Perform the Final Transport of a Tablespace with Recovery Catalog

Restore the data files from the final incremental backup of the tablespace and then plug in the restored tablespace to the destination database when RMAN is connected to a recovery catalog.

  1. Connect to a recovery catalog.
  2. Use the SET command with the FOREIGN DBID option to specify the database identifier or DBID of the source database containing the tablespace backup you want to use for the restore operation.
    The following command sets the foreign DBID to 699892390, which is the DBID of the source database containing the tablespace mf_tbs whose backups are being restored:
    RMAN> SET FOREIGN DBID 699892390;

Perform these steps in a single RMAN session to ensure that the in-memory transport list is available for RMAN during the restore operation.

  1. Use the RESTORE command with the PREVIEW option and the TO TRANSPORT LIST option to create an in-memory list of backups used by RMAN in the restore operation. The results of the RESTORE PREVIEW operation remains in-memory.
    Use the PLUGIN TAG to specify the tag applied to the data pump export dump file backup created on the source host. During the restore operation, RMAN uses the specified tag to uniquely identify the metadata corresponding to the tablespace that needs to be transported to the destination host.
    Use the TABLESPACE command to specify the tablespace name.
    The following example creates an in-memory transport list of backups which RMAN must use to restore the tablespace mf_tbs on the destination host.
    RMAN> RESTORE PREVIEW
    TO TRANSPORT LIST
    PLUGIN TAG 'mf_plugin_tag'
    FOREIGN TABLESPACE mf_tbs;
  2. Run this command to clear the foreign database ID.
    RMAN> SET FOREIGN DBID CLEAR;
  3. Use the CONNECT TARGET command to connect to the destination database as a user with the SYSDBA or SYSBACKUP privilege.
  4. Run the RESTORE command with the FOREIGN TABLESPACE option and the TO TRANSPORT LIST clause.
    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT LIST;
    RMAN restores the data files from the final incremental level 1 backup and plugs in the tablespace on the destination database.

28.6 Transporting Tablespaces in NOCATALOG Mode

In the NOCATALOG mode, you must create a transport file to store information about the source tablespace backups. Learn the different ways to transport a tablespace by using a backup of the tablespace backup and a transport file.

28.6.1 About Transporting Tablespaces Across Platforms in NOCATALOG Mode

To transport a tablespace using tablespace backups, RMAN needs to identify the exact backups from the source database and then perform a restore operation on the destination database. In the NOCATALOG mode, you must create a transport file on the source database. The transport file is an XML format file to store the backup metadata. RMAN requires the transport file to restore the data files from backups and plug in a tablespace on the destination database.

These are the essential steps required to transport a tablespace in NOCATALOG mode:

On the source database:
  • Use a preexisting level 0 backup of the tablespace or create a new backup using the BACKUP TABLESPACE command.
  • Create a final incremental level 1 backup of the tablespace when the tablespace is in read-only mode:
    • Use the BACKUP TABLESPACE command to create the final incremental level 1 backup.
    • Use the DATAPUMP clause to create an export dump file along with the incremental backup.
  • Use the RESTORE PREVIEW command along with the TO TRANSPORT FILE clause to create a transport XML file.
  • Use operating system utilities to manually copy the transport XML file from the source host to the destination host. Alternatively, store the XML file in a network file system (NFS) path or any shared location accessible to the destination host.

On the destination database, perform a single restore operation using the transport file created on the source database.

Use the RESTORE command with the FROM TRANSPORT FILE clause and the FOREIGN TABLESPACE clause. RMAN restores the data files from the level 0 backup, rolls forward the data files by applying the incremental level 1 backup, and then plugs in the tablespace on the destination database.

Note:

If the Oracle Active Data Guard logical database rolling upgrade process is running on a destination database, then RMAN cannot successfully complete the final step involved in transporting data using backups. This is because the rolling upgrade process restricts RMAN from importing the backup metadata required to restore a final incremental backup and plug in a tablespace on the destination database.

28.6.2 Quickly Transport a Tablespace in NOCATALOG Mode

You can quickly transport a tablespace by restoring the data files from a level 0 backup of the tablespace on the destination database.

Oracle recommends this method for transporting small sized tablespaces that take less time to backup.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.6.2.1 Source CDB: Preparing to Quickly Transport a Tablespace in NOCATALOG Mode

Prepare to quickly transport a tablespace by creating a level 0 backup of the tablespace and a transport file on the source database.

  1. Connect to the source database from which you need to transport tablespaces as TARGET.
  2. For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablespaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.
    In this example, sbu is a user who is granted the SYSBACKUPprivilege on the source database prod_source.
    RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
    Enter the password for the sbu user when prompted.
  3. Place the tablespace in read-only mode.

    The following command places the tablespace mf_tbs in read-only mode.

    ALTER TABLESPACE mf_tbs READ ONLY;
  4. Use the BACKUP TABLESPACE command to create an incremental level 0 backup of the tablespace that you want to transport to a destination database.
    Use the DATAPUMP clause to create an export dump file along with the level 0 backup.

    The following statement creates an incremental level 1 backup and an export dump file for the tablespace my_tbs.

    RMAN> BACKUP 
    INCREMENTAL LEVEL 0
    TABLESPACE mf_tbs
    FORMAT '/tmp/xplat_backups/mf_tbs_incr.bck'
    DATAPUMP FORMAT 'pump.bck'
    TAG 'mf_tbs_plugin_tag';
    In this example, the mf_tbs_incr.bck file stores the incremental backup. The pump.dmp file stores the export dump file backup.
  5. On the source database, use the RESTORE command with the PREVIEW option and the TO TRANSPORT FILE option to create a transport file. The transport file stores the tablespace backup information in XML format.

    The following statement creates a transport file named 'mf_tbs_transportfile.xml'. The plug in tag mf_tbs_plugin_tag identifies the export dump file corresponding to the tablespace mf_tbs.

    RMAN> RESTORE PREVIEW
    TO TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml'
    PLUGIN TAG 'mf_tbs_plugin_tag'
    TABLESPACE mf_tbs;
  6. Use operating system specific utilities to manually copy the transport file from the source database to the destination database. Alternatively, store the transport file in a network file system (NFS) path or any shared location accessible to the destination host.
28.6.2.2 Destination Database: Quickly Restore Data Files and Plug In a Tablespace in NOCATALOG Mode

Use a transport file to restore the data files from a level 0 backup of the tablespace on the destination database.

  1. Use the CONNECT TARGET command to connect to the destination database as a user with the SYSDBA or SYSBACKUP privilege.
  2. Run the RESTORE FOREIGN TABLESPACE command with the FROM TRANSPORT FILE option to specify the transport file that you have created on the source database containing the tablespace.

    The following statement restores the data files from a level 0 backup of the tablespace my_tbs, and plugs in the tablespace on the destination database. The mf_tbs_transportfile.xml file is the transport file that contains the backup information required for the restore operation.

    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml';
    If you are transporting a tablespace using a backup and an export dump file backup made in a previous release of Oracle Database, then you must run the RESTORE command to include:
    • The DUMP FILE clause to specify that RMAN needs to restore the export dump file created during the tablespace backup.

      The DATAPUMP DESTINATION clause to specify the directory into which you want to extract and store the export dump file.

    • The FROM BACKUPSET clause to specify the name of the backup set that contains the export dump file.
    
    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml'
    DUMP FILE DATAPUMP DESTINATION '/tmp/xplat_backups/'
    FROM BACKUPSET 'mf_tbs_datapump.bck';

    In this example, /tmp/xplat_backups/ is the location specified to extract the dump file from the backup set mf_tbs_datapump.bck.

28.6.3 Transport a Tablespace Using a Preexisting Tablespace Backup and without Recovery Catalog

RMAN enables you to transport a tablespace by leveraging a preexisting tablespace backup (level 0) that is available as part of your regular backup schedule.

In the NOCATALOG mode, you must generate a transport file on the source database. The transport file stores tablespace backup information in XML format. On the destination database, RMAN uses the transport file to restore the data files from tablespace backups created on the source database.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.6.3.1 Source Database: Preparing to Transport a Tablespace Using a Preexisting Backup in NOCATALOG Mode

Transport a tablespace by using a most recent level 0 backup of the tablespace and a transport file on the source database.

  1. Connect to the source database from which you need to transport tablespaces as TARGET.
  2. For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablespaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.
    In this example, sbu is a user who is granted the SYSBACKUPprivilege on the source database prod_source.
    RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
    Enter the password for the sbu user when prompted.
  3. Place the tablespace in read-only mode.

    The following command places the tablespace mf_tbs in read-only mode.

    ALTER TABLESPACE mf_tbs READ ONLY;
  4. Create a final incremental level 1 backup of the tablespace.
    Use the DATAPUMP clause to create an export dump file containing the metadata required to plug in the tablespace on to the destination host.

    The following statement creates an incremental level 1 backup of the tablespace my_tbs .

    RMAN> BACKUP 
    INCREMENTAL LEVEL 1
    TABLESPACE mf_tbs
    FORMAT '/tmp/xplat_backups/my_tbs_incr.bck'
    DATAPUMP FORMAT 'pump.bck'
    TAG 'mf_tbs_plugin_tag';
    In this example, the mf_tbs_incr.bck file stores the incremental backup. The pump.dmp file stores the export dump file backup.
  5. On the source database, use the RESTORE command with the PREVIEW option and the TO TRANSPORT FILE option to create a transport file.

    The following statement creates a transport file named 'mf_tbs_transportfile.xml'. The plug in tag mf_tbs_plugin_tag identifies the export dump file corresponding to the tablespace mf_tbs.

    RMAN> RESTORE PREVIEW
    TO TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml'
    PLUGIN TAG 'mf_tbs_plugin_tag'
    TABLESPACE mf_tbs;
  6. Use operating system specific utilities to manually copy the transport file from the source database to the destination database. Alternatively, store the transport file in a network file system (NFS) path or any shared location accessible to the destination host.
28.6.3.2 Destination Database: Restore Data Files From a Preexisting Backup and Plug In a Tablespace in NOCATALOG Mode

Restore the most recent backup of a tablespace on the destination database using a transport file.

  1. Use the CONNECT TARGET command to connect to the destination database as a user with the SYSDBA or SYSBACKUP privilege.
  2. Use the RESTORE FOREIGN TABLESPACE command with the FROM TRANSPORT FILE option to specify the transport file you have created on the source database.

    The following statement restores the data files using the backups of the tablespace mf_tbs. RMAN first restores the data files from the most recent level 0 backup, rolls forward the restored data files by applying the incremental level 1 backup, and then plugs in the tablespace on the destination database.

    The transport file mf_tbs_transportfile.xml contains the backup information required for the restore operation.

    RMAN> RESTORE
    FOREIGN TABLESPACE my_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml';
    If you are transporting a tablespace using a backup and an export dump file backup made in a previous release of Oracle Database, then you must run the RESTORE command to include:
    • The DUMP FILE clause to specify that RMAN needs to restore the export dump file created during the tablespace backup
    • The DATAPUMP DESTINATION clause to specify the directory into which you want to extract and store the export dump file
    • The FROM BACKUPSET clause to specify the name of the backup set that contains the export dump file
    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml'
    DUMP FILE DATAPUMP DESTINATION '/tmp/xplat_backups/'
    FROM BACKUPSET 'mf_tbs_datapump.bck';

    In this example, /tmp/xplat_backups/ is the location specified to extract the export dump file from the backup set mf_tbs_datapump.bck.

28.6.4 Transport a Tablespace Using Multiple Incremental Backups in NOCATALOG Mode

Use this method for transporting large tablespaces in NOCATALOG mode.

On the destination database, you must first restore the data files from a preexisting backup or a new backup of the tablespace. You can then roll forward the restored data files by applying multiple incremental level 1 backups periodically. The source tablespace can remain open for writes while you apply any number of incremental level 1 backups on the destination database. The application downtime begins only when you create the final incremental backup.

This method helps to improve database availability while transporting large tablespaces.

Ensure that you meet the prerequisites described in Prerequisites for Transporting Data Using RMAN Backups.

28.6.4.1 Source Database: Creating a Base Incremental Backup of a Tablespace

Use a preexisting tablespace backup or create a level 0 backup of the tablespace on the source database.

  1. Connect to the source database from which you need to transport tablespaces as TARGET.
  2. For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablespaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.
    In this example, sbu is a user who is granted the SYSBACKUPprivilege on the source database prod_source.
    RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
    Enter the password for the sbu user when prompted.
  3. Perform one of the following steps:
    • If you want to leverage a preexisting level 0 backup of the tablespace, then create an incremental level 1 backup to include all the latest changes that occurred in the tablespace since the level 0 backup was taken.

      The following statement creates an incremental level 1 backup of the tablespace mf_tbs:

      RMAN> BACKUP
      INCREMENTAL LEVEL 1
      TABLESPACE 'mf_tbs';
    • Alternatively, create a level 0 backup of the tablespace.

      The following statement creates an incremental level 0 backup of the tablespace mf_tbs:

      RMAN> BACKUP
      INCREMENTAL LEVEL 1
      TABLESPACE 'mf_tbs';
  4. On the source database, use the RESTORE command with the PREVIEW option and the TO TRANSPORT FILE option to create a transport file.
    The following statement creates a transport file named mf_tbs_transportfile.xml
    RMAN> RESTORE PREVIEW
    TO TRANSPORT FILE '/tmp/xplat_backups/sales_pdb_transportfile.xml'
    TABLESPACE mf_tbs;
  5. Use operating system specific utilities to manually copy the transport file from the source host to the destination host. Alternatively, store the transport file in a network file system (NFS) path or any shared location accessible to the destination host.
28.6.4.2 Destination Database: Restore the Base Incremental Backup of a Tablespace in NOCATALOG Mode

On the destination database, use a transport file to restore the base incremental level 0 backup of the tablespace being transported. The level 0 backup serves as a basis for RMAN to restore subsequent increment level 1 backups of the tablespace.

  1. Use the CONNECT TARGET command to connect to the destination database as a user with the SYSDBA or SYSBACKUP privilege.
  2. Use the RESTORE FOREIGN TABLESPACE command with the FROM TRANSPORT FILE option to specify the transport file created on the source host.

    The following statement restores the data files from the backup of the tablespace my_tbs. RMAN first restores the data files from the level 0 backup, rolls forward the data files by applying any incremental level 1 backups. The mf_tbs_transportfile.xml transport file contains the backup information required for the restore operation.

    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml';
28.6.4.3 Restore Data Files Using Incremental Backups of a Tablespace in NOCATALOG Mode

On the destination database, you can periodically apply incremental level 1 backups to roll forward the previously restored data files. The source tablespace can remain open for writes during the backup and restore operation.

On the source database, create an incremental level 1 backup of the tablespace

  1. Connect to the source database from which you need to transport tablespaces as TARGET.
  2. For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablespaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.
    In this example, sbu is a user who is granted the SYSBACKUPprivilege on the source database prod_source.
    RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
    Enter the password for the sbu user when prompted.
  3. Use the INCREMENTAL LEVEL 1 clause in the BACKUP TABLESPACE command to create a incremental level 1 backup of the tablespace. You can create multiple incremental level 1 backups and then perform a single restore operation on the destination database.
    This example creates an incremental level 1 backup of the tablespace my_tbs:
    RMAN> BACKUP 
    INCREMENTAL LEVEL 1
    TABLESPACE my_tbs;
  4. On the source database, use the RESTORE command with the PREVIEW option and the TO TRANSPORT FILE option to create a transport file.
    The following statement creates a transport file named mf_tbs_transportfile.xml
    RMAN> RESTORE PREVIEW
    TO TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml'
    TABLESPACE mf_tbs;
  5. Use operating system specific utilities to manually copy the transport XML file from the source host to the destination host. Alternatively, store the XML file in a network file system (NFS) path or any shared location accessible to the destination host.

On the destination database, roll-forward the previously restored data files by applying the incremental level 1 backups of the tablespace.

  1. Use the CONNECT TARGET command to connect to the destination database as a user with the SYSDBA or SYSBACKUP privilege.
  2. Restore the data files from the tablespace backup created on the source host. Use the RESTORE FOREIGN TABLESPACE command with the FROM TRANSPORT FILE option.

    If you have created multiple incremental level 1 backups of the source tablespace, RMAN applies the incremental backups in the same order in which the backups were created.

    The following statement restores the data files from the incremental backups of the tablespace mf_tbs on the destination host. The mf_tbs_transportfile.xml transport file contains the backup information required for the restore operation.

    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml';
28.6.4.4 Destination Database: Create a Final Incremental Backup of a Tablespace in NOCATALOG Mode

Create a final incremental level 1 backup and an export dump file to prepare a tablespace for the final transport to the destination database.

  1. Connect to the source database from which you need to transport tablespaces as TARGET.
  2. For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablespaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.
    In this example, sbu is a user who is granted the SYSBACKUPprivilege on the source database prod_source.
    RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
    Enter the password for the sbu user when prompted.
  3. Place the tablespaces to be transported in read-only mode.
    The following command places the tablespace mf_tbs in read-only mode:
    ALTER TABLESPACE mf_tbs READ ONLY;
  4. Create a final incremental level 1 backup of the tablespace. Use the DATAPUMP clause to create an export dump file along with the incremental backup.
    This example creates a final incremental level 1 backup of the tablespace mf_tbs:
    RMAN> BACKUP 
    INCREMENTAL LEVEL 1
    TABLESPACE mf_tbs
    FORMAT '/tmp/xplat_backups/my_tbs_incr.bck'
    DATAPUMP FORMAT 'pump.dmp'
    TAG 'mf_plugin_tag';
    In this example, the mf_tbs_incr.bck file stores the incremental backup. The pump.dmp file stores the export dump file backup.
  5. On the source database, use the RESTORE command with the PREVIEW option and the TO TRANSPORT FILE option to create a transport XML file.
    RMAN> RESTORE PREVIEW
    TO TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transport.xml'
    PLUGIN TAG 'mf_plugin_tag'
    TABLESPACE mf_tbs;
    In this example, the plug in tag mf_plugin_tag identifies the dump file backup corresponding to the source tablespace mf_tbs.
  6. Use operating system utilities to copy the transport XML file to a network file system (NFS), or shared location that is accessible to the destination database host.
28.6.4.5 Destination Database: Perform the Final Transport of a Tablespace in NOCATALOG Mode

As a final step, use the transport file to restore the data files and plug in the tablespace to the destination database.

  1. Use the CONNECT TARGET command to connect to the destination database as a user with the SYSDBA or SYSBACKUP privilege.
  2. Use the RESTORE FOREIGN TABLESPACE command with the FROM TRANSPORT FILE option to specify the transport file created on the source host.

    The following statement restores the mf_tbs tablespace on the destination database. The FROM TRANSPORT FILE command specifies the transport file created on the source database.

    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml';
    If you are transporting a tablespace using a backup and an export dump file backup made in a previous release of Oracle Database, then you must run the RESTORE command to include:
    • The DUMP FILE clause to specify that RMAN needs to restore the export dump file created during the tablespace backup.

      The DATAPUMP DESTINATION clause to specify the directory into which you want to extract and store the export dump file.

    • The FROM BACKUPSET clause to specify the name of the backup set that contains the export dump file.
    RMAN> RESTORE
    FOREIGN TABLESPACE mf_tbs
    FORMAT '/oradata/%U'
    FROM TRANSPORT FILE '/tmp/xplat_backups/mf_tbs_transportfile.xml'
    DUMP FILE DATAPUMP DESTINATION '/tmp/xplat_backups/'
    FROM BACKUPSET 'mf_tbs_datapump.bck';

    In this example, /tmp/xplat_backups/ is the location specified to extract the export dump file from the backup set mf_tbs_datapump.bck.

28.7 Transporting Tablespaces Over the Network

RMAN enables you to transport tablespaces over the network.

28.7.1 About Transporting Tablespaces Over the Network

Starting with Oracle Database 23ai, you can use RMAN to transport tablespaces over the network from a source database to a destination database.

RMAN can connect to a source database, create the required backups of a tablespace, transfer the data files optimally over the network, and then restore the data files on the destination database. RMAN also plugs in the tablespace on the destination database.

To transport a tablespace through the network, RMAN uses the RESTORE command along with the FROM SERVICE clause, the FOREIGN TABLESPACE clause, and the PLUGIN DBLINK clause.

Additionally, you can use the RECOVER command to periodically roll forward the restored tablespace backup on the destination database.

These are the major steps required to transport a tablespace from a source database to a destination database over the network:

On the destination database:
  • Run the RESTORE command along with the FOREIGN TABLESPACE clause and the FROM SERVICE clause. RMAN restores the data files from a level 0 backup of the source tablespace.
  • You can optionally run the RECOVER command along with the FOREIGN TABLESPACE clause and the FROM SERVICE clause. RMAN rolls forward the previously restored data files using the incremental level 1 backups of the source tablespace.
  • When the source tablespace is in read-only mode, use the RECOVER command with the FOREIGN TABLESPACE clause, the FROM SERVICE clause, and the PLUGIN DBLINK clause to recover the data files from a final incremental backup, and plug in the tablespace on the destination database.

Note:

If the Oracle Active Data Guard logical database rolling upgrade process is running on a destination database, then RMAN cannot successfully complete the final step involved in transporting data using backups. This is because the rolling upgrade process restricts RMAN from importing the backup metadata required to restore a final backup and plug in a tablespace on to a destination database.

28.7.2 Quickly Transport a Tablespace Over the Network

Use RMAN to quickly transport a tablespace by restoring the data files from a tablespace backup over the network. Oracle recommends this method for transporting small-sized PDBs that take less time to backup.

Ensure that you meet the prerequisites as described in Prerequisites for Transporting Data Using RMAN Backups.
  1. Perform these steps on a source database:
    1. Connect to the source database from which you need to transport tablespaces as TARGET.

      For a tablespace in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablepaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.

      In this example, sbu is a user who is granted the SYSBACKUP privilege on the source database prod_source.

      RMAN> CONNECT TARGET "sbu@prod_source AS SYSBACKUP";
      

      Enter the password for the sbu user when prompted.

    2. Place the tablespace in read-only mode.
      The following command places the tablespace mf_tbs in read-only mode:
      ALTER TABLESPACE mf_tbs READ ONLY;
      
    3. Grant the EXP_FULL_DATABASE privilege to the SYSBACKUP user on the source database.
  2. Perform these steps on the destination database.
    1. Connect to the destination database, into which the tablespaces must be transported, as TARGET.

      For tablespaces in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablespaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.

      In this example, sbu is a user who is granted the SYSBACKUP privilege on the destination database prod_dest.

      RMAN> CONNECT TARGET "sbu@prod_dest AS SYSBACKUP";
      

      Enter the password for the sbu user when prompted.

    2. Use the SQL*PLUS CREATE DATABASE LINK statement to create a PUBLIC dblink.
      For example, in the following statement, user rco on the destination database defines a database link called mftbspluginlink that refers to the database pdb1 on the CDB cdb1.
      CREATE PUBLIC DATABASE LINK mftbspluginlink CONNECT TO rco IDENTIFIED BY password USING 'cdb1_pdb1'
    3. Perform a single restore operation which enables RMAN to connect to the source database, create a level 0 backup of the tablespace, transfer the data files over the network, and then restore the data files on the destination database. RMAN also plugs in the restored tablespace on to the destination database.
      Use the FOREIGN TABLESPACE command to specify the name of the tablespace on the source database.
      Use the FROM SERVICE clause to specify the service name of the source database.
      Optionally, use the PLUGIN FILE clause to specify the file name and location to store the export dump file that contains the metadata required to plug in the tablespace on the destination database.
      Use the PLUGIN DBLINK clause to specify the database link to access the destination database.
      The following statement restores the data files using a backup of the tablespace mf_tbs from a source database with the service name source_db. The PLUGIN FILE clause specifies that the structural metadata of the tablespace must be stored in /tmp/xplat_backups/mf_tbs.dmp. The PLUGIN DBLINK clause specifies the database link mftbspluginlink created on the destination database.
      RMAN> RESTORE 
      FOREIGN TABLESPACE 'mf_tbs' 
      FORMAT 'tbs1%f.f' 
      FROM SERVICE 'source_db' 
      PLUGIN FILE '/tmp/xplat_backups/mf_tbs.dmp'
      PLUGIN DBLINK 'mftbspluginlink';

28.7.3 Transport a Tablespace by Restoring Data Files Using Incremental Backups Over the Network

Use the network to restore data files from a level 0 backup of a tablespace, and then recover the restored data files until you want to perform the final transport of the tablespace over the network.

Ensure that the prerequisites, as described in Prerequisites for Transporting Data Using RMAN Backups are met.
  1. Connect to the destination database, into which the tablespaces must be transported, as TARGET.

    For tablespaces in the root, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For tablespaces in the PDB, connect to the PDB as a common user or local user with the SYSDBA or SYSBACKUP privilege.

    In this example, sbu is a user who is granted the SYSBACKUP privilege on the destination database prod_dest.

    RMAN> CONNECT TARGET "sbu@prod_dest AS SYSBACKUP";
    

    Enter the password for the sbu user when prompted.

  2. On the destination database, perform a restore operation using the FROM SERVICE clause.
    RMAN connects to the source database, creates the required backup of the source tablespace, transfers the data files over the network, and then restores the data files on the destination database. The first backup is always an incremental level 0 backup that serves as a base to apply subsequent incremental level 1 backups.
    Run the RESTORE command with the FOREIGN TABLESPACE command to specify the name of the source tablespace.
    Use the FROM SERVICE clause to specify the service name of the source database.
    The following statement restores the data files from a level 0 backup of the tablespace mf_tbs from a source database with the service name source_db.
    RMAN> RESTORE 
    FOREIGN TABLESPACE 'mf_tbs'
    FORMAT 'tbs1%f.f' 
    FROM SERVICE 'source_db'; 
    

While the source tablespace remains open for writes, you can periodically perform recover operations on the destination database. The RECOVER command enables RMAN to roll forward the data files by applying incremental level 1 backups of the source tablespace. There is no restriction on the number of times you can perform the recover operation until you want to transport the tablespace with a final incremental backup.

  1. Run the RECOVER command along with the FOREIGN TABLESPACE clause to specify the name of the tablespace on the source database.
    Use the FROM SERVICE clause to specify the service name of the source database.
    The following statement recovers the tablespace mf_tbs from a source database with the service name source_db:
    RECOVER 
    FOREIGN TABLESPACE 'mf_tbs'
    FORMAT 'tbs1%f.f' 
    FROM SERVICE 'source_db';
  2. Use the SQL*PLUS CREATE DATABASE LINK statement to create a PUBLIC dblink.
    For example, in the following statement, user rco on the destination database defines a database link called mftbspluginlink that refers to the database pdb1 on the CDB cdb1.
    CREATE PUBLIC DATABASE LINK mftbspluginlink CONNECT TO rco IDENTIFIED BY password USING 'cdb1_pdb1'
  3. Grant the EXP_FULL_DATABASE privilege to the SYSBACKUP user on the source database.
  4. When the source tablespace is set to read-only mode, you can recover the data files using a final incremental backup, and then plug-in the tablespace on to the destination database.
    Run the RECOVER command with the FOREIGN TABLESPACE command to specify the name of the source tablespace.
    Use the FROM SERVICE clause to specify the service name of the source database.
    Optionally, use the PLUGIN FILE clause to specify the file name and location to store the export dump file that contains the metadata required to plug in the tablespace on the destination database.
    Use the PLUGIN DBLINK clause to specify the database link required to access the destination database.
    The following statement restores the data files of the tablespace mf_tbs from a source database with the service name source_db. The PLUGIN FILE clause specifies that the structural metadata of the tablespace must be stored in /tmp/xplat_backups/mf_tbs.dmp. The PLUGIN DBLINK specifies the database link mftbsdblink created on the destination database.
    RMAN> RESTORE 
    FOREIGN TABLESPACE 'mf_tbs1' 
    FORMAT 'tbs1%f.f' 
    FROM SERVICE 'source_db' 
    PLUGIN FILE '/tmp/xplat_backups/mf_tbs.dmp'
    PLUGIN DBLINK 'mftbspluginlink'; 
    
    RMAN recovers the data files from the final incremental backup, and then plugs in the tablespace on to the destination database.

28.8 Transporting Data Using Backups from a Physical Standby Database

You can use the backups created on a source physical standby database to transport a pluggable database (PDB) or a tablespace to another primary or standby database on a destination host.

28.8.1 About Transporting Data Using Backups from a Physical Standby Database

In this method, you can use the source physical standby database to create the incremental backups and to extract the structural metadata of the PDB or tablespace that needs to be transported to another primary or standby database on a destination host.

These are the essential steps required to transport data to a primary database on a destination host:
  • Enable block change tracking on the source physical standby database. Ensure that the managed recovery process is running.
  • Connect RMAN to the source standby database to create an incremental level 0 backup of the database or tablespace that you want to transport to a destination primary database. You can also leverage a preexisting level 0 backup, if available.
  • On the destination primary database, restore the data files from the level 0 backup created on the source standby database. You can also restore the data files on an existing physical standby database on the destination host.

    Roll forward the restored data files by applying multiple incremental level 1 backups periodically. You can continue to apply any number of incremental level 1 backups on the destination primary database until you want to perform the final transport.

  • Complete these prerequisite tasks on the source standby database before you perform the final transport:
    • Create a guaranteed restore point. In case of any unexpected failures during the transport process, you can recover the source standby database to the guaranteed restore point.
    • Stop the managed recovery process and then convert the physical standby database into a snapshot standby database. This ensures that the final incremental level 1 backup is in a consistent state for recoverablity on the destination database.

      Note:

      You can optionally connect RMAN to the source primary database to create the final incremental backup and the export dump file. In this case, you can skip the preparation tasks on the physical standby database and directly proceed to create the final incremental backup on the primary database. However, this may result in a minimal downtime on the primary database. To avoid downtime and ensure business continuity, Oracle recommends that you use the source standby database to perform the steps required for the final transport.
  • On the source standby database, create a final incremental level 1 backup of the database or tablespace. If you are transporting a PDB, create an unplug XML file containing the structural metadata of the source PDB. For a tablespace, you must create the data pump export dump file containing the tablespace metadata.
  • On the destination primary database, use the RESTORE command to create a transport list. Use the transport list to restore the data files on the destination primary database.
After you transport data to the destination primary database, use these steps to transport the data to a standby database on the destination host:
  • Stop the managed recovery process.
  • Set the DB_CREATE_FILE_DEST initialization parameter to specify the location of the data files for the standby database.
  • On the destination host, connect RMAN to the physical standby database as TARGET. Restore the data files from the incremental level 0 backup from the source standby database. Roll forward the restored data files by applying multiple incremental level 1 backups and the final incremental backup.
  • Set the STANDBY_FILE_MANAGEMENT database initialization parameter to MANUAL so that the newly added data files can be renamed manually.
  • Start the managed recovery process.

    When the standby database applies redo, the recovery process creates a control file entry with a name containing the phrase UNNAMED, and stops recovery. Use the ALTER DATABASE RENAME FILE statement to manually rename the individual data files until the media recovery on physical standby database is aware of all the plugged in files.

28.8.2 Performing Data Transport by Using Backups from Physical Standby Database

Use the source physical standby database to transport a PDB or a tablespace to another primary database or physical standby database on a destination host.

  1. Start SQL*Plus and connect to the source physical standby database as a user with the SYSBACKUP privilege.
  2. Enable block change tracking.
    For detailed steps, see Enabling Block Change Tracking.
  3. Ensure that the source physical standby database operates in real-time apply mode. See Oracle Data Guard Concepts and Administration for more information.
  4. Ensure that the managed recovery process is running.
  5. Start RMAN, and connect to the source physical standby database as TARGET. It is recommended that you also connect to a recovery catalog.
    The following commands connect as TARGET to the source physical standby database, and as CATALOG to the recovery catalog. The connection to the source physical standby is established using the sbu user, who has been granted SYSBACKUP privilege. The net service name of the source physical standby database is standby_db and that of the recovery catalog is catdb.
    
    CONNECT TARGET "sbu@standby_db AS SYSBACKUP";
    CONNECT CATALOG rman@catdb;
  6. Create an incremental level 0 backup of the PDB or a tablespace that you want to transport to the destination database.

    The following command creates an incremental level 0 backup of the tablespace mf_tbs on the source physical standby database.

    BACKUP
    INCREMENTAL LEVEL 0
    TABLESPACE mf_tbs
    FORMAT '/tmp/xplat_backups/mf_tbs_full%U.bck';
    If you are transporting a PDB, then use the PLUGGABLE DATABASE command to specify the source PDB.
  7. Use the CONNECT TARGET command to connect to the destination primary database as a user with the SYSDBA or SYSBACKUP privilege.
  8. Perform these steps to restore the data files using the incremental level 0 backup from the source standby database.
    1. Connect RMAN to the recovery catalog.
    2. Use the SET command with the FOREIGN DBID option to specify the database identifier or DBID of the source physical standby database containing the PDB or tablespace backup you want to use for the restore operation.
    3. Use the RESTORE command with the PREVIEW option and the TO TRANSPORT LIST option to create an in-memory list of backups used by RMAN in the restore operation.
    4. Run the RESTORE command with the FOREIGN TABLESPACE or FOREIGN PLUGGABLE DATABASE option and the TO TRANSPORT LIST clause to restore the level 0 backup of the PDB or tablespace.
    You can use the same steps to restore the foreign data files on the destination physical standby database.
  9. Connect to the source physical standby database and create an incremental level 1 backup of the PDB or tablespace.
    The following command creates an incremental level 1 backup of the tablespace mf_tbs.
    BACKUP
    INCREMENTAL LEVEL 1
    TABLESPACE mf_tbs
    FORMAT '/tmp/xplat_backups/mf_tbs_incr1%U.bck';
    Use the PLUGGABLE DATABASE command to specify the source PDB.
  10. On the destination primary database, roll forward the previously restored data files by applying the incremental level 1 backup of the PDB or tablespace.
    There is no restriction on the number of times you can apply the incremental level 1 backups of the source PDB or tablespace on the destination database until you want to perform the final transport.
    You can use the same steps to restore the foreign data files on the destination physical standby database.
  11. Complete these tasks on the source physical standby database to prepare for the final transport. If you want to use the source primary database to create the final incremental backup and the export file, then skip these preparation steps and directly proceed to step 12.
    1. On the source physical standby database, start SQL*Plus to create a guaranteed restore point, stop the managed recovery process, and then convert the physical standby database to become a snapshot standby database
    2. Create a guaranteed restore point so that you can recover the soyrce physical standby database to the guaranteed restore point in case of any unexpected failures during the transport process.
      The following command creates a guaranteed restore point.
      SQL> CREATE RESTORE POINT mf_tbs_standby GUARANTEE 
      FLASHBACK DATABASE;
    3. Stop the managed recovery processes on the source physical standby database.
      The following command stops the managed recovery process.
      ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
    4. Convert the physical standby database into a snapshot standby database using this command:
      SQL> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;
  12. Place the tablespace to be transported in read-only mode. If you are transporting a PDB, then ensure to close the PDB.
    The following command places the tablespace mf_tbs in read-only mode.
    ALTER TABLESPACE mf_tbs READ ONLY;
    Use the following command to close a PDB:
    ALTER PLUGGABLE DATABASE sales_pdb CLOSE IMMEDIATE;

    Note:

    If you want to use the source primary database to create the final incremental backup, then ensure that RMAN is connected to the source primary database as TARGET. However, it is recommended that you use the source physical standby database to ensure reduced downtime on the source primary database.
  13. Create a final incremental level 1 backup of the PDB or the tablespace that is being transported to the primary database on the destination host.
    The following statement creates a incremental level 1 backup and an export dump file for the tablespace mf_tbs. The DATAPUMP clause generates the export dump file that contains the metadata required to plug in the tablespaces mf_tbs on the destination database.
    BACKUP
    INCREMENTAL LEVEL 1
    TABLESPACE mf_tbs
    FORMAT '/tmp/xplat_backups/my_tbs_incr.bck'
    DATAPUMP FORMAT 'pump.dmp'
    TAG 'mf_plugin_tag';
    The following statement creates an incremental level 1 backup of the PDB sales_pdb. The PDB is unplugged from the source CDB. The UNPLUG INTO clause specifies the XML file to store the structural metadata of the PDB when it is unplugged from the source CDB. The TAG clause specifies the backup tag that is used to identify the RMAN backup.
    BACKUP 
    UNPLUG INTO '/tmp/pdb_dumpfiles/sales_pdb_unplug.xml'
    INCREMENTAL LEVEL 1
    PLUGGABLE DATABASE sales_pdb
    XML BACKUP FORMAT '/tmp/pdb_backups/sales_pdb_unplug.bck'
    TAG 'sales_pdb_plugin_tag';
  14. On the destination database, restore the data files from the final incremental level 1 backup and plug in the PDB or tablespace.
    See Transport a PDB Using Multiple Incremental Backups and Recovery Catalog Connection for detailed steps to transport a PDB using backups.
    See Transport a Tablespace Using Multiple Incremental Backups and Recovery Catalog for detailed steps to transport a tablespace using backups.
  15. On the source physical standby database, start SQL*Plus and convert the snapshot standby database as the physical standby database.
    SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
    

Next, transport the PDB or tablespace to an existing physical standby database on the destination host. You can use the same backups from the source standby database to create the data files required for the destination standby database.

  1. On the destination host, start SQL*Plus and connect to the physical standby database as a user with the SYSBACKUP privilege.
  2. Stop the managed recovery process.
    The following command stops the managed recovery process.
    ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
  3. Use the DB_CREATE_FILE_DEST initialization parameter to specify the location for the restored data files required by the destination standby database.
    You can set the DB_CREATE_FILE_DEST initialization parameter with the following form of the ALTER SYSTEM statement:
    ALTER SYSTEM SET DB_CREATE_FILE_DEST = 'scratch/testdb/';
  4. Connect RMAN as TARGET to the destination physical standby database and restore all the data files using the backups created on the source standby database. You can also restore the foreign data files along with the foreign data file restore on the destination primary database (described in step 8).
  5. On the physical standby database, set the STANDBY_FILE_MANAGEMENT database parameter to MANUAL.
    ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT = MANUAL;
  6. Start the managed recovery process.
    ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
    When the standby database applies redo for the plugged-in data files, the recovery process will create a control file entry with the name containing UNNAMED in it, and stops recovery. The database alert log displays similar error messages for each data file.
    
    Plugged in file #14 added to control file as 'UNNAMED00014' because
    the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL
    The file should be manually created to continue.
    PR00 (PID:229327): MRP0: Background Media Recovery terminated with error 1274
    2023-06-22T16:20:14.814443+00:00
    Plugged in file #16 added to control file as 'UNNAMED00016' because
    the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL
    The file should be manually created to continue.
    Plugged in file #17 added to control file as 'UNNAMED00017' because
    the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL
    The file should be manually created to continue.
  7. You must use the ALTER DATABASE RENAME FILE statement to manually rename the individual data files to the restored foreign data files.
    1. Run the following SQL script to generate a separate ALTER DATABASE RENAME FILE statement to rename each data file in a tablespace. For example, if a tablespace contains 3 data files, run this SQL script to generate 3 different ALTER DATABASE RENAME FILE commands, each unique to a data file.
      select 'alter database rename file 
      ''' || a.name || ''' to '''|| b.name || ''';' 
      from v$datafile a, v$datafile_copy b where a.name like '%UNNAME%' 
      and b.creation_change#=a.foreign_creation_change# 
      and b.name is not null 
      and b.rfile#=a.rfile#;
      This example shows the ALTER DATABASE RENAME FILE statements generated by the SQL script to rename three example data files df1, df2, and df3 from the mf_tbs tablespace.
      ALTER DATABASE RENAME FILE 
      '/scratch/testdb/UNNAMED00014' to '/scratch/testdb/df1.dbf';
      ALTER DATABASE RENAME FILE 
      '/scratch/testdb/UNNAMED00016' to '/scratch/testdb/df2.dbf';
      ALTER DATABASE RENAME FILE 
      '/scratch/testdb/UNNAMED00017' to '/scratch/testdb/df3.dbf';
    2. Repeat steps 21 and 22 until the media recovery on destination physical standby database is aware of all the plugged in files.