Showing posts with label Listener. Show all posts
Showing posts with label Listener. Show all posts

Monday, September 27, 2010

TNS-12542: TNS:address already in use Linux Error: 98

Problem Description
After changing listener entry while you start the oracle listener it fails with error TNS-12542 like below.
[grid@DC-DB-01 ~]$ lsnrctl start listener2

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 19-SEP-2010 11:41:48

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

Starting /u01/app/11.2.0/grid/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/11.2.0/grid/network/admin/listener.ora
Log messages written to /u01/app/11.2.0/grid/log/diag/tnslsnr/DC-DB-01/listener2/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER2)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DC-DB-01)(PORT=1522)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DC-DB-01-vip)(PORT=1522)))
TNS-12542: TNS:address already in use
TNS-12560: TNS:protocol adapter error
TNS-00512: Address already in use
Linux Error: 98: Address already in use

Listener failed to start. See the error message(s) above...
The XML log file shows following message.
<msg time='2010-09-19T11:42:38.026+06:00' org_id='oracle' comp_id='tnslsnr'
type='UNKNOWN' level='16' host_id='DC-DB-01'
host_addr='192.168.100.101'>
<txt>Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DC-DB-01-vip)(PORT=1522)))
</txt>
</msg>
<msg time='2010-09-19T11:42:38.026+06:00' org_id='oracle' comp_id='tnslsnr'
type='UNKNOWN' level='16' host_id='DC-DB-01'
host_addr='192.168.100.101'>
<txt>TNS-12542: TNS:address already in use
TNS-12560: TNS:protocol adapter error
TNS-00512: Address already in use
Linux Error: 98: Address already in use
</txt>
</msg>
<msg time='2010-09-19T11:42:38.027+06:00' org_id='oracle' comp_id='tnslsnr'
type='UNKNOWN' level='16' host_id='DC-DB-01'
host_addr='192.168.100.101'>
<txt>No longer listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER2)))
</txt>
</msg>
<msg time='2010-09-19T11:42:38.027+06:00' org_id='oracle' comp_id='tnslsnr'
type='UNKNOWN' level='16' host_id='DC-DB-01'
host_addr='192.168.100.101'>
<txt>No longer listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DC-DB-01)(PORT=1522)))
</txt>
</msg>

Here goes listener.ora file contents.
LISTENER2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER2))
(ADDRESS = (PROTOCOL = TCP)(HOST =DC-DB-01)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =DC-DB-01-vip)(PORT = 1522))
)
)
Cause of the Problem
The "TNS-00512: Address already in use" is occurred as there is duplicate port used in same listener2 entry. It is not possible to start a listener using duplicate TCP port or IPC KEY values in a single listener.ora file configuration.

Solution of the Problem
The solution is edit the listener entry so that there does exist duplicate listener TCP port or IPC key. You can either change the port or IPC key or remove the duplicate entry. So either of the following two entries are valid.

LISTENER2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER2))
(ADDRESS = (PROTOCOL = TCP)(HOST =DC-DB-01)(PORT = 1522))

)
)
or,
LISTENER2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER2))
(ADDRESS = (PROTOCOL = TCP)(HOST =DC-DB-01)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =DC-DB-01-vip)(PORT = 1523))
)
)

Saturday, July 31, 2010

Troubleshoot ORA-12547: TNS: lost contact

Problem Description
Whenever you connect to database as sysdba it fails with ORA-12517 like below.
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.2.0 - Production on Sun Aug 01 11:27:27 2010
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:
Cause of the Problem
ORA-12547 indicates that the communication channel has been broken. Based on the scenarios cause and solution of the problem is discussed below.

1)Local connection as sysdba (Bequeath):
Problem
BEQ connection fails when connecting with / as sysdba

Cause
Oracle binaries have not been linked correctly

Solution
Relink the Oracle binaries by executing the following command,

$ ORACLE_HOME/bin relink all

2)Bequeath connections fail with ora-12547 and Remote connections fail with ORA-12500:

From the listener.log file it shows,
TNS-12500: TNS:listener failed to start a dedicated server process 
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
The version of the database server is 9.2.0.2

Cause
This is oracle bug 2654576 and happened due to the processes value reaches a limit.

Solution
i) The bug is fixed in patch set 9.2.0.3 and in 10g. So upgrade oracle database is a solution.

ii) Increase the PROCESSES parameter in the init.ora to a higher value for example 2000.

iii) If increasing the PROCESSES parameter does not help then increase the value of the hidden parameter.
_attach_count_slack = 2000

3) Remote connections to the database server fail with ORA-12547
Cause 1
SQLNET.INBOUND_CONNECT_TIMEOUT and/or INBOUND_CONNECT_TIMEOUT_listener_name is set in the database server's sqlnet.ora and listener.ora. If the client fails to establish a connection and complete authentication in the time specified defined by these parameter, then the database server terminates the connection.

If this is the case and your oracle database version is 10g and higher then ORA-3136 errors is reported in the alert.log.

Cause 2
TCP.VALIDNODE_CHECKING is active on the database server and the TCP.INVITED_NODES list does not have the IP address of the failing client.
Alternatively the TCP.EXCLUDED_NODES list contain the IP address of the failing client.

Solution 1
If problem happened due to cause 1 then SQLNET.INBOUND_CONNECT_TIMEOUT and/or INBOUND_CONNECT_TIMEOUT_listener_name to appropriate values.

Note that the database server and the listener has to be restarted for these parameters to take effect.

Solution 2
For cause 2 either add the IP address of the failing client in the TCP.INVITED_NODES list or remove it from the TCP.EXCLUDED_NODES list.

It is recommended to restart the database server and the listener for these parameters to take effect.

4) Listener fails to start with Oracle error ORA-12547
Cause
TCP.VALIDNODE_CHECKING is active on the database server and the TCP.INVITED_NODES list does not have the IP address of the failing client.
Alternatively the TCP.EXCLUDED_NODES list contain the IP address of the failing client.

Solution
Either add the IP address of the failing client in the TCP.INVITED_NODES list or remove it from the TCP.EXCLUDED_NODES list.
It is recommended to restart the database server and the listener for these parameters to take effect.

5) After changing /etc/system and rebooting system, the 10g R2 TNS Listener fails to start
$ lsnrctl start 
Starting /u01/oracle/product/10.2.0/Db_1/bin/tnslsnr: please wait...
TNSLSNR for Solaris: Version 10.2.0.1.0 - Production
System parameter file is /u01/oracle/product/10.2.0/Db_1/network/admin/listener.ora
Log messages written to /u01/oracle/product/10.2.0/Db_1/network/log/listener.log
Trace information written to /u01/oracle/product/10.2.0/Db_1/network/trace/listener.trc
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=server11)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc10)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server11)(PORT=1521)))
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
Solaris Error: 131: Connection reset by peer
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=extproc10)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Solaris Error: 146: Connection refused
Cause
This one is happened due to a DNS client process, 'BIND 9' not running/started on the Solaris 10 Server.

Solution
You need to start the BIND 9 DNS Client on the Solaris10 Server.

Saturday, July 10, 2010

While startup listener it fails with HPUX Error: 29: Illegal seek

Problem Description
While issuing "lsnrctl start" command on HP-UX it fails with HPUX Error: 29: Illegal seek error like below.
ORACLE:/home>lsnrctl start 

LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 09-JUL-2010 22:19:41

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

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

TNS-12537: TNS:connection closed
TNS-12560: TNS:protocol adapter error
TNS-00507: Connection closed
HPUX Error: 29: Illegal seek
"lsnrctl status" command also with error HPUX Error: 239: Connection refused
ORACLE:/home>lsnrctl status 

LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 09-JUL-2010 22:33:21

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1621)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
HPUX Error: 239: Connection refused
On Linux, the error stack may look like this:
TNS-12547: TNS:lost contact 
TNS-12560: TNS:proto adapter error
TNS-00517: Lost contact
Linux IA64 Error: 104: Connection reset by peer

Cause of the Problem
The problem happened due to incorrect settings of /etc/hosts file or host user is unable to read the /etc/hosts file. TNS Listener fails while attempting to initiate subscription to ONS node down event.

Solution of the Problem
1) Verify that OS user has permission on /etc/hosts file.
$ls -l /etc/hosts

2) Verify that the /etc/hosts file contains the localhost entry in the following form:

127.0.0.1 localhost.localdomain localhost
10.1.10.2 myhost.arjudba.blogspot.com myhost

3) If you are not in RAC environment explicitly disable the 10g TNS Listener's subscription to ONS by editing the listener.ora file and add the parameter below in the listener.ora file.

SUBSCRIBE_FOR_NODE_DOWN_EVENT_{listener_name}=OFF

where {listener_name} would be replaced with the actual listener name configured in the listener.ora file.

For example, if the listener name is LISTENER (which is default listener), the parameter would be:

SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF

4) Start the listener.
$ lsnrctl start

Monday, March 29, 2010

TNS-01169: The listener has not recognized the password

Problem Description
oracle:/databridge/db DBGEP> $ lsnrctl status LISTENER

LSNRCTL for HPUX: Version 9.2.0.8.0 - Production on 28-MAR-2010 21:19:33

Copyright (c) 1991, 2006, Oracle Corporation. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ravel.gov)(PORT=1521)))
TNS-01169: The listener has not recognized the password

Cause of the Problem
The TNS-01169 error occurred because security feature is enabled for listener i.e password is set in listener.ora file but lsnrctl command is issued without proper authentication.

Solution of the Problem
After you enable listener password in Oracle 9i, you will now require a password whenever you wish to stop the listener or any other listener actions. However in Oracle database 10g, if you are not logged into the operating system with a privileged account i.e OS user is a member of dba group, you will have to enter a password while doing any operation to listener.

As we see from the message our listener version is 9.2.0.8.0 so follow the following steps to solve the problem.

A) If you remember listener password:
Step 01: Invoke lsnrctl command.
$lsnrctl

Step 02: Set the current_listener to the appropriate listener to which you want to do operation.
LSNRCTL> set current_listener {listener_name_here}

Note that you have to issue "set current_listener {listener_name_here}" if your listener name is not default name that is LISTENER.

Step03: Set password to the password that you previously set for listener.
LSNRCTL> set password {password_here}
or simply you can do it interactively as,

LSNRCTL> set password
Password: {enter_your_password_here}

Step 04: Issue your appropriate command.
LSNRCTL> status
or,
LSNRCTL> stop

B) If you forget listener password:
If password is set in plain text within listener.ora file
If you forget listener password then look for listener.ora and see if password is set in plain text. If it is in plain text then you can retrieve it easily and use that in "set password" command and then do operation as you wanted.

If password is encrypted within listener.ora file
Step 01:
If password is set in encrypted format, check the listener process by issuing,
$ps -ef |grep tns
and note down the process id.

Step 02:
Kill the listener process by,
$kill -9 {process_id}

Step 03:
Remove the line PASSWORDS_{listener_name} from the listener.ora file.

Step 04:
Start the listener
$lsnrctl start {listener_name}
and set the password if you want to set the password again. In order to set the password have a look at, How to set listener password

Related Documents
ORA-12518: TNS:listener could not hand off client connection
The listener supports no services
lsnrctl start fails with TNS-12541, TNS-12560,TNS-00511, Linux Error: 111:
Listener Hangs, Child listener process remains persistence
EM Daemon is not running
ORA-12541: TNS:no listener
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Login to Dbconsole, Authentication failed!null Returned
How to Enable Listener Logging and Tracing

TNS-01150: The address of the specified listener name is incorrect

Problem Description
While start Oracle listener it fails with error "TNS-01150: The address of the specified listener name is incorrect" like below.
E:\Arju>lsnrctl start LISTENER12

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-MAR-2010 10:38:21

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

Starting tnslsnr: please wait...

TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
System parameter file is E:\oracle\product\10.2.0\db_2\network\admin\listener.ora
Log messages written to E:\oracle\product\10.2.0\db_2\network\log\listener12.log
TNS-01150: The address of the specified listener name is incorrect

Listener failed to start. See the error message(s) above...
Problem Investigation
If you open the logfile "Log messages written to E:\oracle\product\10.2.0\db_2\network\log\listener12.log" as suggest in the error message above you will see an entry like,
TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-MAR-2010 15:51:16

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

System parameter file is E:\oracle\product\10.2.0\db_2\network\admin\listener.ora
Log messages written to E:\oracle\product\10.2.0\db_2\network\log\listener12.log
Trace information written to E:\oracle\product\10.2.0\db_2\network\trace\listener12.trc
Trace level is currently 0

Started with pid=4644
TNS-01150: The address of the specified listener name is incorrect
But unfortunately you no longer will see trace file information in the file "E:\oracle\product\10.2.0\db_2\network\trace\listener12.trc" as written in listener log file unless you have enable listener tracing.

Cause of the Problem
The problem happened because the address on which the listener attempted to listen contains a syntax error or have indention problem.

Solution of the Problem
My listener entry within listener.ora file was like below which cause TNS-01150 error.
LISTENER12 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1524))
)
I changed the indentation as,
LISTENER12 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1524))
)
Now starting the listener is working perfect.
E:\Arju>lsnrctl start LISTENER12

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-MAR-2010 18:48:28

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

Starting tnslsnr: please wait...

TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
System parameter file is E:\oracle\product\10.2.0\db_2\network\admin\listener.ora
Log messages written to E:\oracle\product\10.2.0\db_2\network\log\listener12.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1524)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER12
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Start Date 29-MAR-2010 18:48:29
Uptime 0 days 0 hr. 0 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File E:\oracle\product\10.2.0\db_2\network\admin\listener.ora
Listener Log File E:\oracle\product\10.2.0\db_2\network\log\listener12.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1524)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "a" has 1 instance(s).
Instance "a", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
Note that, a variant of above problem throws following TNS-01150:, NL-00303: if the indention/syntax is not ok.
E:\Arju>lsnrctl stop LISTENER12

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-MAR-2010 18:50:58

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

TNS-01150: The address of the specified listener name is incorrect
NL-00303: syntax error in NV string

So as soon as you hit TNS-01150 look for your Oracle version listener.ora syntax and make sure you have tab starting from second lines in listener entry.

Related Documents
ORA-12518: TNS:listener could not hand off client connection
The listener supports no services
lsnrctl start fails with TNS-12541, TNS-12560,TNS-00511, Linux Error: 111:
Listener Hangs, Child listener process remains persistence
EM Daemon is not running
ORA-12541: TNS:no listener
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Login to Dbconsole, Authentication failed!null Returned
How to Enable Listener Logging and Tracing
How to set oracle listener password

Friday, March 26, 2010

How to set oracle listener password

In general there are three ways by which you can set Oracle database listener password.
A. Editing the listener.ora file directly and setting the password within it.
B. Using lsnrctl utility.
C. Using GUI such as Oracle Net Manager or Enterprise Manager.

A. Editing the listener.ora file directly and setting the password within it:
Through this method password is stored in a plain text format inside listener.ora file without any encryption. Note that, through this way it is possible to set more than one listener password. Following steps demonstrate the procedure.

Step 01: Locate the listener.ora file. Based on the operating system and environmental settings the location varies. The default location is $ORACLE_HOME/network/admin or if you set TNS_ADMIN environmental variable then it overrides default location. Alternatively, if your listener is up you can issue "lsnrctl status" command to check the location of listener.ora file.
E:\>lsnrctl status

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 27-MAR-2010 09:40:38

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Start Date 27-MAR-2010 09:36:06
Uptime 0 days 0 hr. 4 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File E:\oracle\product\10.2.0\db_2\network\admin\listener.ora
Listener Log File E:\oracle\product\10.2.0\db_2\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "a" has 1 instance(s).
Instance "a", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

Step 02: After you locate listener.ora file check its contents.
For example, following is my listener.ora file contents.
# listener.ora Network Configuration File: E:\oracle\product\10.2.0\db_2\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
(SID_DESC=
(GLOBAL_DBNAME=a)
(ORACLE_HOME=E:\oracle\product\10.2.0\db_1)
(SID_NAME=a)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)

Step 03: Add a password line corresponding to the listener.
From above contents you see my listener has the default name LISTENER from lines,
LISTENER =
(DESCRIPTION_LIST =
It is the line starting LISTENER= . Within listener.ora file we need to add a line to this file with the following format:
   PASSWORDS_{LISTENER_NAME}=listener_password
Here the listener is called LISTENER then we need a add following lines within the listener.ora file.
 PASSWORDS_LISTENER=listener_password
You can also set multiple passwords as follows:
   PASSWORDS_LISTENER=(password1,password2)
For example I want to have my "LISTENER" listener password as "arjudba" so my listener.ora file will look like,
# listener.ora Network Configuration File: E:\oracle\product\10.2.0\db_2\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
(SID_DESC=
(GLOBAL_DBNAME=a)
(ORACLE_HOME=E:\oracle\product\10.2.0\db_1)
(SID_NAME=a)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
PASSWORDS_LISTENER=arjudba
Note that, After you set password in 9i, you will now require a password whenever you wish to stop the listener or any other "destructive" listener actions. However in Oracle database 10g, if you are not logged into the operating system with a privileged account, you will have to enter a password while doing any destructive operation to listener. Like,
$ lsnrctl
LSNRCTL> set password

B. Using lsnrctl utility.
With the lsnrctl utility you can secure your password by making password encrypted. Setting password through lsnrctl utility is a recommended option. Step by step it is demonstrated.

Step 01: Invoke lsnrctl utility.
E:\>lsnrctl

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 27-MAR-2010 11:24:26

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

Welcome to LSNRCTL, type "help" for information.
Step 02: Set the current listener to which you want to set password.
LSNRCTL> set current_listener listener
Current Listener is listener
Step 03: Invoke change_password command:
After invoking change_password it will prompt you for old password, if you have any old password set then type that. But if you don't have any old password then simply press Enter.
Then it will prompt you for the new password which you want to set and then press enter.
Then it will again prompt you to reenter the new password for confirmation and then press enter.
After this password will be changes for running instance or session of the listener.
LSNRCTL> change_password
Old password:
New password:
Reenter new password:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
Password changed for listener
The command completed successfully
Step 04: Set up password for the all future instance or session:
Issue "set password" and "save_config" command if want it applicable for all the future instance or session. Issuing "save_config" command you save the configuration file after setting the password otherwise it will be lost.

LSNRCTL> set password
Password:
The command completed successfully
LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
Saved LISTENER configuration parameters.
Listener Parameter File E:\oracle\product\10.2.0\db_2\network\admin\listener.ora
Old Parameter File E:\oracle\product\10.2.0\db_2\network\admin\listener.bak
The command completed successfully

After you set password using lsnrctl utility if you open listener.ora file you will see a new entry like below which is an encrypt one.
#----ADDED BY TNSLSNR 27-MAR-2010 11:37:15---
PASSWORDS_LISTENER = 44A81038BB249678
#--------------------------------------------

C. Using GUI such as Oracle Net Manager or Enterprise Manager.
Invoke netca or using Eneterprise Manager you can add listener password as directed by graphical window.

Related Documents
ORA-12518: TNS:listener could not hand off client connection
The listener supports no services
lsnrctl start fails with TNS-12541, TNS-12560,TNS-00511, Linux Error: 111:
Listener Hangs, Child listener process remains persistence
EM Daemon is not running
ORA-12541: TNS:no listener
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Login to Dbconsole, Authentication failed!null Returned
How to Enable Listener Logging and Tracing

Wednesday, February 4, 2009

ORA-12518: TNS:listener could not hand off client connection

Error Description
With sqlplus whenever you connect to a database san it fails with error ORA-12518.
C:\>sqlplus arju/a@san

SQL*Plus: Release 11.1.0.6.0 - Production on Wed Feb 4 20:59:26 2009

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

ERROR:
ORA-12518: TNS:listener could not hand off client connection

Cause of the Problem
ORA-12518 indicates a problem while listener handing off the client connection to the server process or dispatcher process. This problem can happen in many scenarios. Like if there is limited resource on the server computer so that it is unable to establish a new connection. Also if there is processes limit in the database initialization parameter this problem may happen. On windows if the service is unavailable then ORA-12518 problem might happen.

Solution of the Problem
Step 01: Check whether your listener version is compatible with database.
If listener version is not compatible with the database version then ORA-12518 likely to occur. The general rule is to use always higher version of listener. If you have both 9i and 10g database then always use 10g listener. If you use 9i listener then connection to 10g database may fail with 9i listener.

Step 02: Gather information from listener log file.
Make sure which version of listener you are using and check your listener.ora file as well as always check listener log file after ORA-12518 occur. By lsrnctl status command you can see log file. Check contents of the log file. Check listener parameter file and see listener version.

C:\>lsnrctl status
LSNRCTL for 32-bit Windows: Version 11.1.0.6.0 - Production on 04-FEB-2009 20:49:32

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.1.0.6.0 - Production
Start Date 04-FEB-2009 20:47:22
Uptime 0 days 0 hr. 2 min. 12 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File F:\app\Administrator\product\11.1.0\db_1\network\admin\listener.ora
Listener Log File f:\app\administrator\diag\tnslsnr\5a0c04b78203433\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.4.12.233)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 2 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "san" has 1 instance(s).
Instance "san", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

Below is the from listener log file,

TNS-12518: TNS:listener could not hand off client connection
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error
32-bit Windows Error: 2: No such file or directory



From the log file we see No such file or directory. This windows Error appears on windows machine whenever database service is not available.

The solution is to make sure that you can connect to database as sysdba and your database service is open. You can start your database service from command propmt by,
sc start {oracle_service_name}

Alternatively, right click on my computer, then click manage> click services> find the oracle service and start then.

Step 03Check the listener service handle in block state: Issue lsnrctl services and see status information under the database service name. Check the state and see if the state is in blocked.
$lsnrctl status
.
.
Service "san" has 2 instance(s).
Instance "san", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:10 refused:4276
LOCAL SERVER
Instance "san", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:138 refused:0 state:ready
LOCAL SERVER
.
.

If state is in blocked state then connection is not possible. The state of a handler can be in blocked state if,
1)Database in startup or shutdown process.
or,
2)The initialization parameter value of PROCESSES has reached it's limit.

In this case if you are in dedicated server mode you need to increase static processes parameter.

If you are in shared server mode and your connection is refused based on limits then increase the dispatcher parameter.

Step 04 Check if local connection as sysdba is successful: Check whether you can connect to database as sys user as sysdba. If local connection is ok then check database open_state. Also check v$instance view fields like status, active_state, blocked fields.

Step 05
Check the Processes is reached it's limit:
If local connection sys as sysdba is successful then query from v$resource_limit and see the processes parameter.
SQL> select * from v$resource_limit where resource_name='processes';

RESOURCE_NAME CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LIMIT_VALU
------------------------------ ------------------- --------------- ---------- ----------
processes 120 150 150 150

If max_utilization reached the limit value then consider to increase the static processes parameter.

The summary of ORA-12518 error is it may caused by many reasons and always check you listener.log file and alert log file to solve it.

Monday, February 2, 2009

The listener supports no services

Problem Description
Whenever I issue lsnrctl status command it says "The listener supports no services" and no one from outside could not connect to database through listener.

$lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 02-FEB-2009 16:22:01

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 02-FEB-2009 05:07:47
Uptime 0 days 11 hr. 14 min. 14 sec
Trace Level support
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /var/opt/oracle/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /var/opt/oracle/oracle/product/10.2.0/db_1/network/log/listener.log
Listener Trace File /var/opt/oracle/oracle/product/10.2.0/db_1/network/trace/listener.trc
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
The listener supports no services
The command completed successfully

Below is my listener.ora file entry,

$ cat /var/opt/oracle/oracle/product/10.2.0/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /usr/oracle/product/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST =127.0.0.1)(PORT = 1521))
)
)


Cause of the Problem
A listener is configured with one or more listening protocol addresses, information about supported services, and parameters that control its run time behavior. Upon database startup, oracle process PMON register with listener service. If after database startup if a listener is created then database has no idea about the listener because inside listener.ora there is no entry of SID_LIST_{listener_name} where {listener_name} need to be replaced by your listener name.

Suppose if you have a listener named LISTENER then you should have a corresponding SID_LIST_LISTENER entry while will define $ORACLE_HOME and ORACLE_SID of the listener.

Problem Solution
I edited the listener.ora file as below.


$ cat /var/opt/oracle/oracle/product/10.2.0/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /usr/oracle/product/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /var/opt/oracle/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC=
(GLOBAL_DBNAME=thdb)
(ORACLE_HOME=/var/opt/oracle/oracle/product/10.2.0/db_1)
(SID_NAME=thdb)
)
)
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST =THAI_DB)(PORT = 1521))
)
)



Then bounce the listener by,
$lsnrctl stop
$lsnrctl start


And now listener supports service and from outside world you can connect to database.

$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 02-FEB-2009 16:49:06

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 02-FEB-2009 16:43:16
Uptime 0 days 0 hr. 5 min. 49 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /var/opt/oracle/oracle/product/10.2.0/db_1/network/adm in/listener.ora
Listener Log File /var/opt/oracle/oracle/product/10.2.0/db_1/network/log /listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=THAI_HP)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "thdb" has 1 instance(s).
Instance "thdb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
Related Documents

lsnrctl start fails with TNS-12541, TNS-12560,TNS-00511, Linux Error: 111:

Problem Description
Today while preparing a new production server we faced an interesting problem. After installing oracle database software and database no default listener is created, no sqlnet.ora file. However we manually create the listener.ora and sqlnet.ora as below.

Now if I start the listener it fails with TNS-12541, TNS-12560,TNS-00511, Linux Error: 111:Connection refused.

$lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 02-FEB-2009 15:51:20

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))

TNS-12541: TNS:no listener
TNS-12560: TNS: Protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=23.54.56.12)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS: Protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused

I tried many alternatives like changing host to IP address, localhost, hostname. But all fails. In the listener.ora file I set
TRACE_LEVEL_LISTENER = SUPPORT and I found the entry below.

..
..
..

02-FEB-2009 05:07:47:534] nsnainit: NS Connection version: 313
[02-FEB-2009 05:07:47:534] nsnainit: inf->nsinfflg[0]: 0xd inf->nsinfflg[1]: 0xd
[02-FEB-2009 05:07:47:534] nsnainit: "or" info flags: 0xd Translations follow:
native service(s) is (are) wanted
NA disabled remotely for this connection
NA services unavailable on both processes - negotiation not needed

[02-FEB-2009 05:07:47:534] nsnainit: "or" info flags: 0xd Translations follow:
native service(s) is (are) wanted
NA disabled remotely for this connection
NA services unavailable on both processes - negotiation not needed
"and" info flags: 0xd Translations follow:
native service(s) is (are) wanted
NA disabled remotely for this connection
NA services unavailable on both processes - negotiation not needed
..
..
..


Solution of the Problem
I guess the culprit is entry of /etc/hosts file. As if I set parameter host=localhost inside listener.ora it returns message localhost is not found.
Below was my /etc/hosts entry.

$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain THAI_HP

I changed this entry to below.
$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 THAI_HP localhost.localdomain localhost

And then everything goes ok.

Monday, January 26, 2009

Listener Hangs, Child listener process remains persistence

Problem Description
Some days ago in our database server we got a problem regarding listener issue. Our TNS Listener hangs. Below is the problem symtompts.

•The lsnrctl status or lsnrctl stop or lsnrctl reload does not respond. Just like it hangs after displays message connecting to ..... .

•No one from outside can connect to database.

•Local connection without listener was ok.

•Listener process takes high cpu than normal usage.

•Listener process forks. The word fork is an UNIX OS related term and it indicates listener process creates a copy of itself. The copied process is called child process and the original process is called a parent process. Due to load of the listener a child listener process is created and it remains persistent. Whenever we give ps -ef then two tnslsnr is shown as below.

$ ps -ef | grep tnslsnr
oracle 3102 1 0 Jan 01 ? 12:28 /var/opt/oracle/bin/tnslsnr LISTENER -inherit
oracle 5012 3102 0 Jan 25 ? 10:15 /var/opt/oracle/bin/tnslsnr LISTENER -inherit


From the output first one is parent listener process and second line is child listener process. For child listener process parent id is 3102.

Just killing the child process allows new connections to work until the problem reoccurs. So after seeing above and if listener hangs then do,
$kill -9 5012 3102

Cause of the Problem
This problem remains in oracle 10.1.0.3, 10.1.0.4, 10.1.0.4.2, 10.1.0.5, 10.2.0.1 and 10.2.0.2. The listener hangs if the child listener process is not closed i.e after creating child process it persists. Note that, child listener processes are not unusual, depending on traffic as well as when the OS grep snapshot is taken. However, a persistent secondary process (longer than 5 seconds) is not normal and may be a result of this referenced problem.

This listener hanging event can happen on a standalone server or on a RAC server.

Solution of the Problem
1)The issue is fixed in patchset 10.2.0.3 and in 10.2.0.4. So apply patchset.

2)Apply Patch 4518443 which is available in metalink. Download from metalink and apply on your databse server.

3)As a workaround, you can follow the following two steps if you don't like to apply patch now.

Step 01: Add the following entry in your listener.ora file.
SUBSCRIBE_FOR_NODE_DOWN_EVENT_{listener_name}=OFF

Where {listener_name} should be replaced with the actual listener name configured in the LISTENER.ORA file.

Suppose your have default listener name and it is LISTENER. Then in the listener.ora file(by default in location $ORACLE_HOME/network/admin on unix) add the following entry in a new line,

SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF


Step 02: Go to directory cd $ORACLE_HOME/opmn/conf , find ons.config and move it to another location. Like,

cd $ORACLE_HOME/opmn/conf
mv ons.config ons.config.bak


After completing above two steps bounce the listener.

lsnrctl stop
lsnrctl start


Alternatively, you can simply issue,
$lsnrctl reload
if database availability is important.
Note that adding the SUBSCRIBE_FOR_NODE_DOWN_EVENT_{listener_name} to listener.ora file on RAC and disabling the ONS file, will mean that FAN (fast application notification) will not be possible. So, if you have a RAC configuration, then apply the patch and do not disable ONS or FAN.
Related Documents

Thursday, September 18, 2008

EM Daemon is not running

On windows whenever I try to start my dbconsole in one time during process it shows me message EM Daemon is not running.

First I invoke status command to see whether my dbconcole is started or not by,
C:\Documents and Settings\Queen>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://Queen:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is not running.
------------------------------------------------------------------
Logs are generated in directory E:\oracle\product\10.2.0\db_1/QUEEN_arju/sysman/log

So it is not running. To start it on windows you can fix it by,
Right click on my computer icon> Click Manage> Select Services and Application>Select Services>On the right side From a list a Name select OracleDBConsolearju where arju is the name of database> Right click on OracleDBConsolearju and click start.

or in other OS along with windows you can start with
$emctl start dbconsole
Now again see the status.
C:\Documents and Settings\Queen>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://Queen:1158/em/console/aboutApplication
EM Daemon is not running.
------------------------------------------------------------------
Logs are generated in directory E:\oracle\product\10.2.0\db_1/QUEEN_arju/sysman/log

The status has been changed now and it says EM Daemon is not running. In order to fix it you have to start the listener. To start listener you may follow,

Right click on my computer icon> Click Manage> Select Services and Application> Select Services> On the right side From a list a Name select OracleOraDb10g_home1TNSListener> Right click on OracleOraDb10g_home1TNSListener and click start.

Or in other OS along with windows you can start with,
$lsnrctl start [Listener_name]
Now let us see the status.
C:\Documents and Settings\Queen>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://Queen:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory E:\oracle\product\10.2.0\db_1/QUEEN_arju/sysman/log

Related Documents

Export and Import from Enterprise Manager
Login to Dbconsole, Authentication failed!null Returned

Tuesday, June 24, 2008

ORA-12541: TNS:no listener

For newbie users they found ORA-12541 and search here and there to solve the problem. But it is one word about the error which it says no listener and think next what to do. Never mix this error with another error like ORA-12514: which are different and mutually exclusive.

Error Description
---------------------------------------------
-bash-3.00$ sqlplus arju/a@neptune/saturn


SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 24 06:39:15 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

ERROR:
ORA-12541: TNS:no listener

Cause of the Problem:
--------------------------------------

Listener service is not running in the database to which you are requested to connect. Here we see that is neptune database. If you use tnsnames.ora then look at host parameter value in it.

Solution of the Problem:
----------------------------------

Solution of the problem is straightforward which is start the listener. It is done by lsnrctl start in the server machine to which you connect.
Step1:
---------

First check status by
$lsnrctl status

If you have default named listener which is LISTENER then lsnrctl status is fine. However if you don't have default listener then from listerner.ora see the available listener. And use that name after status. If your listener name is TEST_LISTERNER then use,
$lsnrctl status TEST_LISTERNER
LSNRCTL for Solaris: Version 10.2.0.1.0 - Production on 24-JUN-2008 06:55:08

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Solaris Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=neptune)(PORT=1522)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Solaris Error: 146: Connection refused

If you get TNS-00511 then go to step 2 otherwise if you get listener status then go to step 3.

Step 2:
---------------

Start the listener.
If you have default listener then use
-bash-3.00$ lsnrctl start

LSNRCTL for Solaris: Version 10.2.0.1.0 - Production on 24-JUN-2008 06:53:50

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

Starting /oracle/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
.
.

If you have other than default then use that name like,
$ lsnrctl start NON_DEFUALT_LISTENER
Step 3:
--------------

It is natural after starting listener service it takes minute to register the service of the listener. You can dynamically service of the listner by issuing following command in SQL*Plus,
SQL> alter system register;
System altered.

Step 4:
------------------

Try to connect to database using connection identifier. If you still get error ORA-12541 then check the addition settings of the connection identifier. If you use tnsnames.ora then also check settings listener post. This all can be seen after issuing lsnrctl status command

Like in this example my listener port is 1522 and if I use 1521 in my connection identifier error will come.
-bash-3.00$ lsnrctl status

LSNRCTL for Solaris: Version 10.2.0.1.0 - Production on 24-JUN-2008 07:02:18

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Solaris: Version 10.2.0.1.0 - Production
Start Date 24-JUN-2008 07:01:52
Uptime 0 days 0 hr. 0 min. 26 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=neptune)(PORT=1522)))
.
.

-bash-3.00$ sqlplus arju/a@neptune:1521/dbase

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 24 07:06:00 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

ERROR:
ORA-12541: TNS:no listener

As listener is running on port 1522 so connect to port 1521 will fail.
-bash-3.00$ sqlplus arju/a@neptune:1522/dbase


SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 24 07:06:15 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

In this post I will try to show how efficiently we can avoid error ORA-12514. My suggestion is whenever you get this error forget about tnsnames.ora and other stuff related to it. Start fixing problem step by step.

Problem Description:
Whenever you try to connect to database the following error comes.
-bash-3.00$ sqlplus arju/a:1522/dba

SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jun 24 06:35:02 2008

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.

ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

Cause of The problem:

The services named issued with the connection identifier has not been registered yet.

Solution of The Problem:
After getting above error forget any tnsnames.ora file. Issue lsnrctl status command on the server to which you try to connect like,
-bash-3.00$ lsnrctl status

LSNRCTL for Solaris: Version 10.2.0.1.0 - Production on 24-JUN-2008 07:17:56

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Solaris: Version 10.2.0.1.0 - Production
Start Date 24-JUN-2008 07:01:52
Uptime 0 days 0 hr. 16 min. 4 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=neptune)(PORT=1522)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "dbase" has 1 instance(s).
Instance dbase, status READY, has 1 handler(s) for this service...
Service "dbaseXDB" has 1 instance(s).
Instance "dbase", status READY, has 1 handler(s) for this service...
Service "dbase_XPT" has 1 instance(s).
Instance "dbase", status READY, has 1 handler(s) for this service...
The command completed successfully

Now closely look at the bolded items above , it is host, port, service and optionally instance.
Now use it in the connection descriptor as follows.

sqlplus user_id/password@host:port/service

Like here,
$sqlplus arju/a@neptune:1522/dbase
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 24 07:21:19 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

This method of connecting to database is called Easy Connect Naming Method.

Related Documents:
ORA-12541: TNS:no listener