Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

Convert Non CDB Database To PDB Database In Oracle 12c

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • User AvatarKiran Dalvi
  • 31 Aug, 2023
  • 0 Comments
  • 1 Min Read

Convert Non CDB Database To PDB Database In Oracle 12c

Convert Non CDB Database To PDB Database In Oracle 12c

The procedures for converting an Oracle non-CDB/PDB database to a PDB database are listed below. i.e Plugging a normal 12c non pdb database to a container database.

DB Name :

NON-CDB DB -NAME : – NONCDB

CDB DB NAME : – PRIM

1. Open the non-cdb database in read only mode:
1
2
3
4
SQL> select name from v$database;
SQL> shutdown immediate;
SQL> startup open read only
SQL> select name,open_mode from v$database;
  1. Check the compatibility of PDB on ( NONCDB)
 
1
2
3
4
5
6
BEGIN
DBMS_PDB.DESCRIBE(pdb_descr_file => '/export/home/oracle/NonCDB.xml');
END;
/
 
PL/SQL procedure successfully completed.
  1. shutdown NON-CDB database ( NONCDB)
1
2
3
4
5
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Now connect to the container database, where it need to be plugged.
1
2
3
4
5
6
7
8
9
10
SET SERVEROUTPUT ON;
DECLARE
compatible CONSTANT VARCHAR2(3) := CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(pdb_descr_file => '/export/home/oracle/NonCDB.xml')
WHEN TRUE THEN 'YES'
ELSE 'NO'
END;
BEGIN
DBMS_OUTPUT.PUT_LINE(compatible);
END;
/
  1. Check the violations:
1
select name,cause,type,message,status from PDB_PLUG_IN_VIOLATIONS where name='NONCDB';
  1. Create pluggable database ( PRIM)
1
SQL> create pluggable database NONCDB using '/export/home/oracle/NonCDB.xml' NOCOPY tempfile reuse;
7 . Run the noncdb_to_pdb.sql script
1
2
3
ALTER SESSION SET CONTAINER=NONCDB;
 
@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
  1. Open the PDB:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SQL> ALTER PLUGGABLE DATABASE OPEN;
 
Pluggable database altered.
 
SQL> SELECT name, open_mode FROM v$pdbs;
 
 
NAME OPEN_MODE
-------------------- ----------
NONCDB READ WRITE
 
1 row selected.
 
 
SQL> select name,open_mode from v$pdbs;