Home » RDBMS Server » Networking and Gateways » TNS-12542, Address Already In Used
TNS-12542, Address Already In Used [message #261873] Thu, 23 August 2007 22:25 Go to next message
qbuck
Messages: 2
Registered: August 2007
Location: Jakarta
Junior Member

Hello,

I'd got this error, TNS-12542, address already in used on my multithreaded application.

After finding some documents about this error, it happen because other application used same port as my listener. But i'd assured that only my listener, but it didn't happen in the first running process, but after some processes (hundreds of processes).

I'm newbie on Oracle, so i don't know how to solve it.
Can you explained me why this happen? (like maybe because of connection timeout or limited queue connection, or else)..

I really appreciate all suggestion.

Thanks

Sandy

Re: TNS-12542, Address Already In Used [message #261874 is a reply to message #261873] Thu, 23 August 2007 22:33 Go to previous messageGo to next message
BlackSwan
Messages: 22839
Registered: January 2009
Senior Member
No Operating System name or version posted
No Oracle version to 4 decimal places.

As a wild guess, you might want to consider the following:

Cause
Problem is caused due to the fact that the free ports in the windows client has been exhausted and it is trying to make use of a port which is in TIME_WAIT state which gives the error TNS-12542: Address already in use.
Fix
There are 2 solutions available:

1.) Increase the free port range:
======================
Start Registry Editor (Regedt32.exe).

Locate the following key in the registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

On the Edit menu, click Add Value, and then add the following registry value:

Value Name: MaxUserPort Data Type: REG_DWORD Value: 65534

Valid Range: 5000-65534 (decimal) Default: 0x1388 (5000 decimal)

Description: This parameter controls the maximum port number used when an application requests any
available user port from the system. Normally, ephemeral (that is, short-lived) ports are allocated between the values of 1024 and 5000 inclusive.


2.) Decrease the value for TIME_WAIT state:
================================

TcpTimedWaitDelay (new in Windows NT versions 3.51 SP5 and later)
Key: Tcpip\Parameters
Value Type: REG_DWORD - Time in seconds
Valid Range: 30-300 (decimal)
Default: 0xF0 (240 decimal)

Description: This parameter determines the length of time that a connection will stay in the TIME_WAIT state when being closed. While a connection is in the TIME_WAIT state, the socket pair
cannot be re- used. This is also known as the "2MSL" state, as by RFC the value should be twice
the maximum segment lifetime on the network. See RFC793 for further details.
Re: TNS-12542, Address Already In Used [message #261879 is a reply to message #261874] Thu, 23 August 2007 22:58 Go to previous messageGo to next message
qbuck
Messages: 2
Registered: August 2007
Location: Jakarta
Junior Member

Thanks for your fast response Anacedent,

I'm really sorry for lack of information,
FYI, i uses WinXP SP2 and also Oracle 8i (i don't know the four decimal version, i'll check it out later).

I'll check it later, because right now i don't have the oracle.

Thanks

Sandy
Re: TNS-12542, Address Already In Used [message #519692 is a reply to message #261879] Tue, 16 August 2011 06:04 Go to previous messageGo to next message
coolyogi91
Messages: 1
Registered: August 2011
Junior Member
Helo,
I'd got this error, TNS-12542, address already in used on my web application where 130 user login and working.

We are using windows 2003 server and oracle verion "Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi"
Re: TNS-12542, Address Already In Used [message #519695 is a reply to message #519692] Tue, 16 August 2011 06:17 Go to previous message
Michel Cadot
Messages: 59277
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
ORA-12542: TNS:address already in use
 *Cause: Specified listener address is already being used.
 *Action: Start your listener with a unique address.

What did you do from BlackSwan options above?

Regards
Michel
Previous Topic: ora 12514 not found. (Merge By ROD)
Next Topic: Oracle Procedural Gateway upgradation for IBM MQ
Goto Forum:
  


Current Time: Tue Sep 30 11:58:33 CDT 2014

Total time taken to generate the page: 0.09972 seconds