文章詳情頁(yè)
案例學(xué)習(xí)Oracle錯(cuò)誤:TNS-00510
瀏覽:2日期:2023-11-12 13:45:39
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. 問(wèn):進(jìn)程的數(shù)量會(huì)引起監(jiān)聽(tīng)器錯(cuò)誤嗎? 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 我們?cè)诒O(jiān)聽(tīng)器日志中發(fā)現(xiàn)如上的錯(cuò)誤信息。服務(wù)器上每個(gè)用戶的最大進(jìn)程數(shù)量被設(shè)置600 Oracle中的最大進(jìn)程數(shù)量為600。進(jìn)程最大的利用率是482,每個(gè)會(huì)話的最大利用率是490。會(huì)話的數(shù)量設(shè)置為840。 根據(jù)我所了解的,看起來(lái)進(jìn)程的數(shù)量是沒(méi)有問(wèn)題的。我們通過(guò)在這個(gè)機(jī)器上無(wú)法正確建立內(nèi)存分頁(yè)空間而對(duì)此進(jìn)行了證實(shí),然而,一些人仍然告訴我們要在起始的時(shí)候增加進(jìn)程的數(shù)量。我不同意這個(gè)觀點(diǎn)。我遺漏了什么嗎? 答:TNS-510錯(cuò)誤信息顯示了有太多的文件或者socket同時(shí)開放了(或者是其他一些資源耗盡了)。這是操作系統(tǒng)的限制,不是Oracle的限制。你需要確認(rèn)你的AIX平臺(tái)可以處理你在服務(wù)器上開放的這么多的文件。這是“全部”文件,并不僅僅是Oracle數(shù)據(jù)庫(kù)文件。并且,你還需要確認(rèn)你的AIX服務(wù)器可以正確處理全部數(shù)量的Oracle進(jìn)程,而不僅僅是專用的服務(wù)器進(jìn)程。Oracle的起始參數(shù)PROCESSES限制了專用的服務(wù)器進(jìn)程數(shù)量。但是還有后臺(tái)的進(jìn)程(SMON, PMON, LGWR等),以及支持并行語(yǔ)句的進(jìn)程,更不用說(shuō)你的監(jiān)聽(tīng)器等了。我覺(jué)得你應(yīng)該配置AIX來(lái)答應(yīng)每個(gè)Unix用戶擁有更多的進(jìn)程。 總結(jié):TNS-12500,TNS-12540,TNS-12560,TNS-00510解決過(guò)程 一 環(huán)境: 1 平臺(tái): IBM AX360,4G內(nèi)存 windows 2k advServer sp3 + oracle 816 獨(dú)占模式 2 內(nèi)存分配相關(guān)參數(shù) ..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.......=.102403 最大并發(fā)用戶數(shù):850個(gè)左右 二 故障現(xiàn)象: 當(dāng)用戶數(shù)達(dá)到一定的數(shù)量時(shí)(700多)客戶端連接服務(wù)器時(shí)報(bào)ora-12560錯(cuò)誤,緊跟著報(bào)ora-03114錯(cuò)誤,不能連接到服務(wù)器。此時(shí)已連接到服務(wù)器的用戶能正常訪問(wèn)數(shù)據(jù)庫(kù)。 首先查看警告日志文件,未見(jiàn)到明顯錯(cuò)誤信息。 查看listner.log文件,發(fā)現(xiàn)如下信息(很多個(gè)類似的錯(cuò)誤記錄,摘兩個(gè)上來(lái)) 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 error02-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此時(shí),原來(lái)已連接上服務(wù)器的用戶還能正常使用。查看此時(shí)session達(dá)到760多個(gè)。 重啟oracle服務(wù)后,能連接新的用戶數(shù),但當(dāng)并發(fā)用戶數(shù)達(dá)到750個(gè)以上時(shí),再次報(bào)同樣的錯(cuò)誤 三 原因分析: 系統(tǒng)資源耗竭,意味著系統(tǒng)分配給oracle的內(nèi)存用盡了。雖然我們有4G的物理內(nèi)存,但正常情況下系統(tǒng)只能給oracle分配2G的內(nèi)存,這2G的內(nèi)存中,包括了SGA、PGA等oracle需要使用的全部?jī)?nèi)存。在獨(dú)占模式下,每一個(gè)session將單獨(dú)分配2M左右的內(nèi)存。在本例中,SGA分配了約600M,按每一個(gè)用戶分配2M內(nèi)存計(jì)算,連接數(shù)達(dá)到750個(gè)時(shí),總分配內(nèi)存已達(dá)到2G,將不能再增加新的連接數(shù)。假如要解決這個(gè)問(wèn)題,在不做大的調(diào)整的前提下,要么減小SGA大小,要么減小為每一個(gè)會(huì)話分配的內(nèi)存大小,以能連接更多的用戶。 四 解決過(guò)程: 查閱了oracle文檔,文檔里提出來(lái)了幾個(gè)解決的辦法: 1 重置init.ora參數(shù)文件,調(diào)小以下四個(gè)參數(shù)的值: short_area_size hash_area_size bitmap_merge_area_size create_bitmap_area_seze open_cursone2 調(diào)小SGA的大小 3 減小oracle Job隊(duì)列數(shù)量(job_queue_processes)和并發(fā)隊(duì)列數(shù)(parallel_max_servers) 4 重置并減小會(huì)話/線程使用的堆棧大小 5 將oracle改為mts模式 6 更換操作系統(tǒng)為windows NT 企業(yè)版 7 使用intel的ESMA硬件支持,即使用大內(nèi)存 1) 在intel系統(tǒng)上使用 /3G 開關(guān) 2) 使用PSE36內(nèi)存 結(jié)合本實(shí)例的具體情況,決定調(diào)整的主要目標(biāo)為減小用戶的PGA大小。 ....構(gòu)成PGA的主要內(nèi)容有short_area_size, hash_area_size, open_cursone, 以及oracle 堆棧和TNS 堆棧。在本實(shí)例中,排序區(qū)為64K,hash區(qū)為128K(缺少值),打開的游標(biāo)數(shù)與應(yīng)用有關(guān),不能隨便減小了,然而oracle堆棧和TNS堆棧都是1M,卻有較大的減小的余地。因此,調(diào)整的目標(biāo)定為減小這兩個(gè)堆棧的大小。 使用orastack 命令來(lái)減小這兩個(gè)堆棧的大?。?D:oracleora81bin>orastack oracle.exe 500000 Couldn't open file with CreateFile() GetLastError() == 32停止oracle服務(wù)和TNS服務(wù),再運(yùn)行以上命令 D:oracleora81bin>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:oracleora81bin>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重新啟動(dòng)oracle服務(wù)和TNS服務(wù),打開數(shù)據(jù)庫(kù),用戶連接到服務(wù)器,經(jīng)測(cè)試,用戶數(shù)到1350以上時(shí)數(shù)據(jù)庫(kù)仍然運(yùn)行正常,解決了本實(shí)例存在的問(wèn)題。 五 小結(jié) 事實(shí)上,正如oracle文檔所指出的那樣,要增加用戶連接數(shù)的途徑很多,除了減小用戶堆棧之外,還可以減小SGA,或者是更改成MTS方式,或者是使用第三方工具增加oracle可用內(nèi)存。本人前面小結(jié)過(guò)如何讓oracle在32位的windows操作系統(tǒng)上使用超過(guò)2G內(nèi)存的方法( http://www.itpub.net/showthread.PHP...15&pagenumber=1 ),在本安全應(yīng)用中,宜將兩者(減小用戶堆棧與增加oracle可用內(nèi)存)結(jié)合起來(lái)使用,以提高數(shù)據(jù)庫(kù)性能。但是,這種方式下,同樣不可能無(wú)限制地增加用戶連接數(shù)。要想使用戶連接數(shù)達(dá)到更大,則應(yīng)使用MTS方式。
標(biāo)簽:
Oracle
數(shù)據(jù)庫(kù)
排行榜
