sitemap

RSS地图

收藏本站

设为首页

Oracle研究中心

当前位置:Oracle研究中心 > 故障案例 >

【案例】Oracle数据库客户端执行sqlplus时hang卡住的解决办法

时间:2016-10-19 22:25   来源:Oracle研究中心   作者:HTZ   点击:

天萃荷净 运维DBA反映Oracle数据库在执行sqlplus时hang卡住.结合MOS查询官方解决办法是由于数据库开启时间较长由于BUG引起。
环境介绍:

某联通迁移CRM/BILL系统.从原来10.2.0.4迁移到10.2.0.5,异机迁移.具体迁移过程是由开发他们来做.服务器迁移完成后.开发人员发现几台客户机的sqlplus执行时hang住.按理说.这个不在维护的范围.但是中国国情.没有办法。由于使用的客户的主机,所以没有详细的日志,只有操作步骤.

OS:LINUX DB CLINET :10.2.0.1

1.查看环境变量一切错误。

2.strace –fo /tmp/trace.out sqlplus

发现当开始报很多lib文件不存在.后面一很在tims那里循环。times函数是取进程运行时间

3.通过询问.确认本次升级客户端无任何操作。

4.查看主机已经有400多天没有重启过.怀疑跟这个有关系。由于当时不能连接外网.所以找不到更多的信息。

5.主机工程师重启主机后.故障解决。

通过metalink发现如下的信息:


SQL*Plus 10.2.0.1 Hangs, When System Uptime Is Long Period of Time (文档 ID 338461.1)

修改时间:2013-7-1类型:PROBLEM状态:PUBLISHED优先级:2   


In this Document
Symptoms
Changes
Cause
Solution
References
APPLIES TO:

SQL*Plus - Version 10.2.0.1 to 10.2.0.1 [Release Oracle10g]
Generic UNIX
Linux x86
HP-UX PA-RISC (64-bit)
IBM AIX on POWER Systems (64-bit)
Linux x86-64
Checked for relevance on 18-Apr-2010


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://docs.oracle.com/cd/B19306_01/appdev.102/b14294/install.htm#CACFFGHF

        under "Patching Instant Client Shared Libraries on 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.

Join the SQL*Plus & SQhttp://www.oracleplus.netL Developer Community Forum for general SQL*Plus and SQL*Developer discussions, questions, best practices, and other valuable information

本文固定链接: http://www.htz.pw/2013/08/18/linux-oracle-10-2-0-1%e5%ae%a2%e6%88%b7%e7%ab%afsqlplus-hang%e4%bd%8f.html | 认真就输

--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之【案例】Oracle数据库客户端执行sqlplus时hang卡住的解决办法

本文由大师惜分飞原创分享,网址:http://www.oracleplus.net/arch/1009.html

Oracle研究中心

关键词:

linux oracle 10.2.0.1客户端sqlplus hang住

Oracle数据库执行sqlplus时卡住不动的解决办法