DBA Hub

📋Steps in this guide1/3

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

oracle configurationintermediate
by OracleDba
13 views
1

Overview

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. NON-CDB DB -NAME : – NONCDB CDB DB NAME : – PRIM - Check the compatibility of PDB on ( NONCDB)

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
SQL> select name from v$database;
SQL> shutdown immediate;
SQL> startup open read only
SQL> select name,open_mode from v$database;

BEGIN
DBMS_PDB.DESCRIBE(pdb_descr_file => '/export/home/oracle/NonCDB.xml');
END;
/

PL/SQL procedure successfully completed.
2

Section 2

- shutdown NON-CDB database ( NONCDB) - Check the violations: - Create pluggable database ( PRIM)

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit

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;
/

select name,cause,type,message,status from PDB_PLUG_IN_VIOLATIONS where name='NONCDB';
3

Section 3

- Open the PDB:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SQL> create pluggable database NONCDB using '/export/home/oracle/NonCDB.xml' NOCOPY tempfile reuse;

ALTER SESSION SET CONTAINER=NONCDB;

@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql

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;

Comments (0)

Please to add comments

No comments yet. Be the first to comment!