Skip to main content

12c Non-CDB to Container PDB with NOCOPY Option

12c NON-CDB to Container PDB

 

Steps for Non-CDB:


EBTUSPRD@EBTUSPRD> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
EBTUSPRD@EBTUSPRD> startup mount
ORACLE instance started.
Total System Global Area 3355443200 bytes
Fixed Size                  8626240 bytes
Variable Size            1040191424 bytes
Database Buffers         2164260864 bytes
Redo Buffers              142364672 bytes
Database mounted.
EBTUSPRD@EBTUSPRD> alter database open read only;
Database altered.

Create XML file:


BEGIN
  DBMS_PDB.DESCRIBE(
    pdb_descr_file => '/home/oracle/EBTUSPRDC.xml');
END;
/
PL/SQL procedure successfully completed.


Shutdown NON-CDB:


EBTUSPRD@EBTUSPRD> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

Steps for Container Database:


SET SERVEROUTPUT ON
DECLARE
  compatible CONSTANT VARCHAR2(3) :=
      CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
            pdb_descr_file => '/home/oracle/EBTUSPRDC.xml',
            pdb_name       => 'EBTUSPRDPDB1')
     WHEN TRUE THEN 'YES'
     ELSE 'NO'
 END;
 BEGIN
  DBMS_OUTPUT.PUT_LINE(compatible);
END;
/
YES => Result is yes
PL/SQL procedure successfully completed.

Create Pluggable Database:

  
CDB$ROOT@EBTUPRDC> CREATE PLUGGABLE DATABASE EBTUSPRDPDB1 using '/home/oracle/EBTUSPRDC.xml' nocopy tempfile reuse;
Pluggable database created.
Elapsed: 00:00:14.78

PDB Status:


CDB$ROOT@EBTUPRDC> select CON_ID, NAME, OPEN_MODE from V$PDBS;
    CON_ID NAME            OPEN_MODE
---------- --------------- ----------
         2 PDB$SEED        READ ONLY
         3 EBTUSPRDPDB1    MOUNTED
         4 EBTUPRDPDB1     READ WRITE

CDB$ROOT@EBTUPRDC> select  PDB_NAME, DBID , CON_ID, STATUS  from CDB_PDBS;
PDB_NAME              DBID     CON_ID STATUS
--------------- ---------- ---------- ----------
PDB$SEED         622332972          2 NORMAL
EBTUPRDPDB1     3965673099          4 NORMAL
EBTUSPRDPDB1    2894495381          3 NEW

Run noncdb_to_pdb.sql:


CDB$ROOT@EBTUPRDC> ALTER SESSION SET CONTAINER =EBTUSPRDPDB1;
Session altered.
Elapsed: 00:00:00.08
CDB$ROOT@EBTUPRDC> show con_name
CON_NAME
------------------------------
EBTUSPRDPDB1

@?/rdbms/admin/noncdb_to_pdb.sql => this step ran more than 15 Mins.(It may take time to compile invalids)




CDB$ROOT@EBTUPRDC> show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 EBTUSPRDPDB1                   MOUNTED

Open PDB:


CDB$ROOT@EBTUPRDC> ALTER PLUGGABLE DATABASE OPEN;
Pluggable database altered.
Elapsed: 00:00:09.49

CDB$ROOT@EBTUPRDC> show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 EBTUSPRDPDB1                   READ WRITE NO
CDB$ROOT@EBTUPRDC>
conn /as sysdba
CDB$ROOT@EBTUPRDC> sho pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 EBTUSPRDPDB1                   READ WRITE NO
         4 EBTUPRDPDB1                    READ WRITE NO

                                 
                                 




Comments

Post a Comment

Popular posts from this blog

ORA-65139: Mismatch between XML metadata file and data file

Error: CDB$ROOT@EBTUPRDC> CREATE PLUGGABLE DATABASE EBTUSPRDPDB1 using '/home/oracle/EBTUSPRDC.xml' nocopy tempfile reuse; CREATE PLUGGABLE DATABASE EBTUSPRDPDB1 using '/home/oracle/EBTUSPRDC.xml' nocopy tempfile reuse * ERROR at line 1: ORA-65139: Mismatch between XML metadata file and data file /u05/odb/ORADATA_1/EBTUSPRDC/datafile/system.1531.807800993 for value of fcpsb (2230502002 in the plug XML file, 2230505492 in the data file) Fix: Don't open Non-CDB database until we complete pdb creation other wise we will get above error. Shutdown immediate; startup mount; alter database open read only; create xml file. shutdown immediate; Connect to CDB and Create Pluggable database .

Useful OEM Queries to get Target details from OEM Repository

List Targets with TNS Listener ports configured : SELECT mgmt$target.host_name , mgmt$target.target_name , mgmt$target.target_type , mgmt$target_properties.property_name , mgmt$target_properties.property_value FROM mgmt$target , mgmt$target_properties WHERE ( mgmt$target.target_name = mgmt$target_properties.target_name ) AND ( mgmt$target.target_type = mgmt$target_properties.target_type ) and ( mgmt$target.target_type = 'oracle_listener' ) and ( mgmt$target_properties.property_name = 'Port' ); Devora02       LISTENER_ora02                       oracle_listener Port 1529 Devora01       LISTENER_ora01                       oracle_listener Port 1529 Devora04       LISTENE...

TFA-00002 : Oracle Trace File Analyzer (TFA) is not running

TFA Failed to start listening for commands on one of the Rac Node : As a root user /etc/init.d/init.tfa  start Starting TFA.. start: Job is already running: oracle-tfa Waiting up to 100 seconds for TFA to be started.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Successfully started TFA Process.. . . . . . TFA-00002 : Oracle Trace File Analyzer (TFA) is not running TFA Failed to start listening for commands Solution : run synctfanodes.sh  if you have root password . if no root password copy below files to TFA Failed node and try to restart TFA .. Please check whether these 4 files exist on all nodes are similar. TFA_HOME/server.jks TFA_HOME/client.jks TFA_HOME/internal/ssl.properties   TFA_HOME/internal/ portmapping.txt If not similar just copy these files to TFA Failing node and try TFA Restart ..It Worked for me .   [root@host01]# ./tfactl  -v "debug" start Starting TFA...