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


完整的錯誤信息如下:

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}, {"\n", 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/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM