11 September 2015

step by step to connect Container database and Pluggable database

How to connect Container database and Pluggable database

Container database (CDB1)
Pluggable database (ORCL)

[oracle@r12c ~]$ lsnrctl services

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 11-SEP-2015 11:20:03

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
Services Summary...
Service "cdb1.muthu.com" has 1 instance(s).
  Instance "cdb1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "cdb1XDB.muthu.com" has 1 instance(s).
  Instance "cdb1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1022 state:ready
         DISPATCHER <machine: r12c.muthu.com, pid: 13621>
         (ADDRESS=(PROTOCOL=tcp)(HOST=r12c.muthu.com)(PORT=60683))
Service "orcl.muthu.com" has 1 instance(s).
  Instance "cdb1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
The command completed successfully
[oracle@r12c ~]$ tnsping orcl

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 11-SEP-2015 11:20:25

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

Used parameter files:
/db/app/product/12.1.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.muthu.com)))
OK (0 msec)
[oracle@r12c ~]$ sqlplus system/manager@orcl  --  Pluggable database

SQL*Plus: Release 12.1.0.2.0 Production on Fri Sep 11 11:20:39 2015

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


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

SQL> select con_id, name, open_mode, total_size from v$pdbs;

    CON_ID NAME                           OPEN_MODE  TOTAL_SIZE
---------- ------------------------------ ---------- ----------
         4 ORCL                           READ WRITE 2945187840

SQL> show con_name;

CON_NAME
------------------------------
ORCL
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@r12c ~]$ sqlplus system/manager@cdb1 --  Container database

SQL*Plus: Release 12.1.0.2.0 Production on Fri Sep 11 11:22:17 2015

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

Last Successful login time: Fri Sep 11 2015 11:20:40 +05:30

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

SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL>

Keep learning.......

No comments: