Oracle 12c - Non CDB, CDB

 

In 12c, for the database creation, you have the option to choose either a non-container database (non-CDB --> pre12c architecture) or a Container database (CDB --> 12c multitenancy architecture). You can easily migrate a non-CDB database into a CDB database. However, You will not be able to migrate a CDB database back to the old architecture, non-CDB database.

By default, database will be created in pre12c mode. "Enable Pluggable Database" clause needs to be used inorder to make it as a CDB.

 

with DBCA :

Quick Mode
Advanced Mode
Quick Mode
Quick ModeDo not click the container option for non-CDB
1/3 
start stop bwd fwd

 

with SQLPLUS

The create database command is similar to the one that is used for creating any 11g database. You need to explicitly choose the optional clause “Enable Pluggable Database” for the CDB.

 

The method of accessing a container database (CDB) is just same as connecting to a non-Container database

Connecting to CDB

Access from the server

[oracle@kirlinc dbs]$ . oraenv
ORACLE_SID = [ora12] ? 
The Oracle base remains unchanged with value /data/oracle/app/oracle
[oracle@kirlinc dbs]$ sqlplus sys as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Wed Apr 2 10:41:59 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Enter password: 

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> 


Access with TNS NAMES

SQL> conn sys@ora12 as sysdba
Enter password: 
Connected.
SQL> !tnsping ora12

TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 02-APR-2014 10:47:52

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
/data/oracle/app/oracle/product/12.1.0/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = kirlinc.home)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora12)))
OK (20 msec)

SQL> 


Access with Service Name, Easy Connect


[oracle@kirlinc admin]$ sqlplus sys/kiran@kirlinc:1521/ora12 as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Wed Apr 2 11:03:37 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> 

 

 

Connecting to PDB
You Can access PDB either with TNSNAMES or EASYCONNECT using service_name

With TNSNAMES

[oracle@kirlinc admin]$ sqlplus sys@pdbora12 as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Wed Apr 2 11:16:52 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Enter password: 

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_name

CON_NAME
------------------------------
PDBORA12
SQL> 

With EasyConnect

SQL> conn sys/kiran@kirlinc:1521/pdbora12 as sysdba
Connected.
SQL> show con_name

CON_NAME
------------------------------
PDBORA12
SQL> 

 

Copyright ©2018 Rajkiran Ghanta (deegeplanet.com)