症状:
当主机运行时间达198天或248天,cpu占用率就突然达到100%。此时操作系统命令可以执行,但Oracle的命令象lsnrctl、 sqlplus、dbca等都会被hang住,不能执行。
Oracle官方对该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
#-------------------------------------------------------------------------
备注:
事实上只要Linux x86主机运行天数是是24.8的倍数都有可能引发该bug,因为time()函数值为null,造成无限死循环,从而耗尽cpu。
解决办法三种:
1) 重启主机;
2) 打patch set,如将数据库升级到10203、10.2.0.4;
3) 对该bug单独打临时patch 4612267。
第一种方法没有彻底解决问题,以后照旧;第二种方法,升级时间长,且要求停库很久,当前生产环境暂不适合;本文采用第三种方法。
参考文档:
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
二、先停监听、dbconsole和数据库
$ lsnrctl stop
$ emctl stop dbconsole
$ sqlplus / as sysdba
SQL> shutdown immediate
注意:dbconsole是在已经装了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.
四、验证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.
五、启动数据库、监听和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.
此时再执行上面的验证patch命令就会发现该patch已经删除了。
--End--
最近遇到Oracle10gR2的一个bug,数据库版本:10.2.01.操作系统:Linux X86.现象:数据库挂起,cpu利用率100%,操作系统命令可以执行,Oracle的命令象lsnrctl,sqlplus,dbca不能执行.
问题原因:Oracle10.2.01的bug 4612267.影响平台:linux X86, AIX, HP-UX .
解决办法:1.打P4612267
2.升级到10.2.0.2
Subject: | SQL*Plus With Instant Client 10.2.0.1 Hangs, When System Uptime Is More Than 248 Days | |||
Doc ID: | Note:338461.1 | Type: | PROBLEM | |
Last Revision Date: | 04-DEC-2006 | Status: | PUBLISHED |
In this Document
Symptoms
Changes
Cause
Solution
References
SQL*Plus - Version: 10.2.0.1.0
Linux x86
Trying to invoke SQL*Plus hangs when machine uptime reaches 248 days.
Database connection is not relevant as the 'sqlplus' executable itself hangs with or without connection information. It hangs regardless of what parameters are passed in. For example:
sqlplus -V
However, the hang does not reproduce with Instant Client version 10.1.0.4
Generating a stack trace using gdb debugger shows:
#0 0x0048a0dd in times () from /lib/tls/libc.so.6
#1 0x01884599 in sltrgatime64 () from ./libclntsh.so.10.1
#2 0x0137d70f in kghinp () from ./libclntsh.so.10.1
#3 0x00f86b47 in kpuinit0 () from ./libclntsh.so.10.1
#4 0x00f85e7a in kpuenvcr () from ./libclntsh.so.10.1
#5 0x01051b5e in OCIEnvCreate () from ./libclntsh.so.10.1
#6 0x0099787e in afidrv () from ./libsqlplus.so
#7 0x009702b9 in safimTerminate () from ./libsqlplus.so
#8 0x0098c246 in afidrv () from ./libsqlplus.so
#9 0x080486f6 in main ()
Running STRACE tool shows:
$ strace /oracle/home/bin/sqlplus -V 2>&1 |less
......
old_mmap(NULL, 385024, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x41794000
gettimeofday({1122996561, 411035}, NULL) = 0
access("/usr/local/UD/conf/sqlnet.ora", F_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/UD/lib/oracle/network/admin/sqlnet.ora", F_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/UD/conf/sqlnet.ora", F_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/UD/lib/oracle/network/admin/sqlnet.ora", F_OK) = -1 ENOENT (No such file or directory)
fcntl64(-1218313656, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)
times(NULL) = -1825782405
times(NULL) = -1825782405
times(NULL) = -1825782405
times(NULL) = -1825782405
times(NULL) = -1825782405
times(NULL) = -1825782405
times(NULL) = -1825782405
It is looping on the times() function.
In addition to sqlplus, it has been reported that the netca and dbca tools also hang.
New installation of Instant Client 10.2.0.1.0 on Linux platform.
This is a known, unpublished bug.
Bug 4612267 OCI CLIENT IS IN AN INFINITE LOOP WHEN MACHINE UPTIME HITS 248 DAYS
Select one of the following two solutions:
1) Apply one-off patch available for 10.2.0.1.
a. Download one-off patch off Metalink:
Patch 4612267
Description OCI CLIENT IS IN AN INFINITE LOOP WHEN MACHINE UPTIME HITS 248 DAYS
Product CORE
Release Oracle 10.2.0.1
b. To apply patch on Instant Client install, please follow instructions documented in the OCI manual.
You can find this in:
http://www.oracle.com/pls/db102/db102.show_toc?which=main&partno=b14250&maxlevel=2§ion=&expand=3216
under "Patching Instant Client Shared Libraries on Linux or UNIX".
2) Wait for Patchset 10.2.0.2 to be available.
According to Bug 4612267, this bug is fixed in version 11, and backported to 10.2.0.2 patchset.
This patchset is estimated to be available mid-Dec 2005; but this is subject to change.