sqlplus 无响应 hang处理

现象:

本地使用sqlplus / nolog 长时间无响应,

使用ps -ef | grep ora 后发现 cpu占用很高, 导致连接不上,

MOS上有一篇文章:

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

Symptoms

Trying to invoke SQL*Plus hangs when machine uptime has been for a long period of time.  There have been cases where problem occurs when uptime reaches 60 days and others as long as 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.

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.

上面说系统运行到多久之后,会出现此问题,这个不是必须条件,也许你的系统运行时间没有达到上面所说的那个时间,也会出现此情况

推荐最好进行升级,临时解决,可以重启机器。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/751371/viewspace-735667/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/751371/viewspace-735667/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值