| |||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
29 | 30 | 1 | 2 | 3 | 4 | 5 | |||
6 | 7 | 8 | 9 | 10 | 11 | 12 | |||
13 | 14 | 15 | 16 | 17 | 18 | 19 | |||
20 | 21 | 22 | 23 | 24 | 25 | 26 | |||
27 | 28 | 29 | 30 | 31 | 1 | 2 | |||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
一、bug癥狀和描述
癥狀: 當(dāng)主機(jī)運(yùn)行時(shí)間達(dá)198天或248天,cpu占用率就突然達(dá)到100%。此時(shí)操作系統(tǒng)命令可以執(zhí)行,但Oracle的命令象lsnrctl、sqlplus、dbca等都會(huì)被hang住,不能執(zhí)行。 Oracle官方對(duì)該bug的描述: #------------------------------------------------------------------------- # Interim Patch for Base Bugs: 4612267 #------------------------------------------------------------------------- # # DATE: Wed Oct 5 10:17:13 2005 # ------------------------------- # Platform Patch for : Linux x86 # Product Version # : 10.2.0.1 # Product Patched : ORACORE # # Bugs Fixed by this patch: # ------------------------- # 4612267:OCI CLIENT IS IN AN INFINITE LOOP WHEN MACHINE UPTIME HITS 248 DAYS #------------------------------------------------------------------------- 備注: 事實(shí)上只要Linux x86主機(jī)運(yùn)行天數(shù)是是24.8的倍數(shù)都有可能引發(fā)該bug,因?yàn)閠ime()函數(shù)值為null,造成無限死循環(huán),從而耗盡cpu。 解決辦法三種: 1) 重啟主機(jī); 2) 打patch set,如升級(jí)到10.2.0.4; 3) 對(duì)該bug單獨(dú)打臨時(shí)patch 4612267。 第一種方法沒有徹底解決問題,以后照舊;第二種方法,升級(jí)時(shí)間長(zhǎng),且要求停庫很久,當(dāng)前生產(chǎn)環(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 二、先停監(jiān)聽、dbconsole和數(shù)據(jù)庫 $ lsnrctl stop $ emctl stop dbconsole $ sqlplus / as sysdba SQL> shutdown immediate 注意:dbconsole是在已經(jīng)裝了Oracle EM的情況下要停止,如果未安裝則無需干涉。 三、安裝patch $ mkdir $ORACLE_BASE/patches $ cd $ORACLE_BASE/patches $ rz (SecureCRT里上傳 p4612267_10201_LINUX.zip 文件, 其它上傳方式也可以) $ unzip p4612267_10201_LINUX.zip $ cd 4612267/ $ $ORACLE_HOME/OPatch/opatch apply Invoking OPatch 10.2.0.1.0 ... Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = '/u01/app/oracle/product/10.2.0/db_1') Is the local system ready for patching? Do you want to proceed? [y|n] y (此處輸入y) User Responded with: Y ... ApplySession adding interim patch '4612267' to inventory The local system has been patched and can be restarted. OPatch succeeded. 四、驗(yàn)證patch $ $ORACLE_HOME/OPatch/opatch lsinventory Invoking OPatch 10.2.0.1.0 Oracle interim Patch Installer version 10.2.0.1.0 Copyright (c) 2005, Oracle Corporation. All rights reserved.. Oracle Home : /u01/app/oracle/product/10.2.0/db_1 Central Inventory : /u01/app/oracle/oraInventory from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc OPatch version : 10.2.0.1.0 OUI version : 10.2.0.1.0 OUI location : /u01/app/oracle/product/10.2.0/db_1/oui Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2009_Jan_13_11-06-27-HKT_Tue.log 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 -------------------------------------------------------------------------------- Installed Top-level Products (2): Oracle Database 10g 10.2.0.1.0 Oracle Database 10g Products 10.2.0.1.0 There are 2 products installed in this Oracle Home. Interim patches (1) : Patch 4612267 : applied on Tue Jan 13 11:05:10 HKT 2009 Created on 5 Oct 2005, 13:48:00 hrs US/Pacific Bugs fixed: 4612267 -------------------------------------------------------------------------------- OPatch succeeded. 五、啟動(dòng)數(shù)據(jù)庫、監(jiān)聽和dbconsole $ sqlplus / as sysdba SQL> startup $ lsnrctl start $ emctl start dbconsole 六、如果有需要,還可以刪除patch,刪除前先停庫 $ cd $ORACLE_BASE/patches/4612267 $ $ORACLE_HOME/OPatch/opatch rollback -id 4612267 Invoking OPatch 10.2.0.1.0 ... Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = '/u01/app/oracle/product/10.2.0/db_1') Is the local system ready for patching? Do you want to proceed? [y|n] y (此處輸入y) User Responded with: Y ... RollbackSession removing interim patch '4612267' from inventory The local system has been patched and can be restarted. OPatch succeeded. 此時(shí)再執(zhí)行上面的驗(yàn)證patch命令就會(huì)發(fā)現(xiàn)該patch已經(jīng)刪除了。 --End-- |
今天在調(diào)試一個(gè)小小的程序,當(dāng)啟動(dòng)tomcat5.5時(shí),鐺鐺一下:
還沒搞懂是什么問題!