# TNS-12540: TNS:internal limit restriction exceeded

+关注继续查看

27-JAN-2015 10:10:19 * (CONNECT_DATA=(SERVICE_NAME=scm2)(CID=(PROGRAM=c:\windows\system32\inetsrv\w3wp.exe)(HOST=POS)(USER=SYSTEM)))

* (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.xxx.xxx)(PORT=1667)) * establish * scm2 * 12518

TNS-12518: TNS:listener could not hand off client connection

TNS-12540: TNS:internal limit restriction exceeded

27-JAN-2015 10:10:19 * (CONNECT_DATA=(SERVICE_NAME=scm2)(CID=(PROGRAM=c:\windows\system32\inetsrv\w3wp.exe)(HOST=CEGWEB1)(USER=NETWO

RK?SERVICE))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.xxx.xxx)(PORT=1284)) * establish * scm2 * 12518

TNS-12518: TNS:listener could not hand off client connection

TNS-12540: TNS:internal limit restriction exceeded

1：首先查看监听服务的进程是否正常，如下所示，监听服务完全正常

ps -ef | grep tnslsnr

oraescm 6669 5979 0 14:03 pts/5 00:00:00 grep tnslsnr

oraescm 29877 1 0 08:12 ? 00:00:11 /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr LISTENER -inherit

2：检查查看监听服务的状态（lsnrctl status）

3： 检查lsnrctl services后， 发现一个奇怪的情况Dispatcher没有拒绝监听的记录，如下所示

4：检查Dispatcher进程的是否繁忙，结果查询时一直查询不出结果，立即取消了当前查询

SQL> select name,(busy/(busy+idle))*100 "busy rate%" from v$dispatcher;   NAME busy rate% ---- ---------- D000 .194393707 D001 .124595175 D002 .102238233 D003 .097416229 D004 .140182022 D005 .114123279 D006 .137454634 D007 .148511476 D008 .148901287 D009 .111103697   10 rows selected. 5：检查会话、进程数量。发现当前会话数为483，历史最大值为720. sessions最大值为1000 ,processes参数最大值为870， 应该可以排除processes与session参数值设置过小导致。 select * from v$resource_limit;

select count(1) from v$session;   SELECT SESSIONS_MAX,SESSIONS_WARNING,SESSIONS_CURRENT,SESSIONS_HIGHWATER    FROM v$license;

select count(1) from v$process;   select count(1) from v$session;

select busy/(busy+idle) from v$shared_server;   select name,busy/(busy+idle)*100 "Dispatcher Busy Rate" from v$dispatcher;


6：检查服务器CPU、RAM资源。如下所示，CPU利用率非常低。检查内存，发现物理内存只剩下204M大小，但是Swap还有13729M剩余。另外告警日志里面并没有发现任何错误信息。

TNS-12540: TNS:internal limit restriction exceeded

Cause: Too many TNS connections open simultaneously.

Action: Wait for connections to close and re-try.

http://docs.oracle.com/cd/B28359_01/network.111/b28316/troublestng.htm#CEGDGHBJ

TNS-12540/ORA-12540: TNS:internal limit restriction exceeded and TNS-00510: Internal limit restriction exceeded

Cause: An internal limit has been exceeded. Possible limits include:

Number of open connection that Oracle Net can process simultaneously

Number of memory buffers which can be used simultaneously

Number of processes a particular database instance is allowed

The first two are examples of hard limits. The third is an example of a limit which can be increased by setting PROCESSES parameter in the database initialization file to a larger value. In this case, a TNS-12500/ORA-12500 error is also returned. In some cases, these errors can be caused by the same conditions which cause TNS-12549/ORA-12549 and TNS-00519 errors.

Action: Perform these steps:

Wait for the open connections to close and retry. If the error persists, then check the sqlnet.log or listener.log file for detailed error stack information.

ORA-12540: TNS:internal limit restriction exceeded

Cause: Too many TNS connections open simultaneously.

Action: Wait for connections to close and re-try.

This error is not an indication of a network problem unless it occurs on all connections (in other words you have never been able to connect). If so it is a .ora configuration problem.

If you can make connections up to a certain point but then fails it is an indication of a resource limitation at the os level (this sounds like your scenario)

Typical problems are:

Out of system memory / swap

Out of process slots in the process table

Streams resources depleted

Physical connections allows by the kernal.

Out of File Handles


[orxxm@xxxx ~]$ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 193217 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 65536 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 4194302 cpu time (seconds, -t) unlimited max user processes (-u) 16384 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited check to count the number of existing socket handles on your db server (as root): [oraescm@eellnx18 bdump]$ lsof -i 4 -a | wc -l
473

[oraescm@eellnx18 bdump]$cat /proc/sys/fs/file-max 2414114 最后，我们决定增加Dispatcher的数量，从8改为10，尝试解决问题，结果问题不再重现。问题解决了。 SQL>alter system set dispatchers='(protocol=TCP)(disp=10)(serv=SCM2)' scope=both;       SQL> show parameter dispatchers   NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dispatchers string (protocol=TCP)(disp=10)(serv=S  CM2) max_dispatchers integer SQL>  205-02-03 添加： 几天过去了，悲催的是今天下午又出现了TSN-12540错误，纠结啊，这个问题已经把我折腾惨了！ 版权声明：本文内容由阿里云实名注册用户自发贡献，版权归原作者所有，阿里云开发者社区不拥有其著作权，亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容，填写侵权投诉表单进行举报，一经查实，本社区将立刻删除涉嫌侵权内容。 作者高分内容 更多 相关文章 使用NAT网关轻松为单台云服务器设置多个公网IP 在应用中，有时会遇到用户询问如何使单台云服务器具备多个公网IP的问题。 具体如何操作呢，有了NAT网关这个也不是难题。 26680 0 阿里云服务器怎么设置密码？怎么停机？怎么重启服务器？ 如果在创建实例时没有设置密码，或者密码丢失，您可以在控制台上重新设置实例的登录密码。本文仅描述如何在 ECS 管理控制台上修改实例登录密码。 8939 0 阿里云服务器如何登录？阿里云服务器的三种登录方法 购买阿里云ECS云服务器后如何登录？场景不同，大概有三种登录方式： 2871 0 阿里云服务器端口号设置 阿里云服务器初级使用者可能面临的问题之一. 使用tomcat或者其他服务器软件设置端口号后,比如 一些不是默认的, mysql的 3306, mssql的1433,有时候打不开网页, 原因是没有在ecs安全组去设置这个端口号. 解决: 点击ecs下网络和安全下的安全组 在弹出的安全组中,如果没有就新建安全组,然后点击配置规则 最后如上图点击添加...或快速创建. have fun! 将编程看作是一门艺术，而不单单是个技术。 10685 0 阿里云服务器安全组设置内网互通的方法 虽然0.0.0.0/0使用非常方便，但是发现很多同学使用它来做内网互通，这是有安全风险的，实例有可能会在经典网络被内网IP访问到。下面介绍一下四种安全的内网互联设置方法。 购买前请先：领取阿里云幸运券，有很多优惠，可到下文中领取。 11782 0 阿里云服务器如何登录？阿里云服务器的三种登录方法 购买阿里云ECS云服务器后如何登录？场景不同，阿里云优惠总结大概有三种登录方式： 登录到ECS云服务器控制台 在ECS云服务器控制台用户可以更改密码、更换系. 12604 0 腾讯云服务器 设置ngxin + fastdfs +tomcat 开机自启动 在tomcat中新建一个可以启动的 .sh 脚本文件 /usr/local/tomcat7/bin/ export JAVA_HOME=/usr/local/java/jdk7 export PATH=$JAVA_HOME/bin/:\$PATH export CLASSPATH=.
4581 0

6805 0
+关注

777

0

《2021云上架构与运维峰会演讲合集》

《零基础CSS入门教程》

《零基础HTML入门教程》