Thursday, August 20, 2020

TNS-12542 TNS Address Already in Use

 

Problem


While start the listener is prod database getting an error like  this TNS-12542: TNS:address already in use


LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 20-AUG-2020 06:06:57

 

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

 

Starting /oracle/app/oracle/product/12.1.0.2/dbhome/bin/tnslsnr: please wait...

 

TNSLSNR for Linux: Version 12.1.0.2.0 - Production

System parameter file is /oracle/app/oracle/product/12.1.0.2/dbhome/network/admin/listener.ora

Log messages written to /oracle/app/oracle/diag/tnslsnr/dbaclass-host/listener_prod/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=chaitanya-host)(PORT=1524)))

Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=chaitanya-host)(PORT=1524)))

TNS-12542: TNS:address already in use ---- >>>

TNS-12560: TNS:protocol adapter error

  TNS-00512: Address already in use

  Linux Error: 125: Address already in use

 

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


Solution


To find the solution we need to check the Listener file listener.ora


LISTENER_PROD =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = chaitanya-host)(PORT = 1524)) --- >>>

      (ADDRESS = (PROTOCOL = TCP)(HOST = chaitanya-host)(PORT = 1524)) --- >>>

 

    )

  )

 

SID_LIST_LISTENER_PROD =

  (SID_LIST =

    (SID_DESC =

      (SID_NAME = PRODDB)

      (ORACLE_HOME = /oracle/app/oracle/product/12.1.0.2/dbhome)

    )

  )


Inside the listener file we have found that two address entries in the same host and same port number (1524) so starting the listener it will get the conflict so unable to start the database


(ADDRESS = (PROTOCOL = TCP)(HOST = chaitanya-host)(PORT = 1524))

      (ADDRESS = (PROTOCOL = TCP)(HOST = chaitanya-host)(PORT = 1524))


To fix the error in give different port numbers for both the address entries



The listener will look like this after change the port numbers


LISTENER_PROD =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = chaitanya-host)(PORT = 1524)) --- >>>

      (ADDRESS = (PROTOCOL = TCP)(HOST = chaitanya-host)(PORT = 1525)) --- >>>

 

    )

  )

 

SID_LIST_LISTENER_PROD =

  (SID_LIST =

    (SID_DESC =

      (SID_NAME = PRODDB)

      (ORACLE_HOME = /oracle/app/oracle/product/12.1.0.2/dbhome)

    )

  )


Now start the listener 



# lsnrctl start LISTENER_PROD

 

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 20-AUG-2020 06:15:09

 

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

 

Starting /oracle/app/oracle/product/12.1.0.2/dbhome/bin/tnslsnr: please wait...

 

TNSLSNR for Linux: Version 12.1.0.2.0 - Production

System parameter file is /oracle/app/oracle/product/12.1.0.2/dbhome/network/admin/listener.ora

Log messages written to /oracle/app/oracle/diag/tnslsnr/chaitanya-host/listener_prod/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=chaitanya-host)(PORT=1524)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=chaitanya-host)(PORT=1525)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=chaitanya-host)(PORT=1524)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER_PROD

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production

Start Date                20-AUG-2020 06:15:09

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /oracle/app/oracle/product/12.1.0.2/dbhome/network/admin/listener.ora

Listener Log File         /oracle/app/oracle/diag/tnslsnr/chaitanya-host/listener_prod/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=chaitanya-host)(PORT=1524)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=chaitanya-host)(PORT=1525)))

Services Summary...

Service "PRODDB" has 1 instance(s).

  Instance "PRODDB", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully

 

 

Listener started successfully.


Listener started sucessfully and listener listening in on both the ports 1524 and 1525 so ports should be unique for each address in the listener


THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME OR SUBSCRIBE ME

 

ORA-00257 Archiver Error Connect Internal Only Until Freed

 ORA-00257: Archiver Error ,Connect Internal Only Until Freed


Problem


when an application users using database unable to connect to the database aplication log shows the error


ORA-00257:archiver error, connect internal only untill freed

ORA-16014:log1 sequence# 280 not archived,no available destinations

ORA-00312:online log1 thread 1:'/oradata/prod/redo01.log'


Solution


This error comes ,when the archive destination is full and there is no space availability in the destination location archivelogs


Check archivelog destination location


SQL> archive log list

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            /archive/PROD

Oldest online log sequence     14

Next log sequence to archive   18

Current log sequence           18


There are different solution for this Error rectification


Option-1:  Delete old archive logs to free up space using Rman utility


rman target /

delete archivelog all completed before 'sysdate-1';


Option-2: Change the archive log location 


incase you cannot  delete the archive logs from the destination location or existing location,then we can change the archive destination to some other mount point 


SQL>show parameter log_achive_dest;


NAME                     TYPE                     VALUE

log_archive_dest      string                  LOCATION =/archive/prod


SQL>alter  system set log_archive_dest= 'LOCATION=/u03/backupdest/archive/prod'  scope=both;


SQL>show parameter log_achive_dest;


NAME                     TYPE                     VALUE

log_archive_dest      string                  LOCATION =u03/backupsest/archive/prod


switch log file


alter sytem switch logfile;


THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME OR SUBSCRIBE ME


ITIL Process

ITIL Process Introduction In this Blog i am going to explain  ITIL Process, ITIL stands for Information Technology Infrastructure Library ...