Oracle資料庫案例整理-Oracle系統運行時故障-無法釋放已經結束的進程資源導致進程死結

來源:互聯網
上載者:User

1.1       現象描述

查詢資料庫執行SQL語句的進程狀態,發現執行SQL語句進程死結,系統顯示如下資訊:

SQL> select address,sql_text,piece,SECONDS_IN_WAIT,SERVICE_NAME,MACHINE,PROCESS,LOCKWAIT from v$session,v$sqltext where address=sql_address and sql_text like '%FM_%' order by address,piece;

ADDRESS  SQL_TEXT                                                         SECONDS_IN_WAIT SERVICE_NAME              PROCESS                  LOCKWAIT
-------- ---------------------------------------------------------------- --------------- ----------------------------------------------------------- 
761BA4D0 DELETE FROM NE5_1.TBL_FM_ALARM_LOG WHERE ROWID IN (SELECT ROWID             7807 omu                       22927                    AEC028A8
761BA4D0 FROM (SELECT ROWID FROM NE5_1.TBL_FM_ALARM_LOG             WHERE            7807 omu                       22927                    AEC028A8
9AB0B8F8 ress=sql_address and sql_text like '%FM_%' order   by   address,               0 SYS$USERS                 27667
A311D7E4 UPDATE NE5_1.TBL_FM_ALARM_LOG                                 SE            7658 omu                       29835                    AEC027C0

由以上顯示資訊可知,22927進程先進入寫鎖狀態,29835進程企圖再寫鎖時陷入無限等待。

1.2       可能原因

已經關閉的應用程式未確定資源過多,PMON需要大量時間來處理復原,導致無法處理並釋放鎖資源。

1.3       處理步驟
  1. oracle使用者登入資料庫所在機器。
  2. sysdba使用者串連資料庫。
  3. 查詢進程的會話“ID”和“SERIAL”。

SQL> select sess.sid,sess.serial# from v$session sess,v$process proc where sess.paddr=proc.addr and proc.spid='22927';

系統提示如下資訊:

       SID    SERIAL#
---------- ----------
       137          5

由以上顯示資訊可知,進程22927的會話ID為137,SERIAL為5。

  1. 關閉此會話。

SQL> alter system kill session '137,5';

1.4       參考資訊

PMON是進程監視器(Process Monitor)的縮寫。PMON先執行復原未確定資源,然後再釋放中斷串連所持有的鎖和其它資源。

 

相關文章

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.