uplug_plug

How to unplug PDB, recover a XML description file and plug a PDB to another CDB

Two of the best key features of the multitenant container databases are unplugging PDB from CDB and plugging PDB to the same or another CDB respectively. Let me explain how the unplugging actually works: There are two methods for unplugging PDB from CDB. The first and the older method which has been introduced in Oracle database 12.1 is unplugging PDB from the XML description file and the newer method that has been introduced in Oracle database 12.2 is unplugging PDB to the archive file. I am going to explain the first method, i.e., “using XML description file”. To migrate from a pre-12.1 non-CDB database to CDB please take a look here. Suppose after the unplugging PDB, the XML description file is lost or corrupted. Now, we are going to answer some questions as follows:

  1. How to unplug a PDB from a CDB?

  2. How to recover an XML description file?

  3. How to plug a PDB into another CDB?

  • Unplug a PDB from a CDB:

Before attempting to unplug PDB we review the current CDB setup

With the following commands we will unplug and then will drop PDB:

As I mentioned before, the supposition is that XML is lost or corrupted. Thus we rename the XML description file

  • recover an XML description file:

Let us review the destination CDB and belonging PDBs:

Now I am going to recover the XML description file. There is a DBMS Procedure (DBMS_PDB.RECOVER) which may help us to create an XML metadata file. The XML file Describes the database options and other configurations of PDB. This procedure generates an XML file that describes a pluggable database using data files belonging to the pluggable database (PDB). We can see syntax and procedure parameters as below:

For more information please click here. Let us begin recovering the XML description file:

  • plug a PDB into another CDB:

The XML file has been recovered now, It’s time to plug our PDB to the CDB. One of the optional phases is to check PDB compatibility with CDB destination. For this check we use DBMS_PDB.CHECK_PLUG_COMPATIBILITY.

If the PDB is not compatible, Then violations are listed in the PDB_PLUG_IN_VIOLATIONS view. In the final step, we plug the PDB to the CDB.

We successfully moved the PDB to a different CDB. This is the common way to upgrade a database from version 12.1 to 12.2.

Thanks for your attention.

2 comments On How to unplug PDB, recover a XML description file and plug a PDB to another CDB

Leave a reply:

Your email address will not be published.

Captcha loading...