Using Data Pump to Move Databases Into a CDB

After you create an empty PDB in the CDB, you can use an Oracle Data Pump full-mode export and import operation to move data into the PDB. The job can be performed with or without the transportable option. If you use the transportable option on a full mode export or import, it is referred to as a full transportable export/import.

When the transportable option is used, export and import use both transportable tablespace data movement and conventional data movement; the latter for those tables that reside in non-transportable tablespaces such as SYSTEM and SYSAUX. Using the transportable option can reduce the export time and especially, the import time, because table data does not need to be unloaded and reloaded and index structures in user tablespaces do not need to be re-created.

If you want to specify a particular PDB for the export/import operation, then on the Data Pump command line, you can supply a connect identifier in the connect string when you start Data Pump. For example, to import data to a PDB named pdb1, you could enter the following on the Data Pump command line:

impdp hr@pdb1 DIRECTORY=dpump_dir1 DUMPFILE=hr.dmp TABLES=employees

Be aware of the following requirements when using Data Pump to move data into a CDB:

  • To administer a multitenant environment, you must have the CDB_DBA role.

  • Full database exports from Oracle Database and earlier may be imported into Oracle Database 12c (CDB or non-CDB). However, Oracle recommends the source database first be upgraded to Oracle Database 11g release 2 ( or later) so that information about registered options and components is included in the export.

  • When migrating Oracle Database 11g release 2 ( or later) to a CDB (or to a non-CDB) using either full database export or full transportable database export, you must set the Data Pump Export parameter VERSION=12 in order to generate a dump file that is ready for import into Oracle Database 12c. If you do not set VERSION=12, then the export file that is generated will not contain complete information about registered database options and components.

  • Network-based full transportable imports require use of the FULL=YES, TRANSPORTABLE=ALWAYS, and TRANSPORT_DATAFILES=datafile_name parameters. When the source database is Oracle Database 11g release or later, but earlier than Oracle Database 12c Release 1 (12.1), the VERSION=12 parameter is also required.

  • File-based full transportable imports only require use of the TRANSPORT_DATAFILES=datafile_name parameter. Data Pump Import infers the presence of the TRANSPORTABLE=ALWAYS and FULL=YES parameters.

  • The default Data Pump directory object, DATA_PUMP_DIR, does not work with PDBs. You must define an explicit directory object within the PDB that you are exporting or importing.