分享一个Oracle OCI库的BUG
上周测试组反馈在一台HP X86-64主机Solaris 10 for X86环境下部署的应用无法连接Oracle数据库,错误码ORA-12154。而另外一个产品的部署在这台主机上的应用却能正常连接到数据库。本周安排专人对该问题进行查找,在先后排除了用户环境设置、Oracle数据库服务端等问题后,我们最终把目光集中在了Oracle客户端的OCI库上。
定位过程如下:
1、SQLPLUS可以访问数据库;
2、同环境下另一个应用可以访问数据库;
以上证明用户环境和tnsnames.ora配置没有问题;
3、通过抓包未发现客户端有到Oracle服务端的链接和数据传输,所以该问题应该与Oracle Server端一毛钱关系都没有;
4、发现我们产品的应用使用的是32bit库编译的,而另外一个产品的应用使用的是64bit库,但两个产品底层调用都是一样的;
5、基本锁定是该主机上装的Oracle OCI 32bit库有bug;
6、我们的资深系统工程师在Oracle官方找到了该问题的根源;
7、安装新patch后,应用顺利连接到Oracle Server,问题解决。
Oracle官方对该问题的说明摘录如下:
Solaris x86-64: Running 32-bit Applications Connecting to Database Using TNS Naming Adapter Fails With Segmentation Fault (SIGSEGV) or ORA-12154
Doc ID: 388631.1 Type: PROBLEM
Modified Date : 23-OCT-2007 Status: PUBLISHED
——————————————————————————–
Applies to:
Oracle Server – Enterprise Edition – Version: 10.2.0.2
Symptoms
Running 32-bit applications connecting to Database using TNS Naming Adapter Fails With Segmentation Violation (SIGSEGV)
Segmentation Fault(coredump)
Running 64-bit work as expected.
Other symptoms would be
ORA-12154: TNS:could not resolve the connect identifier specified
Cause
This has been identified to be caused by
Bug 5389730 10.2.0.1 32BIT OCI EXECUTABLES FAILS WITH ORA-12154 ON SOLARIS 10 X86-64(AMD64)
TNS Naming Adapter was not included within the 32-bit Naming Libraries.
Solution
This is fixed Oracle11g Client 11.0.
There exists patches for 10.2.0.2 and 10.2.0.3:
download and installPatch 5389730 with opatch or
To implement the solution manually, please execute the following steps:
Download Patch 5389730
cp $ORACLE_HOME/network/lib/ins_net_client.mk
$ORACLE_HOME/network/lib/ins_net_client.mk.prePatch_5389730
extract ins_net_client.mk into $ORACLE_HOME/network/lib/ins_net_client.mk
cd $ORACLE_HOME/network/lib
make -f ins_net_client.mk nnfgt.o
Which update (check this)
$ORACLE_HOME/lib/libn10.a and $ORACLE_HOME/lib32/libn10.a
make -f ins_net_client.mk client_sharedlib
which update (check this)
#$ORACLE_HOME/lib32/libclntsh.so
#$ORACLE_HOME/lib32/libclntsh.so.10.1
#$ORACLE_HOME/lib/libclntsh.so
#$ORACLE_HOME/lib/libclntsh.so.10.1
Check that executable is loading $ORACLE_HOME/lib32/libclntsh.so.10.1 by ldd ‘executable’
All dynamically linked applications that use libclntsh should work now.
Static linked applications, need to be relinked with the new libraries.
评论