Sunday, November 02, 2008

ORA-12514, After change port listener

Found Error, After changed port from default(1521) to new port

Example: changed to 1529

$ netstat -ltn | grep 1529
tcp 0 0 0.0.0.0:1529 0.0.0.0:* LISTEN

$ lsnrctl status

LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 02-NOV-2008 01:22:55

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1529)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
Start Date 02-NOV-2008 01:21:09
Uptime 0 days 0 hr. 1 min. 46 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File ORACLE_HOME/network/admin/listener.ora
Listener Log File ORACLE_HOME/log/diag/tnslsnr/host/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host)(PORT=1529)))
The listener supports no services
The command completed successfully


SQL> connect scott@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1529))(CONNECT_DATA=(SID=db)))
ORA-12514: TNS:listener does not currently know of service requested in connect

*** after you changed the default listener port number, the database instances will not be able to register themselves with this new listener. ***

Solve:

1. modified LOCAL_LISTENER parameter to point to the address of the local listener.

SQL> ALTER SYSTEM SET LOCAL_LISTENER="(address=(protocol=TCP)(host=localhost)(port=1529))" SCOPE=BOTH;
System altered.

$ lsnrctl status

LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 02-NOV-2008 02:05:26

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1529)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
Start Date 02-NOV-2008 02:05:04
Uptime 0 days 0 hr. 0 min. 22 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File ORACLE_HOME/network/admin/listener.ora
Listener Log File ORACLE_HOME/log/diag/tnslsnr/host/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host)(PORT=1529)))
Services Summary...
Service "db" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Service "db2XDB" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Service "db_XPT" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
The command completed successfully

SQL> conn scott@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1529))(CONNECT_DATA=(SERVICE_NAME=db)))
Enter password:
Connected

2. Edited tnsnames.ora file (for alias) in the same location as listener.ora file and then modified LOCAL_LISTENER parameter to point to that alias.

TNSNAMES.ORA

TESTLISTENER=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host )(PORT = 1529))
)

SQL> ALTER SYSTEM SET LOCAL_LISTENER='TESTLISTENER' SCOPE=BOTH;

System altered.


$ lsnrctl status

LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 02-NOV-2008 02:24:18

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1529)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
Start Date 02-NOV-2008 02:05:04
Uptime 0 days 0 hr. 19 min. 14 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File ORACLE_HOME/network/admin/listener.ora
Listener Log File ORACLE_HOME/log/diag/tnslsnr/host/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host)(PORT=1529)))
Services Summary...
Service "db" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Service "db2XDB" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Service "db_XPT" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
The command completed successfully

SQL> conn scott@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1529))(CONNECT_DATA=(SERVICE_NAME=db)))
Enter password:
Connected

...

4 comments:

Anonymous said...

Thanks, I was stuck for hours till i found this article.

Thanks!

Surachart said...

Welcome...

Anonymous said...

Thanks a lot. This reolved my issue.

Anonymous said...

Thank you very much. It has been very helpful. Solved my problem.