Convert non CDB database to PDB database DBACLASS
Convert non CDB database to PDB database i.e Plugging a normal 12c non pdb database to a container database. create pluggable database NONCDB
oracle clusteringintermediate
by OracleDba
16 views
Convert non CDB database to PDB database i.e Plugging a normal 12c non pdb database to a container database. create pluggable database NONCDB
1234567891011121314151617181920212223242526272829303132
SQL> select name from v$database;
NAME
---------
NONCDB
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup open read only
ORACLE instance started.
Total System Global Area 1.8119E+10 bytes
Fixed Size 7641528 bytes
Variable Size 1.0133E+10 bytes
Database Buffers 7851737088 bytes
Redo Buffers 126574592 bytes
Database mounted.
Database opened.
SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
NONCDB READ ONLY
BEGIN
DBMS_PDB.DESCRIBE(pdb_descr_file => '/export/home/oracle/NonCDB.xml');
END;
/
PL/SQL procedure successfully completed.12345678910111213141516
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;
/12345678910111213141516171819202122232425262728
select name,cause,type,message,status from PDB_PLUG_IN_VIOLATIONS where name='NONCDB';
NAME CAUSE TYPE
-------------------- -------------------- ---------
MESSAGE STATUS
----------------------------------- ---------
NONCDB Non-CDB to PDB WARNING
PDB plugged in is a non-CDB, PENDING
requires noncdb_to_pdb.sql be run.
NONCDB Parameter WARNING
CDB parameter memory_target PENDING
mismatch: Previous 17280M Current
13856M
SQL> create pluggable database NONCDB using '/export/home/oracle/NonCDB.xml' NOCOPY;
create pluggable database NONCDB using '/export/home/oracle/NonCDB.xml' NOCOPY
*
ERROR at line 1:
ORA-27038: created file already exists
ORA-01119: error in creating database file '/archive/NONCDB/temp01.dbf'
--- As tempfile is already there, so mention tempfile reuse tag, to avoid this error.
SQL> create pluggable database NONCDB using '/export/home/oracle/NonCDB.xml' NOCOPY tempfile reuse;
Pluggable database created.1234567891011121314151617181920212223242526
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;
NAME OPEN_MODE
-------------------- ----------
PDB$SEED READ ONLY
PDB1 READ WRITE
PDB2 READ WRITE
NONCDB READ WRITEPlease to add comments
No comments yet. Be the first to comment!