日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯網營銷解決方案
解決Linux下sqlplus無響應的三種方法

Oracle數據庫的sqlplus無響應掛起處理,網上查看資料得知是oracle的bug引起的,事實上只要Linux x86主機運行天數是24.8的倍數都有可能引發(fā)該bug,因為time()函數值為null,造成無限死循環(huán),從而耗盡cpu。接下來我們介紹一下解決辦法。

解決辦法三種:

1) 重啟主機;

2) 打patch set,如升級到10.2.0.4;

3) 對該bug單獨打臨時patch 4612267。

第一種方法沒有徹底解決問題,以后照舊;第二種方法,升級時間長,且要求停庫很久,當前生產環(huán)境暫不適合;

參考文檔:

Doc ID: 338461.1 SQL*Plus 10.2.0.1 Hangs, When System Uptime Is Long Period of Time

Doc ID: 4612267.8 Bug 4612267 - OCI client spins when machine uptime >= 249 days

我采取的是第三種方法,打補丁包的方式。而且據oracle官方文檔說明,oracle11已經修復該問題。

下面是pache 4612267補丁包的安裝及驗證方法:

先停監(jiān)聽、dbconsole和數據庫

 
 
 
  1. $ lsnrctl stop  
  2.  
  3. $ emctl stop dbconsole  
  4.  
  5. $ sqlplus / as sysdba  
  6.  
  7. SQL> shutdown immediate 

注意:dbconsole是在已經裝了Oracle EM的情況下要停止,如果未安裝則無需干涉。

安裝patch

 
 
 
  1. $ mkdir $ORACLE_BASE/patches  
  2.  
  3. $ cd $ORACLE_BASE/patches  
  4.  
  5. $ rz    (SecureCRT里上傳 p4612267_10201_LINUX.zip 文件, 其它上傳方式也可以)  
  6.  
  7. $ unzip p4612267_10201_LINUX.zip    
  8.  
  9. $ cd 4612267/  
  10.  
  11. $ $ORACLE_HOME/OPatch/opatch apply  
  12.  
  13. Invoking OPatch 10.2.0.1.0  
  14.  
  15. ...  
  16.  
  17. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.  
  18.  
  19. (Oracle Home = '/u01/app/oracle/product/10.2.0/db_1')  
  20.  
  21. Is the local system ready for patching?  
  22.  
  23. Do you want to proceed? [y|n]  
  24.  
  25. y    (此處輸入y)  
  26.  
  27. User Responded with: Y  
  28.  
  29. ...  
  30.  
  31. ApplySession adding interim patch '4612267' to inventory  
  32.  
  33. The local system has been patched and can be restarted.  
  34.  
  35. OPatch succeeded. 

驗證patch

 
 
 
  1. $ $ORACLE_HOME/OPatch/opatch lsinventory  
  2.  
  3. Invoking OPatch 10.2.0.1.0  
  4.  
  5. Oracle interim Patch Installer version 10.2.0.1.0  
  6.  
  7. Copyright (c) 2005, Oracle Corporation. All rights reserved..  
  8.  
  9. Oracle Home       : /u01/app/oracle/product/10.2.0/db_1  
  10.  
  11. Central Inventory : /u01/app/oracle/oraInventory  
  12.  
  13. from           : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc  
  14.  
  15. OPatch version    : 10.2.0.1.0  
  16.  
  17. OUI version       : 10.2.0.1.0  
  18.  
  19. OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui  
  20.  
  21. Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2009_Jan_13_11-06-27-HKT_Tue.log  
  22.  
  23. Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory-2009_Jan_13_11-06-27-HKT_Tue.txt  
  24.  
  25. --------------------------------------------------------------------------------  
  26.  
  27. Installed Top-level Products (2):  
  28.  
  29. Oracle Database  
  30.  
  31. 10g                                                  10.2.0.1.0  
  32.  
  33. Oracle Database 10g Products                                         10.2.0.1.0  
  34.  
  35. There are 2 products installed in this Oracle Home.  
  36.  
  37. Interim patches (1) :  
  38.  
  39. Patch 4612267      : applied on Tue Jan 13 11:05:10 HKT 2009  
  40.  
  41.    Created on 5 Oct 2005, 13:48:00 hrs US/Pacific  
  42.  
  43.    Bugs fixed:  
  44.  
  45.      4612267  
  46.  
  47. --------------------------------------------------------------------------------  
  48.  
  49. OPatch succeeded. 

啟動數據庫、監(jiān)聽和dbconsole

 
 
 
  1. $ sqlplus / as sysdba  
  2.  
  3. SQL> startup  
  4.  
  5. $ lsnrctl start  
  6.  
  7. $ emctl start dbconsole 

如果有需要,還可以刪除patch,刪除前先停庫

 
 
 
  1. $ cd $ORACLE_BASE/patches/4612267  
  2.  
  3. $ $ORACLE_HOME/OPatch/opatch rollback -id 4612267  
  4.  
  5. Invoking OPatch 10.2.0.1.0  
  6.  
  7. ...  
  8.  
  9. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.  
  10.  
  11. (Oracle Home = '/u01/app/oracle/product/10.2.0/db_1')  
  12.  
  13. Is the local system ready for patching?  
  14.  
  15. Do you want to proceed? [y|n]  
  16.  
  17. y    (此處輸入y)  
  18.  
  19. User Responded with: Y  
  20.  
  21. ...  
  22.  
  23. RollbackSession removing interim patch '4612267' from inventory  
  24.  
  25. The local system has been patched and can be restarted.  
  26.  
  27. OPatch succeeded. 

此時再執(zhí)行上面的驗證patch命令就會發(fā)現該patch已經刪除了。

注:

 
 
 
  1. Running STRACE tool shows:  
  2.  
  3. $ strace /oracle/home/bin/sqlplus -V 2>&1 |less  
  4.  
  5. ......  
  6.  
  7. old_mmap(NULL, 385024, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x41794000  
  8.  
  9. gettimeofday({1122996561, 411035}, NULL) = 0  
  10.  
  11. access("/usr/local/UD/conf/sqlnet.ora", F_OK) = -1 ENOENT (No such file or directory)  
  12.  
  13. access("/usr/local/UD/lib/oracle/network/admin/sqlnet.ora", F_OK) = -1 ENOENT (No such file or directory)  
  14.  
  15. access("/usr/local/UD/conf/sqlnet.ora", F_OK) = -1 ENOENT (No such file or directory)  
  16.  
  17. access("/usr/local/UD/lib/oracle/network/admin/sqlnet.ora", F_OK) = -1 ENOENT (No such file or directory)  
  18.  
  19. fcntl64(-1218313656, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)  
  20.  
  21. It is looping on the times() function.--死循環(huán)中  
  22.  
  23. times(NULL) = -1825782405  
  24.  
  25. times(NULL) = -1825782405  
  26.  
  27. times(NULL) = -1825782405  
  28.  
  29. times(NULL) = -1825782405  
  30.  
  31. times(NULL) = -1825782405  
  32.  
  33. times(NULL) = -1825782405  
  34.  
  35. times(NULL) = -1825782405 

 關于Linux下sqlplus沒有反應的問題就介紹到這里了,希望通過本次的介紹能夠帶給您一些收獲!

【編輯推薦】

  1. Oracle數據庫基于用戶管理的備份與恢復
  2. Oracle 數據庫如何設置歸檔模式與非歸檔模式
  3. Oracle數據庫利用日志挖掘來恢復誤刪除的數據
  4. 只需兩步即可實現SQL Server數據庫降級的方法
  5. Linux環(huán)境下Oracle10G和Oracle11G并存的安裝和配置

網站欄目:解決Linux下sqlplus無響應的三種方法
本文URL:http://www.dlmjj.cn/article/djjjgco.html