环境:
OS:CentOS 6.3
DB:Oralce 10.2.0.1.0
数据库版本是10G,猜测是不是一个BUG引起的,就查看一下
ps -ef|grep sqlplus
oracle 8702 8701 0 11:00 pts/6 00:00:00 sqlplus --hang住了
oracle 8792 8744 0 11:00 pts/7 00:00:00 grep sqlplus
--跟踪进程分析:
strace -p 8702
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
times(NULL) = -2140814387
查下系统运行时间
[oracle@localhost ~]$ uptime
10:56:57 up 199 days, 16:02, 4 users, load average: 55.99, 55.85, 53.78
果然是一个以前遇到过的调用时间函数死循环的BUG,翻了一下,
参考:
It is looping on the times() function.
In addition to sqlplus, it has been reported that the netca and dbca tools also hang.
Changes
This may happen with a new installation of Instant Client 10.2.0.1.0 or Oracle 10.2.0.1.0 on UNIX platform, or it can just occur after some period of time with no other changes.
Cause
This is a known, unpublished bug.
BUG 4612267 OCI CLIENT IS IN AN INFINITE LOOP WHEN MACHINE UPTIME HITS 248 DAYS
Solution
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) Apply Patchset 10.2.0.2 or higher.
According to unpublished BUG 4612267, this bug is fixed in version 11, and backported to 10.2.0.2 patchset.
二、处理
该问题重现的周期在250天左右,已在11G版本被修复;
临时解决,先把应用停掉,再删除oracle进程,最后reboot服务器;
最终解决:打补丁,或者升级到11G