Upgrading Non-CDB Oracle Database Release with the Source CDB
A non-CDB database can be upgraded as part of the upgrade of the source release CDB to the target release.
- About Adopting a Non-CDB as a PDB Using a PDB Plugin
To manually adopt a non-CDB as a PDB, you generate an XML file that describes a non-CDB, and use theDBMS_PDB.DESCRIBEprocedure. Afterward, plug in the non-CDB, just as you plug in an unplugged PDB. - Adopting a Non-CDB as a PDB
You can adopt (move) a non-CDB into a PDB by using theDBMS_PDB.DESCRIBEprocedure. - Plugging In an Unplugged PDB
You can create a PDB by plugging an unplugged PDB into a CDB.
Parent topic: Using Other Methods for Oracle Database Upgrades
About Adopting a Non-CDB as a PDB Using a PDB Plugin
To manually adopt a non-CDB as a PDB, you generate an XML file that describes
a non-CDB, and use the DBMS_PDB.DESCRIBE procedure. Afterward, plug in the
non-CDB, just as you plug in an unplugged PDB.
If you choose not to use the Capture Replay method of automatically adopting
and upgrading a non-CDB to a PDB, then you can use the manual procedure of describing
the non-CDB, and then adopting the non-CDB to a PDB. Create the PDB with the
CREATE PLUGGABLE DATABASE ... USING statement. When the non-CDB is
plugged in to a CDB, it is a new PDB, but not usable until the data dictionary is
converted, using the ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql script.
Figure 5-1 Plug In a Non-CDB Using the DBMS_PDB.DESCRIBE Procedure

Description of "Figure 5-1 Plug In a Non-CDB Using the DBMS_PDB.DESCRIBE Procedure"
You can use the same technique to create a new application PDB in an application container.
Adopting a Non-CDB as a PDB
You can adopt (move) a non-CDB into a PDB by using the
DBMS_PDB.DESCRIBE procedure.
-
Create the CDB if it does not exist.
-
Ensure that the non-CDB is in a transactionally-consistent state.
-
Place the non-CDB in read-only mode.
-
Connect to the non-CDB, and run the
DBMS_PDB.DESCRIBEprocedure to construct an XML file that describes the non-CDB.The current user must have
SYSDBAadministrative privilege. The user must exercise the privilege usingAS SYSDBAat connect time.For example, to generate an XML file named
ncdb.xmlin the/disk1/oracledirectory, run the following procedure:BEGIN DBMS_PDB.DESCRIBE( pdb_descr_file => '/disk1/oracle/ncdb.xml'); END; /After the procedure completes successfully, you can use the XML file and the non-CDB database files to plug the non-CDB into a CDB.
-
Run the
DBMS_PDB.CHECK_PLUG_COMPATIBILITYfunction to determine whether the non-CDB is compatible with the CDB.When you run the function, set the following parameters:
-
pdb_descr_file- Set this parameter to the full path to the XML file. -
pdb_name- Specify the name of the new PDB. If this parameter is omitted, then the PDB name in the XML file is used.
For example, to determine whether a non-CDB described by the
/disk1/oracle/ncdb.xmlfile is compatible with the current CDB, run the following PL/SQL block:SET SERVEROUTPUT ON DECLARE compatible CONSTANT VARCHAR2(3) := CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY( pdb_descr_file => '/disk1/oracle/ncdb.xml', pdb_name => 'NCDB') WHEN TRUE THEN 'YES' ELSE 'NO' END; BEGIN DBMS_OUTPUT.PUT_LINE(compatible); END; /If the output is
YES, then the non-CDB is compatible, and you can continue with the next step. If the output isNO, then the non-CDB is not compatible, and you can check thePDB_PLUG_IN_VIOLATIONSview to see why it is not compatible. All violations must be corrected before you continue. For example, any version or patch mismatches should be resolved by running an upgrade or the datapatch utility. After correcting the violations, runDBMS_PDB.CHECK_PLUG_COMPATIBILITYagain to ensure that the non-CDB is compatible with the CDB. -
-
Shut down the non-CDB.
-
Plug in the non-CDB.
For example, the following SQL statement plugs in a non-CDB, copies its files to a new location, and includes only the
tbs3user tablespace from the non-CDB:CREATE PLUGGABLE DATABASE ncdb USING '/disk1/oracle/ncdb.xml' COPY FILE_NAME_CONVERT = ('/disk1/oracle/dbs/', '/disk2/oracle/ncdb/') USER_TABLESPACES=('tbs3');If there are no violations, then do not open the new PDB. You will open it in the following step.
The
USER_TABLESPACESclause enables you to separate data that was used for multiple tenants in a non-CDB into different PDBs. You can use multipleCREATE PLUGGABLE DATABASEstatements with this clause to create other PDBs that include the data from other tablespaces that existed in the non-CDB. -
Run the
ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sqlscript. This script must be run before the PDB can be opened for the first time.If the PDB was not a non-CDB, then running the
noncdb_to_pdb.sqlscript is not required. To run thenoncdb_to_pdb.sqlscript, complete the following steps:-
Access the PDB.
The current user must have
SYSDBAadministrative privilege, and the privilege must be either commonly granted or locally granted in the PDB. The user must exercise the privilege usingAS SYSDBAat connect time. -
Run the
noncdb_to_pdb.sqlscript:@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
The script opens the PDB, performs changes, and closes the PDB when the changes are complete.
-
-
Open the new PDB in read/write mode.
You must open the new PDB in read/write mode for Oracle Database to complete the integration of the new PDB into the CDB. An error is returned if you attempt to open the PDB in read-only mode. After the PDB is opened in read/write mode, its status is
NORMAL. -
Back up the PDB.
A PDB cannot be recovered unless it is backed up.
Note:
If an error is returned during PDB creation, then the PDB being created can be in an
UNUSABLEstate. To check the state of a PDB, query theCDB_PDBSorDBA_PDBSview. You can learn more about PDB creation errors by checking the alert log. An unusable PDB can only be dropped. You must drop an unusable PDB before you try to create a PDB with the same name as the unusable PDB can be created.