完整的错误信息如下:
ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file: No such file or directory
在通过ggsci启动时,有可能会遇到如上错误。找不到libnnz11.so动态库文 件. 通过find命令发现该文件在"$ORACLEHOME/lib"路径中存在的:
$ find $ORACLE_HOME/ -name libnnz11.so /u01/app/oracle/product/11.2.0/dbhome_1/inventory/Scripts/ext/lib/libnnz11.so /u01/app/oracle/product/11.2.0/dbhome_1/inventory/backup/2019-03-08_10-41-36PM/Scripts/ext/lib/libnnz11.so /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so
难道是LDLIBRARYPATH 没有配置该路径么?
查看LDLIBRARYPATH 配置:
$ echo $LD_LIBRARY_PATH /u01/app/oracle/product/11.2.0/dbhome_1/lib:/opt/jdk1.8.0_181//jre/lib/amd64/server/:/opt/jdk1.8.0_181//lib:
配置是对的。那问题出在哪儿呢?
追踪进程吧:
strace ggsci execve("/u01/app/ogg/ggsci", ["ggsci"], [/* 28 vars */]) = 0 .......... mmap(NULL, 2197528, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6c71c70000 mprotect(0x7f6c71c89000, 2093056, PROT_NONE) = 0 mmap(0x7f6c71e88000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7f6c71e88000 close(3) = 0 open("/u01/app/ogg/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("./tls/x86_64/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("./tls/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("./x86_64/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("./libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/lib64/tls/x86_64/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/lib64/tls/x86_64", 0x7ffd64847c10) = -1 ENOENT (No such file or directory) open("/lib64/tls/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/lib64/tls", {st_mode=S_IFDIR|0555, st_size=6, ...}) = 0 open("/lib64/x86_64/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/lib64/x86_64", 0x7ffd64847c10) = -1 ENOENT (No such file or directory) open("/lib64/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/lib64", {st_mode=S_IFDIR|0555, st_size=77824, ...}) = 0 open("/usr/lib64/tls/x86_64/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/usr/lib64/tls/x86_64", 0x7ffd64847c10) = -1 ENOENT (No such file or directory) open("/usr/lib64/tls/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/usr/lib64/tls", {st_mode=S_IFDIR|0555, st_size=6, ...}) = 0 open("/usr/lib64/x86_64/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/usr/lib64/x86_64", 0x7ffd64847c10) = -1 ENOENT (No such file or directory) open("/usr/lib64/libnnz11.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/usr/lib64", {st_mode=S_IFDIR|0555, st_size=77824, ...}) = 0 writev(2, [{"ggsci", 5}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"libnnz11.so", 11}, {": ", 2}, {"cannot open shared object file", 30}, {": ", 2}, {"No such file or directory", 25}, {" ", 1}], 10ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file: No such file or directory ) = 116 exit_group(127) = ? +++ exited with 127 +++
从追踪结果来看,ggsci 设定的查询路径是"/u01/app/ogg"(这是我的 OGG_HOME路径 ),及该路径下的tls, "/lib64","/usr/lib64" 三个主路径, 并没有根据$LD_LIBRARY_PATH配置的路径去查找,那么我们只有一个办法:
将该库文件复制一份到 以上三个路径中的一个即可。
-
解决方法
cp $ORACLE_HOME/lib/libnnz11.so $OGG_HOME/