溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

ORA-12516故障的解決方法

發布時間:2021-11-12 15:35:12 來源:億速云 閱讀:1091 作者:柒染 欄目:關系型數據庫

本篇文章給大家分享的是有關ORA-12516故障的解決方法,小編覺得挺實用的,因此分享給大家學習,希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。

      早上剛上班,同事告訴我數據庫連不上了,提示“ORA-12516”錯誤,我嘗試通過PL/SQL Developer遠程連接數據庫,果然,報錯了“ORA-12516: TNS: 監聽程序無法找到匹配協議棧的可用句柄”;接著我通過遠程桌面登錄服務器,嘗試用sys用戶登錄數據庫,報了同樣的錯誤。奇怪,昨天下班時還好好的。
     我上網查了一下,這個報錯一般是由于數據庫的當前會話數不足造成的,相關的參數有兩個:processes和sessions。我想查一下數據庫這兩個參數,但是sys用戶無法登陸,真是著急。后來在朋友的建議下,采取以下步驟,順利解決了這個問題。

a.關閉listener,禁止新的連接;
b.殺掉local=no的部分或者全部進程(根據業務的重要性),殺掉幾個,保證sys用戶能登陸;
c.登進去看看哪個業務出問題了,殺掉出問題的用戶進程;
d.檢查數據庫;
e.啟動listener;


介紹一下我的操作環境:
操作系統:Windows Server 2008 R2
數據庫:Oracle 10g
      
     首先,通過lsnrctl stop關閉監聽器,禁止新的連接,以確保第二步能夠執行成功;
     第二,關閉了兩個連接數據庫的應用程序,然后嘗試用sys用戶登錄數據庫,登錄成功;
     第三,查看了processes和sessions兩個初始化參數值,分別為150、170,均為默認值;

點擊(此處)折疊或打開

  1. SQL>

  2. SQL> show parameter processes


  3. NAME TYPE VALUE

  4. ------------------------------------ ----------- ------------------------------

  5. aq_tm_processes integer 0

  6. db_writer_processes integer 3

  7. gcs_server_processes integer 0

  8. job_queue_processes integer 10

  9. log_archive_max_processes integer 2

  10. processes integer 150

  11. SQL> show parameter sessions


  12. NAME TYPE VALUE

  13. ------------------------------------ ----------- ------------------------------

  14. java_max_sessionspace_size integer 0

  15. java_soft_sessionspace_limit integer 0

  16. license_max_sessions integer 0

  17. license_sessions_warning integer 0

  18. logmnr_max_persistent_sessions integer 1

  19. sessions integer 170

  20. shared_server_sessions integer

  21. SQL>

      第四,通過select sid,serial#,program,terminal from v$session;查看當前所有會話信息,從當時的結果可以看到,有一百多條記錄,已經超過了數據庫的session上限;而且,除了Oracle自身的十幾個會話外,其余一百多個會話都是同一個terminal。由此,找出了故障點所在(這臺設備是昨晚剛剛安裝的一臺終端)。
     第五,關閉故障設備上的應用程序,再次通過select sid,serial#,program,terminal from v$session;查看當前所有會話信息,查詢結果顯示只剩下二十多條會話信息,考慮到Oracle自身的十幾個會話外和同時啟動的幾個應用程序,應該是正常的;
     第六,啟動listener,嘗試通過其他客戶端連接數據庫,一切正常,到此故障解決;
     接下來,我想看一下究竟是什么原因導致了這次故障,繼續;
     第七,查看報警日志,在日志中看到了大量的Process m000 died報警;

點擊(此處)折疊或打開

  1. Wed Apr 29 21:27:31 2015

  2. ksvcreate: Process(m000) creation failed

  3. Wed Apr 29 21:28:32 2015

  4. Process m000 died, see its trace file

  5. Wed Apr 29 21:28:32 2015

  6. ksvcreate: Process(m000) creation failed

  7. Wed Apr 29 21:29:33 2015

  8. Process m000 died, see its trace file

    第八,找到對應時間的trace文件,看到了“ORA-00020: maximum number of processes 150 exceeded Died during process startup with error 20 (seq=5413)”語句,原來是連接數超過了閥值,數據庫無法再建立新的連接,所以報錯。

點擊(此處)折疊或打開

  1. Dump file c:\\oracle\\product\\10.2.0\\admin\\hoegh\\bdump\\hoegh_ora_8032.trc

  2. Wed Apr 29 21:28:31 2015

  3. ORACLE V10.2.0.4.0 - 64bit Production vsnsta=0

  4. vsnsql=14 vsnxtr=3

  5. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

  6. With the Partitioning, OLAP, Data Mining and Real Application Testing options

  7. Windows NT Version V6.1 Service Pack 1

  8. CPU : 24 - type 8664, 12 Physical Cores

  9. Process Affinity : 0x0000000000000000

  10. Memory (Avail/Total): Ph:3339M/8181M, Ph+PgF:10815M/16361M

  11. Instance name: hoegh


  12. Redo thread mounted by this instance: 1


  13. Oracle process number: 0


  14. Windows thread id: 8032, image: ORACLE.EXE



  15. ORA-00020: maximum number of processes 150 exceeded

  16. Died during process startup with error 20 (seq=5413)

  17. OPIRIP: Uncaught error 20. Error stack:

  18. ORA-00020: maximum number of processes (150) exceeded

  19. Dump file c:\\oracle\\product\\10.2.0\\admin\\hoegh\\bdump\\hoegh_ora_8032.trc

  20. Thu Apr 30 00:19:05 2015

  21. ORACLE V10.2.0.4.0 - 64bit Production vsnsta=0

  22. vsnsql=14 vsnxtr=3

  23. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

  24. With the Partitioning, OLAP, Data Mining and Real Application Testing options

  25. Windows NT Version V6.1 Service Pack 1

  26. CPU : 24 - type 8664, 12 Physical Cores

  27. Process Affinity : 0x0000000000000000

  28. Memory (Avail/Total): Ph:3347M/8181M, Ph+PgF:10813M/16361M

  29. Instance name: hoegh


  30. Redo thread mounted by this instance: 1


  31. Oracle process number: 0


  32. Windows thread id: 8032, image: ORACLE.EXE



  33. ORA-00020: maximum number of processes 150 exceeded

  34. Died during process startup with error 20 (seq=5582)

  35. OPIRIP: Uncaught error 20. Error stack:

  36. ORA-00020: maximum number of processes (150) exceeded

  37. Dump file c:\\oracle\\product\\10.2.0\\admin\\hoegh\\bdump\\hoegh_ora_8032.trc

  38. Thu Apr 30 01:27:31 2015

  39. ORACLE V10.2.0.4.0 - 64bit Production vsnsta=0

  40. vsnsql=14 vsnxtr=3

  41. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

  42. With the Partitioning, OLAP, Data Mining and Real Application Testing options

  43. Windows NT Version V6.1 Service Pack 1

  44. CPU : 24 - type 8664, 12 Physical Cores

  45. Process Affinity : 0x0000000000000000

  46. Memory (Avail/Total): Ph:3350M/8181M, Ph+PgF:10812M/16361M

  47. Instance name: hoegh


  48. Redo thread mounted by this instance: 1


  49. Oracle process number: 0


  50. Windows thread id: 8032, image: ORACLE.EXE



  51. ORA-00020: maximum number of processes 150 exceeded

  52. Died during process startup with error 20 (seq=5650)

  53. OPIRIP: Uncaught error 20. Error stack:

  54. ORA-00020: maximum number of processes (150) exceeded

  55. Dump file c:\\oracle\\product\\10.2.0\\admin\\hoegh\\bdump\\hoegh_ora_8032.trc

  56. Thu Apr 30 09:54:12 2015

  57. ORACLE V10.2.0.4.0 - 64bit Production vsnsta=0

  58. vsnsql=14 vsnxtr=3

  59. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

  60. With the Partitioning, OLAP, Data Mining and Real Application Testing options

  61. Windows NT Version V6.1 Service Pack 1

  62. CPU : 24 - type 8664, 12 Physical Cores

  63. Process Affinity : 0x0000000000000000

  64. Memory (Avail/Total): Ph:3857M/8181M, Ph+PgF:11421M/16361M

  65. Instance name: hoegh


  66. Redo thread mounted by this instance: 1


  67. Oracle process number: 0


  68. Windows thread id: 8032, image: ORACLE.EXE

        至于為什么新增設備會產生大量連接,到現在還沒有搞清楚,懷疑和操作系統有關,這臺設備安裝的操作系統是windows xp embeded裁剪版系統,據說在安裝系統時不太順利;在故障設備上啟動應用程序,通過select sid,serial#,program,terminal from v$session;監控實時會話信息,會話數不斷增多,直到觸碰閥值,數據庫報錯,問題成功復現;
       我們又找來另外一臺相同配置、相同操作系統的設備進行測試,沒有出現這個問題。最后,只能把這臺設備重裝系統。

       下面總結一下ORA-12516錯誤的解決辦法:
一、一般是由于數據庫的當前會話數不滿足造成的,可以視業務需要增加processes和sessions參數的大小,這二者的關系是:sessions=(1.1*processes+5);
二、如果存在類似上述案例的惡意連接,可以按照上述步驟找到問題session,直接kill相關進程。

以上就是ORA-12516故障的解決方法,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注億速云行業資訊頻道。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女