[Oracle]Oracle錯誤案例:TNS-00510

來源:互聯網
上載者:User

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方式。



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.