ORA-12537 错误

| No Comments | No TrackBacks

1 开发人员提供的错误信息

"got minus one from a read call",这是一个 Java Exception,java.sql.SQLException: Io exception: 。

数据库环境是 AIX,Oracle 10.2.0.4。应用环境是 maximo 一个连接池,应用 A 两个连接池,还有一个报表程序没使用连接池,都使用同一个数据库用户 max61。

现象是总 session 达到 100 左右,max61 就无法建立新数据库连接了(程序及 PL/SQL 都是)。必须把应用重启,session 都释放了才能连接。

2 在 PL/SQL 中不断建立连接,使问题重现。

PL/SQL 提示错误:

Could not logon as max61
ORA-12537: TNS: 连接已关闭

3 查看 C:\Program Files\PLSQL Developer\sqlnet.log 文件,其中记录错误如下

Fatal NI connect error 12537, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.108.188)(PORT=1521))(CONNECT_DATA=(SID=hxmis)(SERVER=DEDICATED)(CID=(PROGRAM=C:\Program Files\PLSQL Developer\plsqldev.exe)(HOST=APPSERVER-2)(USER=Administrator))))

  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: 28-9月 -2009 10:25:58
  Tracing not turned on.
  Tns error struct:
    nr err code: 0
    ns main err code: 12537
    TNS-12537: TNS:连接关闭
    ns secondary err code: 12560
    nt main err code: 507
    TNS-00507: 连接已关闭
    nt secondary err code: 0
    nt OS err code: 0

4 查看数据库 listener.ora 文件,其中记录错误如下

28-SEP-2009 11:07:36 * (CONNECT_DATA=(SID=hxmis)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.108.88)(PORT=3763)) * establish * hxmis * 12518
TNS-12518: TNS:listener could not hand off client connection
 TNS-12549: TNS:operating system resource quota exceeded
  TNS-12560: TNS:protocol adapter error
   TNS-00519: Operating system resource quota exceeded
    IBM/AIX RISC System/6000 Error: 11: Resource temporarily unavailable

5 查看 oralce 文档 TNS-00519

提出的解决方法有两个,一是修改 Oracle 的 PROCESSES 参数,二是解决 sqlnet.log 或 listener.log 中记录的操作系统问题

http://download.oracle.com/docs/cd/B14117_01/network.101/b10775/troublestng.htm#CEGJGAFD,内容如下:

TNS-12549/ORA-12549: TNS:operating system resource quota exceeded and TNS-00519: Operating system resource quota exceeded
Cause: A quota or hard limit imposed by the operating system has been exceeded.
Possible limits include:
* The maximum number of processes allowed for a single user
* The operating system is running low on paging space

Action: Perform the appropriate action:
Increase the number of processes by setting the PROCESSES parameter in the database initialization file to a larger value.

Check the sqlnet.log or listener.log file for detailed error stack information, such as an operating system error code to help identify which quota has been exceeded.

listener.log 中有操作系统错误的文字描述:IBM/AIX RISC System/6000 Error: 11: Resource temporarily unavailable

6 Google: TNS-00519 Operating system resource quota exceeded aix 连接

找到一篇:http://blog.csdn.net/mosaic/archive/2008/12/29/3639164.aspx,内容如下:

今天一个项目现场反馈程序启动时出现TNS-12537错误。检查了oracle的listener.log,发现客户端应用出错时的输出为:

TNS-12518: TNS:listener could not hand off client connection
 TNS-12549: TNS:operating system resource quota exceeded
  TNS-12560: TNS:protocol adapter error
   TNS-00519: Operating system resource quota exceeded
    IBM/AIX RISC System/6000 Error: 11: Resource temporarily unavailable

看起来是系统资源不足,oracle无法获取资源。

检查了内存还有好几个G,再检查了ulimit -a,也都设置的比较大,再用df -k检查了文件系统,除了/usr,其他都空的比较多。清除/usr/tmp下面的一些垃圾,还是没有解决。

后来google了一下TNS-00519  IBM/AIX RISC System/6000 Error: 11: Resource temporarily unavailable,返回结果只有三篇。不过在第一篇文章http://blog.oracle.com.cn/html/77/t-132377.html的一位强人的答复中, 针对Error: 11: Resource temporarily unavailable问题提到了处理方式是Increase the appropriate OS kernal parameters for 'maximum number of processes allowed per user'.
原来该主机是项目现场新搞的一个环境,maxuproc参数是缺省的128,因此一旦oracle用户下进程数达到这个上线之后,客户端就无连接了。

附:用lsattr -E -l sys0|grep maxuproc可以查看maxuproc当前设置,通过root用户执行chdev -l sys0 -a maxuproc=1024 就可以修改为1024.

7 实际操作

以 root 用户分别登录到 51、52 两台机器上
执行:chdev -l sys0 -a maxuproc=1024

将操作系统用户最大进程改为 1024

chdev 命令:http://www.kuqin.com/aixcmds/aixcmds1/chdev.htm

No TrackBacks

TrackBack URL: http://www.zw1840.com/mt/mt-tb.cgi/24

Leave a comment

About this Entry

This page contains a single entry by zw1840 published on September 28, 2009 11:42 AM.

北京洗车行业用水现状 was the previous entry in this blog.

coLinux 0.7.3 + Debian 5 安装 Oracle 11gR2 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.