Plugging an Unplugged Pluggable Database
This tutorial covers the steps required to plug an unplugged pluggable database (PDB) from a container database (CDB) into another CDB.
Time to Complete
Approximately 20 minutes
You can disassociate or unplug a PDB from a CDB and
reassociate or plug the PDB into the same CDB or into another
CDB. This capability is suitable for the following situations:
- You have to upgrade a PDB to the latest Oracle version, but you do not want to apply it on all PDBs. Instead of upgrading a CDB from one release to another, you can unplug a PDB from one Oracle Database release, and then plug it into a newly created CDB from a later release.
- You want to test the performance of the CDB without a particular PDB. You unplug the PDB, test the performance without the PDB and, if necessary, replug the PDB into the CDB.
- You want to maintain a collection of PDB “gold images” as
In this tutorial, you perform a PDB unplugging operation from a CDB. Next, you perform a plugging operation of the same PDB into another CDB by using SQL*Plus.
Different plugging scenarios are allowed:
- Plug the unplugged PDB by using the data files of the unplugged PDB. The unplugged PDB is disassociated from the source CDB.
- The source data files are used with or without any copy.
- The source data files are used after being moved to
- Plug the unplugged PDB as a clone to:
- Allow developers and testers to rapidly and repeatedly provision a well-known starting state
- Support self-paced learning
- Provide a new way to deliver a brand-new application
Before starting this tutorial, you should:
- Install Oracle Database 12c.
- Create two CDBs with two PDBs in the first CDB.
The environment used in the development of this tutorial is as follows:
- ORACLE_HOME: /u01/app/oracle/product/12.1.0
- TNS Listener port: 1521
- Container databases:
- SID: cdb1
- SID: cdb2
- Pluggable databases (in cdb1):
Unplugging the PDB
To unplug a PDB, you first close it and then generate an XML manifest file. The XML file contains information about the names and the full paths of the tablespaces, as well as data files of the unplugged PDB. The information will be used by the plugging operation.
In this section, you unplug two PDBs to plug them with different
The unplugging operation makes changes in the
PDB data files to record that the PDB was properly and
successfully unplugged. Because the PDB is still part of the CDB, you
can back it up in Oracle Recovery Manager (Oracle RMAN). This backup provides a convenient
way to archive the unplugged PDB. After backing it up,
you then remove it from the CDB catalog. But, of course, you
must preserve the data files for the subsequent plugging
Plugging the PDB into the Same or Another CDB
In this section, you plug the unplugged PDB into another CDB by using different methods.
Checking the Compatibility of the
Unplugged PDB with the Host CDB
Before starting the plugging operation, make sure that the to-be-plugged-in PDB is compatible with the new host CDB. Execution of the PL/SQL block raises an error if it is not compatible.
Plugging the Unplugged PDB: NOCOPY
Plugging the Unplugged PDB: COPY
Plugging the Unplugged PDB: AS CLONE
Opening the Plugged PDB
Open and check the availability of the plugged PDB.
Resetting Your Environment
Perform the following steps to reset your environment prior to repeating the activities covered in this OBE or starting another OBE.
In this tutorial, you learned how to unplug a PDB and plug it into another CDB.
- To learn more about pluggable databases, refer to
additional OBEs in the Oracle Learning Library.
Curriculum Developers: Dominique Jeunot and Jean-François
To navigate this Oracle by Example tutorial, note the following:
- Hide Header Buttons:
- Click the title to hide the buttons in the header. To show the buttons again, click the title again.
- Topic List:
- Click a topic to navigate to that section.
- Expand All Topics:
- Click the button to show or hide the details for the sections. By default, all topics are collapsed.
- Hide All Images:
- Click the button to show or hide the screenshots. By default, all images are displayed.
- Click the button to print the content. The content that is currently displayed or hidden is printed.
To navigate to a particular section in this tutorial, select the topic from the list.