科技行者

行者学院 转型私董会 科技行者专题报道 网红大战科技行者

知识库

知识库 安全导航

至顶网软件频道Oracle错误案例:ORA-00235

Oracle错误案例:ORA-00235

  • 扫一扫
    分享文章到微信

  • 扫一扫
    关注官方公众号
    至顶头条

TNS-00510 Internal limit restriction exceeded Cause Too many files or sockets open simultaneously (or some other resource has

作者:中国IT实验室 来源:中国IT实验室 2007年10月5日

关键字: 数据库 ORACLE

  • 评论
  • 分享微博
  • 分享邮件

TNS-00510 Internal limit restriction exceeded

Cause Too many files or sockets open simultaneously (or some other resource has been depleted).

Action For further details, trace the operation for protocol details.

TNS-12500 TNS:listener failed to start a dedicated server process

Cause The process of starting up a dedicated server process failed. The executable could not be found or the environment may be set up incorrectly.

Action Turn on tracing at the ADMIN level and re-execute the operation. Verify that the Oracle Server executable is present and has execute permissions enabled. Ensure that the Oracle environment is specified correctly in LISTENER.ORA. The Oracle Protocol Adapter that is being called may not be installed on the local hard drive. Check that the correct Protocol Adapter are successfully linked. If the error persists, contact Oracle Customer Support.

TNS-12540 TNS:internal limit restriction exceeded

Cause Too many TNS connections open simultaneously.

Action Wait for connections to close and retry.

TNS-12560 TNS:protocol adapter error

Cause A generic protocol adapter error occurred.

Action Check addresses used for proper protocol specification. Before reporting this error, look at the error stack and check for lower level transport errors.For further details, turn on tracing and re-execute the operation. Turn off tracing when the operation is complete.

问:进程的数量会引起监听器错误吗?

TNS-12500: TNS:listener failed to start a dedicated server process

TNS-12540: TNS:internal limit restriction exceeded

TNS-12560: TNS:protocol adapter error

TNS-00510: Internal limit restriction exceeded

IBM/AIX RISC System/6000 Error: 11: Resource temporarily unavailable

我们在监听器日志中发现如上的错误信息。服务器上每个用户的最大进程数量被设置600 Oracle中的最大进程数量为600。进程最大的利用率是482,每个会话的最大利用率是490。会话的数量设置为840。

根据我所了解的,看起来进程的数量是没有问题的。我们通过在这个机器上无法正确建立内存分页空间而对此进行了证实,然而,一些人仍然告诉我们要在起始的时候增加进程的数量。我不同意这个观点。我遗漏了什么吗?

答:TNS-510错误信息显示了有太多的文件或者socket同时开放了(或者是其他一些资源耗尽了)。这是操作系统的限制,不是Oracle的限制。你需要确认你的AIX平台可以处理你在服务器上开放的这么多的文件。这是“全部”文件,并不仅仅是Oracle数据库文件。并且,你还需要确认你的AIX服务器可以正确处理全部数量的Oracle进程,而不仅仅是专用的服务器进程。Oracle的起始参数PROCESSES限制了专用的服务器进程数量。但是还有后台的进程(SMON, PMON, LGWR等),以及支持并行语句的进程,更不用说你的监听器等了。我觉得你应该配置AIX来允许每个Unix用户拥有更多的进程。

总结:TNS-12500,TNS-12540,TNS-12560,TNS-00510解决过程

一 环境:

1 平台: IBM AX360,4G内存 windows 2k advServer sp3 + oracle 816 独占模式

2 内存分配相关参数

..processes................=.1000

..shared_pool_size.........=.240000000

..large_pool_size..........=.614400

..java_pool_size...........=.32768

..db_block_buffers.........=.90000

..db_block_size............=.4096

..log_buffer...............=.163840

..log_checkpoint_interval..=.10000

..sort_area_size...........=.65536

..sort_area_retained_size..=.65536

..open_cursors.............=.100

..job_queue_processes......=.4

..job_queue_interval.......=.10

..max_dump_file_size.......=.10240

3 最大并发用户数:850个左右

二 故障现象:

....当用户数达到一定的数量时(700多)客户端连接服务器时报ora-12560错误,紧跟着报ora-03114错误,不能连接到服务器。此时已连接到服务器的用户能正常访问数据库。

....首先查看警告日志文件,未见到明显错误信息。

....查看listner.log文件,发现如下信息(很多个类似的错误记录,摘两个上来)

.........................

02-JUL-2003 10:30:09 * (CONNECT_DATA=(SID=ORCL)(CID=(PROGRAM=***.EXE)(HOST=*******)(USER=*****))) * (ADDRESS=(PROTOCOL=tcp)(HOST=*******)(PORT=1136)) * establish * ORCL * 12500

TNS-12500: TNS:listener failed to start a dedicated server process

.TNS-12540: TNS:internal limit restriction exceeded

..TNS-12560: TNSrotocol adapter error

...TNS-00510: Internal limit restriction exceeded

....32-bit Windows Error: 8: Exec format error

02-JUL-2003 10:30:10 * (CONNECT_DATA=(SID=ORCL)(CID=(PROGRAM=***.EXE)(HOST=*****)(USER=***))) * (ADDRESS=(PROTOCOL=tcp)(HOST=******)(PORT=1203)) * establish * ORCL * 12500

TNS-12500: TNS:listener failed to start a dedicated server process

.TNS-12540: TNS:internal limit restriction exceeded

..TNS-12560: TNSrotocol adapter error

...TNS-00510: Internal limit restriction exceeded

....32-bit Windows Error: 8: Exec format error

.....................

此时,原来已连接上服务器的用户还能正常使用。查看此时session达到760多个。

....重启oracle服务后,能连接新的用户数,但当并发用户数达到750个以上时,再次报同样的错误

三 原因分析:

....系统资源耗竭,意味着系统分配给oracle的内存用尽了。虽然我们有4G的物理内存,但正常情况下系统只能给oracle分配2G的内存,这2G的内存中,包括了SGA、PGA等oracle需要使用的全部内存。在独占模式下,每一个session将单独分配2M左右的内存。在本例中,SGA分配了约600M,按每一个用户分配2M内存计算,连接数达到750个时,总分配内存已达到2G,将不能再增加新的连接数。如果要解决这个问题,在不做大的调整的前提下,要么减小SGA大小,要么减小为每一个会话分配的内存大小,以能连接更多的用户。

四 解决过程:

....查阅了oracle文档,文档里提出来了几个解决的办法:

1 重置init.ora参数文件,调小以下四个参数的值:

....short_area_size

....hash_area_size

....bitmap_merge_area_size

....create_bitmap_area_seze

....open_cursone

2 调小SGA的大小

3 减小oracle Job队列数量(job_queue_processes)和并发队列数(parallel_max_servers)

4 重置并减小会话/线程使用的堆栈大小

5 将oracle改为mts模式

6 更换操作系统为windows NT 企业版

7 使用intel的ESMA硬件支持,即使用大内存

..1) 在intel系统上使用 /3G 开关

..2) 使用PSE36内存

....结合本实例的具体情况,决定调整的主要目标为减小用户的PGA大小。

....构成PGA的主要内容有short_area_size, hash_area_size, open_cursone, 以及oracle 堆栈和TNS 堆栈。在本实例中,排序区为64K,hash区为128K(缺少值),打开的游标数与应用有关,不能随便减小了,然而oracle堆栈和TNS堆栈都是1M,却有较大的减小的余地。因此,调整的目标定为减小这两个堆栈的大小。

....使用orastack 命令来减小这两个堆栈的大小:

D:\oracle\ora81\bin>orastack oracle.exe 500000

Couldn't open file with CreateFile()

GetLastError() == 32

....停止oracle服务和TNS服务,再运行以上命令

D:\oracle\ora81\bin>orastack oracle.exe 500000

Dump of file oracle.exe

Current Reserved Memory per Thread = 1048576

Current Committed Memory per Thread = 4096

New Reserved Memory per Thread = 500000

D:\oracle\ora81\bin>orastack tnslsnr.exe 500000

Dump of file tnslsnr.exe

Current Reserved Memory per Thread = 1048576

Current Committed Memory per Thread = 4096

New Reserved Memory per Thread = 500000

重新启动oracle服务和TNS服务,打开数据库,用户连接到服务器,经测试,用户数到1350以上时数据库仍然运行正常,解决了本实例存在的问题。

五 小结

....事实上,正如oracle文档所指出的那样,要增加用户连接数的途径很多,除了减小用户堆栈之外,还可以减小SGA,或者是更改成MTS方式,或者是使用第三方工具增加oracle可用内存。本人前面小结过如何让oracle在32位的windows操作系统上使用超过2G内存的方法( http://www.itpub.net/showthread.php...15&pagenumber=1 ),在本安全应用中,宜将两者(减小用户堆栈与增加oracle可用内存)结合起来使用,以提高数据库性能。但是,这种方式下,同样不可能无限制地增加用户连接数。要想使用户连接数达到更大,则应使用MTS方式。

查看本文来源

    • 评论
    • 分享微博
    • 分享邮件