Oracle 12c: Conectando-se a PDB

12c

São criados SERVICEs automaticamente para cada PDB criado.

[ricardo@Melquior ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 14-APR-2015 08:37:05

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                14-APR-2015 08:06:55
Uptime                    0 days 0 hr. 30 min. 10 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/Melquior/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/PROD/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "PROD" has 1 instance(s).
  Instance "PROD", status READY, has 1 handler(s) for this service...
Service "PRODXDB" has 1 instance(s).
  Instance "PROD", status READY, has 1 handler(s) for this service...
Service "dev1" has 1 instance(s).
  Instance "PROD", status READY, has 1 handler(s) for this service...
Service "dev2" has 1 instance(s).
  Instance "PROD", status READY, has 1 handler(s) for this service...
Service "dev3" has 1 instance(s).
  Instance "PROD", status READY, has 1 handler(s) for this service...
The command completed successfully
[ricardo@Melquior ~]$

Portanto, basta adicionar o SERVICE no tnsnames.ora do cliente, ou conectar via EZCONNECT.

[ricardo@Melquior ~]$ sqlplus SCOTT/TIGER@//localhost:1521/dev1

SQL*Plus: Release 12.1.0.2.0 Production on Tue Apr 14 09:00:35 2015

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

Last Successful login time: Ter Abr 14 2015 08:38:39 -03:00

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>

Leave a Reply

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Esse site utiliza o Akismet para reduzir spam. Aprenda como seus dados de comentários são processados.