ORA-12542: TNS:address already in use In windows

One of our client getting the issue at application level, while getting some reports they experienced the issue ORA-12542: TNS:Address already in use.

Resolution for this issue is add the parameter MaxRange value 65534 in REG_DWORD. When I did this the issue got resolved.

Cause : In windows environment the available ports  are exhausted and the request is trying to use the port which is in TIME_WAIT state and given error ORA-12542: TNS:Address already in use.

Below are the steps to resolve the issue.

1. Go to run and regedit.
2. Go to HKEY_LOCAL_MACHINE>SYSTEM>CurrentControlSet>services>Tcpip>Parameters.
3. Right click on Parameter>New>Key select QWORD for 64bit, DWORD for 32bit



4. One Newfile will created at right side, then rename it to MaxUserPort and select that file  , select Decimal radio button , enter the value 65534.