Unplugging the Earlier Release PDB from the Earlier Release CDB
To prepare for upgrading the PDB, use this procedure to unplug the PDB from the earlier release CDB.
-
Run the Pre-Upgrade Information Tool on the PDB.
For example, where the PDB named
salespdb
is running in the CDB in$ORACLE_HOME_12.2
:$ORACLE_HOME_12.2/jdk/bin/java -jar $ORACLE_HOME_19/rdbms/admin/preupgrade.jar dir /tmp -c salespdb
-
Run
preupgrade_fixups.sql
on your source database.For example:
CONNECT / AS SYSDBA SQL> ALTER SESSION SET CONTAINER=salespdb; SQL> @/tmp/preupgrade_fixups_salespdb.sql
-
Follow all recommendations listed in
preupgrade.log
. -
Close the PDB you want to unplug.
For example, use the following command to close the PDB
salespdb
:SQL> ALTER PLUGGABLE DATABASE salespdb CLOSE;
-
Log back in to
CDB$ROOT
:CONNECT / AS SYSDBA SQL> ALTER SESSION SET CONTAINER=CDB$ROOT;
-
Unplug the earlier release PDB using the following SQL command syntax, where
pdb
is the name of the PDB, andpath
is the location of the PDB XML file:ALTER PLUGGABLE DATABASE pdb UNPLUG INTO 'path/pdb.xml';
For example, where the pdb name is
salespdb
and path is/home/oracle/salespdb.xml
:SQL> ALTER PLUGGABLE DATABASE salespdb UNPLUG INTO '/home/oracle/salespdb.xml';
The following response displays when the command is completed:
Pluggable database altered
-
Drop the pluggable database
salespdb
, but keep data files.Oracle recommends that you drop
salespdb
after this procedure to clean up leftover information in the CDB views, and to help to avoid future issues. As a best practice guideline, back up your PDB in the destination CDB first, and then issue theDROP
command on the source.Caution:
After you drop the PDB from its original CDB, you cannot revert to it using previously taken backup, because the
DROP
command removes backup files.To drop the pluggable database, enter the following command:
SQL> DROP PLUGGABLE DATABASE salespdb KEEP DATAFILES;
-
Exit.
Parent topic: Upgrading Pluggable Databases Sequentially