0% found this document useful (0 votes)
14 views

Steps for Converting Non-CDB Database to PDB

Steps for converting non-CDB database to PDB

Uploaded by

mnsamysuresh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Steps for Converting Non-CDB Database to PDB

Steps for converting non-CDB database to PDB

Uploaded by

mnsamysuresh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Step for converting non-CDB database to PDB.

In this testcase setup:

Name of the Non-CDB Database is : 12cNonPDB

1. To convert non-CDB to PDB, you have to cleanly shutdown the DB:


. oraenv
set environment to 12cNonPDB
sqlplus / as sysdba
sql> shutdown immediate

2. Once the DB is shutdown cleanly, open it in read only mode:


sql> startup open read only

3. Describe the database and generate the xml file:


BEGIN
DBMS_PDB.DESCRIBE(pdb_descr_file => '/u01/12cNonPDB.xml');
END;
/

4. Shutdown the database.

sql> shutdown immediate

5. Check if it is compatible with cdb, run below in target CDB

SET SERVEROUTPUT ON;


DECLARE
compatible CONSTANT VARCHAR2(3) := CASE
DBMS_PDB.CHECK_PLUG_COMPATIBILITY(pdb_descr_file =>
'/u01/12cNonPDB.xml')
WHEN TRUE THEN 'YES'
ELSE 'NO'
END;
BEGIN
DBMS_OUTPUT.PUT_LINE(compatible);
END;
/

Check PDB_PLUG_IN_VIOLATIONS view from cdb database if error raised

SQL> col cause for a20


SQL> col name for a20
SQL> col message for a35 word_wrapped
SQL> select name,cause,type,message,status from PDB_PLUG_IN_VIOLATIONS
where name='<noncdb database name>';
In case you got errors like below:

ERROR PSU bundle patch 1 (PSU Patch 12345): Installed in the CDB but not in the
PDB.

ERROR PSU bundle patch 1 (PSU Patch 12345): Installed in the PDB but not in the
CDB.

You have to refer to Note 1935365.1 to fix them.

6. Connect to the CDB where database has to be plugged in:

. oraen
set environment to ACDB
sqlplus / as sysdba

7. Create a pluggable database


CREATE PLUGGABLE DATABASE SAI_PDB USING '/u01/12cNonPDB.xml'
COPY
FILE_NAME_CONVERT = ('/u01/app/oracle/12c/oradata/12cNonPDB/',
'/u01/app/oracle/oradata/12cPDB/');

8. Switch to the PDB container and run the


"$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql"

sql> ALTER SESSION SET CONTAINER=SAI_PDB;

sql> @$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql

9. Startup the PDB and check the open mode.

ALTER PLUGGABLE DATABASE OPEN;

SELECT name, open_mode FROM v$pdbs;

NAME OPEN_MODE
------------------------------ ----------
SAI_PDB READ WRITE

1 row selected.

SQL>

You might also like