TNS-12542: TNS:address already in use

Listener port should be dedicated to listener only.

Trying to create a dedicated Listener for building active standby database without touching current listeners in a critical production environment. Then got those errors:

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 11-OCT-2016 14:24:31

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

Starting /u01/app/oracle/product/11.2.0/dbhome_2/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_2/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/racnode1/listener_standby/alert/log.xml
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1)(PORT=8888)))
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...

Checked port 8888 has been used :

$ netstat -na|grep -i 8888
tcp 0 0 127.0.0.1:34244 127.0.0.1:8888 TIME_WAIT
tcp 0 0 127.0.0.1:34245 127.0.0.1:8888 TIME_WAIT
tcp 0 0 ::ffff:127.0.0.1:8888 :::* LISTEN

SOLUTION

It is resolved by using a free port 9999.

$lsnrctl start LISTENER_STANDBY

$lsnrctl status LISTENER_STANDBY

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 11-OCT-2016 15:09:53

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1)(PORT=9999)))
STATUS of the LISTENER
------------------------
Alias LISTENER_STANDBY
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 11-OCT-2016 15:07:36
Uptime 0 days 0 hr. 2 min. 17 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_2/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/racnode1/listener_standby/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1)(PORT=9999)))
Services Summary...
Service "TSTSTBY1" has 1 instance(s).
 Instance "TSTSTBY1", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

ORA-01623: log 31 is current log for instance RACTEST3 (thread 3) – cannot drop

Disable thread before dropping the online redo logfiles.

Three nodes RAC database was migrated to two nodes RAC database, while trying to drop online redo logs of thread 3,  the errors are as below:

SQL> alter database drop logfile group 31;
alter database drop logfile group 31
*
ERROR at line 1:
ORA-01623: log 31 is current log for instance RACTEST3 (thread 3) - cannot drop
ORA-00312: online log 31 thread 3: '+DATA1/ractest/onlinelog/group_31.409.924815767'
ORA-00312: online log 31 thread 3: '+FRA/ractest/onlinelog/group_31.262.924815769'

SOLUTION

Disable thread 3 by :

SQL> alter database disable thread 3;

Database altered.

Then drop the redo logs successfully.

SQL> alter database drop logfile group 31;

Database altered.

SQL> alter database drop logfile group 32;

Database altered.

SQL> alter database drop logfile group 33;
Database altered.

...
..
.