ORACLE连接问题.TNS-12542: TNS: 地址已被占用
来源:互联网 发布:bootstrap经典案例源码 编辑:程序博客网 时间:2024/05/12 07:42
TNS-12542 Error When Executing Batch Jobs or in High Transaction Environment
TNS-12542 Error When Executing Batch Jobs or in High Transaction Environment
The information in this document applies to:
Oracle Net Services - Version: 8.1.7.4 to 10.1.0.0
Microsoft Windows 2000
Microsoft Windows XP (64-bit Itanium)
Microsoft Windows (32-bit)
Errors
TNS-00512 "Address already in use"
TNS-12542 TNS:address already in use
TNS-12560 "TNS:protocol adapter error"
Symptoms
TNS-12542 errors in log files when executing batch jobs or in high transaction environments. Client trace files will show
CLIENT TRACE FILE:
================
(3752) [10-JUN-2004 15:20:50:899] niotns: Calling address:
(DESCRIPTION=(SOURCE_ROUTE=OFF)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=tst81)(PORT=1526)))(CONNECT_DATA=(SID=sec)(SRVR=DEDICATED)(CID=(PROGRAM=c:windowssystem32inetsrvw3wp.exe)(HOST=SRVPDFTEST)(USER=userarchive))))
(3752) [10-JUN-2004 15:20:50:899] nscall: connecting...
(3752) [10-JUN-2004 15:20:50:899] nttgetport: port resolved to 1526
(3752) [10-JUN-2004 15:20:50:899] nttbnd2addr: looking up IP addr for host:tst81
(3752) [10-JUN-2004 15:20:50:899] nsopen: opening transport...
(3752) [10-JUN-2004 15:20:50:899] nttcnp: Validnode Table IN use; err 0x0
(3752) [10-JUN-2004 15:20:50:899] nttcni: trying to connect to socket 6628.
(3752) [10-JUN-2004 15:20:50:899] ntt2err: soc 6628 error - operation=1, ntresnt[0]=512, ntresnt[1]=48, ntresnt[2]=0
(3752) [10-JUN-2004 15:20:50:899] nserror: nsres: id=0, op=65, ns=12542,ns2=12560; nt[0]=512, nt[1]=48, nt[2]=0; ora[0]=0, ora[1]=0, ora[2]=0
(3752) [10-JUN-2004 15:20:50:899] nsopen: unable to open transport
(3752) [10-JUN-2004 15:20:50:899] nioqper: error from nscall
(3752) [10-JUN-2004 15:20:50:899] nioqper: nr err code: 0
(3752) [10-JUN-2004 15:20:50:899] nioqper: ns main err code: 12542
(3752) [10-JUN-2004 15:20:50:899] nioqper: ns (2) err code: 12560
(3752) [10-JUN-2004 15:20:50:899] nioqper: nt main err code: 512
(3752) [10-JUN-2004 15:20:50:899] nioqper: nt (2) err code: 48
(3752) [10-JUN-2004 15:20:50:899] nioqper: nt OS err code: 0
(3752) [10-JUN-2004 15:20:50:899] niqme: reporting NS-12542 error as ORA-12542
(3752) [10-JUN-2004 15:20:50:899] niomapnserror: returning error 12542
(3752) [10-JUN-2004 15:20:50:899] niotns: Couldn't connect, returning 12542
(432) [10-JUN-2004 15:20:50:899] nstimarmed: no timer allocated
SQLNET.LOG file:
=============
Fatal NI connect error 12542, connecting to:
(DESCRIPTION=(SOURCE_ROUTE=OFF)(ADDRESS=(PROTOCOL=TCP)(HOST=tst81)(PORT=1526))(CONNECT_DATA=(SID=sec)(SRVR=DEDICATED)(CID=(PROGRAM=c:windowssystem32inetsrvw
3wp.exe)(HOST=SRVPDFTEST)(USER=userarchive))))
VERSION INFORMATION:
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: Version 9.2.0.1.0 - Production
Time: 10-JUN-2004 15:20:50
Tracing to file: E:oracleora92tempcli_1732.trc
Tns error struct:
nr err code: 0
ns main err code: 12542
TNS-12542: TNS:address already in use
ns secondary err code: 12560
nt main err code: 512
TNS-00512: Address already in use
nt secondary err code: 48
nt OS err code: 0
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_MACHINESYSTEMCurrentControlSetServicesTcpipParameters
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: TcpipParameters
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.
- ORACLE连接问题.TNS-12542: TNS: 地址已被占用
- ORA-12542 TNS 地址已被占用
- 监听问题(ORA-12542: TNS: 地址已被占用)错误解决
- Oracle 连接 TNS timeout 问题
- oracle 连接超时问题 ora-12535:TNS
- Oracle 远程连接TNS 超时问题
- oracle tns 连接超时
- oracle的TNS连接
- oracle数据库连接问题:TNS
- Oracle 正在连接...ORA-12170: TNS: 连接超时 的问题
- oracle 12170:tns:连接超时
- ora-12154 TNS问题(Oracle 客户端连接数据库异常)
- ORA-12537:TNS连接已关闭
- ORA-12537:TNS:连接已关闭
- ORA-12537:TNS连接已关闭
- 【监听问题】TNS-12542
- Oracle连接错误解决方法(TNS-12535: TNS: 操作超时)
- oracle服务器无法连接,报错TNS:tns:lost contact
- 从IIS转到SQL数据库安全
- 先导出,再以流的格式输出到客户端。
- find命令使用
- JAVA代码注释范例
- oracle添加自定义计数器
- ORACLE连接问题.TNS-12542: TNS: 地址已被占用
- JSF组件开发指南
- VLAN(2)
- 利用MYSQL的C API编程,如何确定一个数据库/表是否存在???
- sybase日志文件位置 配置文件位置
- 配置Sybase数据库编码方法
- vbscript一个用于验证邮箱的函数
- 如何在.NET里插入flash
- 我上大学,还是大学上我