Archive for the ‘Database’ Category

TNS-12542 ,12560 and 00512.

Wednesday, July 22nd, 2009


TNS-12542 ,12560 and 00512 while starting up Oracle Listener.
 

Disclaimer: Apply to a TEST environment first. Use on production systems is at DBAs own risk.

 

Errors:

Getting the following error when trying to startup Oracle listener:
TNS-12542: TNS:address already in use
 TNS-12560: TNS:protocol adapter error
  TNS-00512: Address already in use
   HPUX Error: 226: Address already in use
Listener failed to start. See the error message(s) above…

Description of the environment:
There are two databases on this HPUX server, one is 10g R4 and one is 9.2.0.7 each off course with their own ORACLE_HOME.

Fix:
To fix or prevent this error make sure the following are true:

1) Make sure the listener.ora in each ORACLE_HOME is pointing to ports not already utilized, for example make sure the Oracle 10g points to 1521 and that the 9.2.0.7 home points to 1525

2) Make sure the listener.ora in each home defines a listener name that does not already exists, meaning for example if listener.ora in the 10g home is defining default listener name LISTENER, then the 9.2.0.7 home should define a different listener name such as TEST or PROD:

Example:
PROD =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
        (ADDRESS = (PROTOCOL = TCP)(HOST = host_name.domain.com)(PORT = 1525))
    )
  )

 
3) When staring up the listener using command line lsnrctl start
then this would try to start a listener with the default name which is LISTENER, so if you already have a listener name LISTENER running on 1521 from the 10g home and you logon as the owner of the 9.2.0.7 home and issue the command line lsnrctl start, then you would get the following errors because it attempts to startup another listener with name LISTENER from the 9.2 home and off course if fails:

TNS-12542: TNS:address already in use
 TNS-12560: TNS:protocol adapter error
  TNS-00512: Address already in use
   HPUX Error: 226: Address already in use

Listener failed to start. See the error message(s) above…

 
To avoid this you must issue the following command to startup for example the listener named PROD on 9.2 home as defined in step 2:

lsnrctl start PROD



Google