With Oracle 12c multitenant databases connection is still normally performed through the Oracle networking files of listener.ora, tnsnames.ora, and sqlnet.ora. PDBs are contained within a specific CDBs thus no configuration of the listener is needed. The listener process will pick up all active PDBs on startup if the PDB is started within its CDB. However, you can test the connection to a PDB through the listener process as shown below.
- Logon to your Oracle Server as the oracle software owner.
[larry@linux2 ~]$ su – oracle
Password:
Last login: Mon Feb 24 09:57:56 EDT 2016 on pts/0
[oracle@linux2 ~]$
- Now start the listener with the command: lsnrctl start
[oracle@linux2 ~]$ lsnrctl start
LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 24-FEB-2016 10:58:06
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Starting /opt/app/oracle/product/12.1.0.2/db_1/bin/tnslsnr: please wait…
TNSLSNR for Linux: Version 12.1.0.2.0 – Production
System parameter file is /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
Log messages written to /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date 24-FEB-2016 10:58:06
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
Listener Log File /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))
Services Summary…
Service “cdb1” has 1 instance(s).
Instance “cdb1”, status UNKNOWN, has 1 handler(s) for this service…
The command completed successfully
[oracle@linux2 ~]$
- List all serviced SIDs and Services with the command: lsnrctl status.
[oracle@linux2 admin]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 24-FEB-2016 11:08:45
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date 24-FEB-2016 10:58:06
Uptime 0 days 0 hr. 10 min. 39 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
Listener Log File /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))
Services Summary…
Service “cdb1” has 2 instance(s).
Instance “cdb1”, status UNKNOWN, has 1 handler(s) for this service…
Instance “cdb1”, status READY, has 1 handler(s) for this service…
Service “cdb1XDB” has 1 instance(s).
Instance “cdb1”, status READY, has 1 handler(s) for this service…
Service “pdb1” has 1 instance(s).
Instance “cdb1”, status READY, has 1 handler(s) for this service…
The command completed successfully
[oracle@linux2 admin]$
NOTE: The Service pdb1 is being handled by the Instance cdb1. The SID you will see at the OS layer will be cdb1 and you will not see any SID named pdb1. PDB1 is a service which is handled by the SID cdb1.
- You can test the listener configuration by suppling the tnsping utility with the <machine_IP>:<Port>/<service_name> as below:
[oracle@linux2 admin]$ tnsping 10.30.15.75:1521/pdb1
TNS Ping Utility for Linux: Version 12.1.0.2.0 – Production on 24-FEB-2016 11:38:30
Copyright (c) 1997, 2014, Oracle. All rights reserved.
Used parameter files:
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=pdb1))(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))
OK (10 msec)
[oracle@linux2 admin]$
- This completes configuration of listener.ora file for PDB.
Larry Catt
OCP