Database Reference
In-Depth Information
Connecting to Pluggable Databases
Connections to PDBs are based on the service created automatically when the PDB is opened. The service name
equals the PDB name and is created and registered with the listener. This has two important implications:
1.
You need to use net services to connect to the PDB. Operating System authentication
(using “ops$-” accounts) is not possible
2.
EZConnect will prove really useful
3.
If you have two CDBs on your host and both have a PDB named PDB1 then you cannot
reliably connect to one or the other. Such a configuration should be avoided
Consider the following example of a listener started out of the Grid Infrastructure home, using the default values:
[oracle@server1 ~]$ lsnrctl service
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 25-SEP-2013 13:50:25
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
[...]
Service "CDB1" has 2 instance(s).
Instance "CDB1", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Instance "CDB1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
[...]
Service "pdb1" 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
Note the services PDB1 in the above output belonging to CDB1. When you open the PDB either read-only or read
write, you will see that the service is automatically created and started for you.
Some output has been removed for the sake of clarity. With this in place it is possible to connect to the PDB as
you would to any other service before Oracle 12.1. The obvious choice is to create a net service name for the user-PDB:
PDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = server1.example.com ) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdb1)
)
)
 
Search WWH ::




Custom Search