Unable To Connect To PDB
Unable To Connect To PDB
Unable To Connect To PDB
ORA-12154 and ORA-12154 generating when you are having issues with database
connectivity whenever you try to login into your database. In my scenario, I was
trying to install and configure Oracle Enterprise Manager 12c on my local system for
pratice purposes and for that I had installed repository database named as EMCTLDB.
This is a 12c database where EMCTLDB is the CDB name and EMCTLPDB is the
PDB name. After the database was installed, I made the entries in the
LISTENER.ORA and TNSNAMES.ORA like this,
LISTENER.ORA
(SID_DESC =
(GLOBAL_DBNAME = emctldb)
(ORACLE_HOME = F:\app\parain\product\12.1.0\dbhome_1)
(SID_NAME = emctldb)
)
(SID_DESC =
(GLOBAL_DBNAME = emctlpdb)
(ORACLE_HOME = F:\app\parain\product\12.1.0\dbhome_1)
(SID_NAME = emctlpdb)
)
TNSNAMES.ORA
EMCTLDB =
(DESCRIPTION =
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = emctldb)
)
)
EMCTLPDB =
(DESCRIPTION =
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = emctlpdb)
)
)
and then I restarted the LISTENER and checked for the status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=PARAIN0.corpnet.ifsworld.com)(PORT=1527)))
------------------------
Alias LISTENER2
SNMP OFF
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=PARAIN0.corpnet.ifsworld.com)
(PORT=1527)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1527ipc)))
Services Summary...
The status for both the EMCTLDB and EMCTLPDB Instances was showing
UNKNOWN. My main concern was with the PDB i.e. EMCTLPDB because I needed
the same to use as repository database for my Enterprise Manager Setup. So I tried to
use TNSPING to check for the connectivity and everything was good here,
C:\Users\parain>tnsping emctlpdb
TNS Ping Utility for 64-bit Windows: Version 12.1.0.2.0 - Production on 28-AUG-2018 11:56:45
F:\app\parain\product\12.1.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora
OK (0 msec)
C:\Users\parain>
But when I tried to login to the database, it failed with ORA-12154 and ORA-12518
C:\Users\parain>sqlplus system@emctlpdb
Enter password:
ERROR:
Enter password:
ERROR:
Enter password:
ERROR:
After a lot of searching in GOOGLE I got the idea of dynamic registration with
LISTENER and since I was able to login to my CBD i.e. EMCTLDB, I did this
Enter password:
Connected to:
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
local_listener string
SQL> quit
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
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=PARAIN0.corpnet.ifsworld.com)(PORT=1527)))
This time there were 2 instances for the services EMCTLDB and EMCTLPDB, one
with UNKNOWN state and other with READY. This might be because I used both
STATIC and DYNAMIC registration with LISTENER for the connectivity.
------------------------
Alias LISTENER2
SNMP OFF
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=PARAIN0.corpnet.ifsworld.com)
(PORT=1527)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1527ipc)))
Services Summary...
Enter password:
Connected to:
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>