./ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file: No such

使用GoldenGate将源库的数据单向同步到目标数据库,下面是源和目标的版本及平台信息:

    源数据库:Oracle Database 10.2.0.1 64bit for Redhat 5.8 x86_64bit
    目标数据库:Oracle Database 11.2.0.1 64bit for Windows Server 2003 x86_64bit

下面是源库上的操作:
[root@redhat5 gg]# su - oracle1
[oracle1@redhat5 ~]$ cd /u01/gg
[oracle1@redhat5 gg]$ ./ggsci
./ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file: No such file or directory
 
[oracle1@redhat5 gg]$ ldd ggsci
        libdl.so.2 => /lib64/libdl.so.2 (0x0000003e8cc00000)
        libgglog.so => /u01/gg/libgglog.so (0x00002afdecd6a000)
        libggrepo.so => /u01/gg/libggrepo.so (0x00002afdecf9f000)
        libdb-5.2.so => /u01/gg/libdb-5.2.so (0x00002afded0f4000)
        libicui18n.so.38 => /u01/gg/libicui18n.so.38 (0x00002afded395000)
        libicuuc.so.38 => /u01/gg/libicuuc.so.38 (0x00002afded6f5000)
        libicudata.so.38 => /u01/gg/libicudata.so.38 (0x00002afdeda2f000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003e8d400000)
        libxerces-c.so.28 => /u01/gg/libxerces-c.so.28 (0x00002afdeea0b000)
        libantlr3c.so => /u01/gg/libantlr3c.so (0x00002afdeef23000)
        libnnz11.so => not found
        libclntsh.so.11.1 => not found
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003ea0600000)
        libm.so.6 => /lib64/libm.so.6 (0x0000003e8d000000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003e9ea00000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003e8c800000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003e8c400000)

    从上面的输出可以看出,运行ggsci工具找不到libnnz11.so和libclntsh.so.11.1共享库文件。该共享库文件是通过LD_LIBRARY_PATH环境变量指定的,指定的位置应该是$ORACLE_HOME/lib。

[oracle1@redhat5 gg]$ echo $ORACLE_HOME
/u01/app/oracle1/db_1
[oracle1@redhat5 gg]$ echo $LD_LIBRARY_PATH
/u01/app/oracle1/db_1/lib:/u01/app/oracle1/db_1/oracm/lib:/lib:/usr/lib:/usr/local/lib:/u01/app/oracle1/db_1/ctx/lib
    LD_LIBRARY_PATH已正确设置。

[oracle1@redhat5 gg]$ cd $ORACLE_HOME/lib
[oracle1@redhat5 lib]$ ls -ald libnnz11.so
ls: libnnz11.so: No such file or directory

    确实不存在libnnz11.so文件。

[oracle1@redhat5 lib]$ ls -ald libnnz*
-rw-r----- 1 oracle1 oinstall 7815540 Oct 17  2005 libnnz10.a
-rw-r----- 1 oracle1 oinstall 3803097 Oct 20  2005 libnnz10.so

    但是存在libnnz10.so文件,从这点我们可以猜想,这是由于Oracle Database是10g造成的,只需要创建相应的链接文件即可。

在$ORACLE_HOME/lib目录下创建链接到libnnz10.so的libnnz11.so文件:
[oracle1@redhat5 lib]$ ln -s /u01/app/oracle1/db_1/lib/libnnz10.so libnnz11.so

--注意:这里的$ORACLE_HOME是/u01/app/oracle1/db_1,所以到时根据自己$ORACLE_HOME路径,相应得改动下。
[oracle1@redhat5 lib]$ cd -
/u01/gg
[oracle1@redhat5 gg]$ ./ggsci
./ggsci: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory

libclntsh.so.11.1做同样的处理:

[oracle1@redhat5 gg]$ cd $ORACLE_HOME/lib
[oracle1@redhat5 lib]$ ls -ald libclntsh.so*
lrwxrwxrwx 1 oracle1 oinstall       43 May 20  2013 libclntsh.so -> /u01/app/oracle1/db_1/lib/libclntsh.so.10.1*
-rwxr-x--- 1 oracle1 oinstall 20706597 May 20  2013 libclntsh.so.10.1*
[oracle1@redhat5 gg]$ ln -s $ORACLE_HOME/lib/libclntsh.so.10.1 libclntsh.so.11.1

也可以将链接文件创建在$GGHOME目录下。

[oracle1@redhat5 gg]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14

Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.


GGSCI (redhat5) 1> 

之后正常打开ggsci工具。

参考文章:
http://somireddy.wordpress.com/2013/06/05/libnnz11-so-cannot-open-shared-object-file-no-such-file-or-directory/

--end--

 

--有的可能是其他原因造成的,可以参考:

http://www.linuxidc.com/Linux/2013-04/82942.htm

http://blog.csdn.net/huzia/article/details/7376740

http://www.xifenfei.com/1667.html

你可能感兴趣的:(./ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file: No such)