Database Reference
In-Depth Information
Moving PDBs between different containers
Another way to add a PDB to a system is to unplug it on the source and plug it into the destination. The best use case
for this is the application of a patch on the source CDB. Instead of suffering downtime while the CDB is patched, you
could easily unplug/plug the PDB from the database to be patched to another, already patched CDB.
Oracle has developed a procedure to facilitate that process, and it is based on an XML document that travels with
the PDB to be moved. The API gives you a great deal of flexibility over the process. Once a PDB is unplugged, it is no
longer associated with the CDB it was last plugged into but nevertheless still listed as you will see in a bit. The unplug
command is remarkably simple, and the only variables to it are the user-PDB name and the location of the XML file
describing it. To export user-PDB pdb5 for example, you can issue this command:
SQL> alter pluggable database pdb5 unplug into '/home/oracle/pdb_ddl/pdb5.xml';
Pluggable database altered.
For it to succeed the PDB to be exported must be in mount state. When choosing a name for the XML file, you
should make it obvious which database it describes. The database (unique) name for example is a great example for
a file name. After the XML file has been created, the PDB is not removed from the list of PDBs in v$pdbs . The XML file
describing the PDB contains information about the PDB's tablespaces, and some general information required for
plugging the database into a CDB. The below is an excerpt from the XML file describing pdb5:
<?xml version="1.0" encoding="UTF-8"?>
<PDB>
<pdbname>PDB5</pdbname>
<cid>5</cid>
<byteorder>1</byteorder>
...
<guid>E732F81E6B640DC7E0436638A8C03EB1</guid>
...
<tablespace>
<name>SYSTEM</name>
<type>0</type>
<tsn>0</tsn>
<status>1</status>
<issft>0</issft>
<file>
<path>+DATA/CDB1/E73[...]8C03EB1/DATAFILE/system.275.827060209</path>
<afn>30</afn>
<rfn>1</rfn>
<createscnbas>2390117</createscnbas>
<createscnwrp>0</createscnwrp>
<status>1</status>
<fileblocks>34560</fileblocks>
<blocksize>8192</blocksize>
<vsn>202375168</vsn>
<fdbid>3887550129</fdbid>
<fcpsw>0</fcpsw>
<fcpsb>2392086</fcpsb>
<frlsw>0</frlsw>
 
Search WWH ::




Custom Search