Saturday, October 03, 2009

ORA-12154: TNS:could not resolve the connect identifier specified

Sometime you may start listener and want to connect by ORANET to the database immediately, but you receive the message "ORA-12154: TNS:could not resolve the connect identifier specified" after you investigate you found you listener still have no service register.

[tatshuya]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 03-OCT-2009 20:53:53

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

Starting /oracle/product/10.2.0/db/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.4.0 - Production
System parameter file is /oracle/product/10.2.0/db/network/admin/listener.ora
Log messages written to /oracle/product/10.2.0/db/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tatshuya.home.com)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tatshuya.home.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date 03-OCT-2009 20:53:53
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/10.2.0/db/network/admin/listener.ora
Listener Log File /oracle/product/10.2.0/db/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tatshuya.home.com)(PORT=1521)))
The listener supports no services
The command completed successfully


If you want to force Oracle's Listerner to have service you can wait or force a database to register service in listener by.

connect to sys or system.
[tatshuya]# sqlplus "/ as sysdba"

SQL> alter system register;

System altered.

Then check you listener status again.

[tatshuya]# lsnrctl status

LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 03-OCT-2009 21:06:41

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tatshuya.home.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date 03-OCT-2009 20:53:53
Uptime 0 days 0 hr. 12 min. 47 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/10.2.0/db/network/admin/listener.ora
Listener Log File /oracle/product/10.2.0/db/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tatshuya.home.com)(PORT=1521)))
Services Summary...
Service "tatshuya" has 1 instance(s).
Instance "tatshuya", status READY, has 1 handler(s) for this service...
Service "tatshuya_XPT" has 1 instance(s).
Instance "tatshuya", status READY, has 1 handler(s) for this service...
The command completed successfully


--TaTsHuYa--

No comments: