Convert Non-CDB Database to PDB Database
Non-CDB Database Name |
DB1 |
Non-CDB Database Version |
19.12.0.0 |
Target CDB Database Name |
CDB1 |
Target CDB Database Version |
19.12.0.0 |
- In DB1:
SQL> SHUTDOWN IMMEDIATE; SQL> STARTUP OPEN READ ONLY; |
SQL> exec dbms_pdb.describe(pdb_descr_file => '/tmp/19cDB1.xml'); PL/SQL procedure successfully completed. |
SQL> SHUTDOWN IMMEDIATE; |
- In CDB1:
SQL> SET SERVEROUTPUT ON; SQL> DECLARE compatible CONSTANT VARCHAR2(3) := CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(pdb_descr_file => '/tmp/19cDB1.xml') WHEN TRUE THEN 'YES' ELSE 'NO' END; BEGIN DBMS_OUTPUT.PUT_LINE(compatible); END; /
PL/SQL procedure successfully completed. |
SQL> col cause for a20 SQL> col message for a35 word_wrapped SQL> select cause, type, message, status from PDB_PLUG_IN_VIOLATIONS where name ='DB1';
|
SQL> CREATE PLUGGABLE DATABASE pdb1 USING '/tmp/19cDB1.xml' COPY FILE_NAME_CONVERT = ('+DATA', '+DATA2');
OR
SQL> CREATE PLUGGABLE DATABASE pdb1 USING '/tmp/19cDB1.xml' NOCOPY tempfile reuse;
|
SQL> alter session set container=PDB1; SQL> @$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql SQL> alter pluggable database PDB1 open; SQL> show pdbs
|
Document:
https://oracle-base.com/articles/12c/multitenant-migrate-non-cdb-to-pdb-12cr1
https://dbaclass.com/article/convert-non-cdb-database-to-pdb-database-in-oracle-12c/