学海无涯学海无涯

I am a slow walker,
but i never walk backwards.

ogg提示./ggsci: error while loading shared libraries: libjvm.so: cannot open shared object file: No such file or directory

源端安装完ogg后,执行./ggsci 进不去,报错 :无法打开libjvm.so ,找不到路径,或者文件:

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

运行ldd ggsci:

[oracle@oracle ogg]$ ldd ggsci
        linux-vdso.so.1 =>  (0x00007ffd7b1ed000)
        librt.so.1 => /lib64/librt.so.1 (0x0000003bd1c00000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000003bd1000000)
        libgglog.so => /home/oracle/ogg/./libgglog.so (0x00007fe26f169000)
        libggutil.so => /home/oracle/ogg/./libggutil.so (0x00007fe26ef47000)
        libggrepo.so => /home/oracle/ogg/./libggrepo.so (0x00007fe26ec59000)
        libdb-6.1.so => /home/oracle/ogg/./libdb-6.1.so (0x00007fe26e843000)
        liblmdb.so => /home/oracle/ogg/./liblmdb.so (0x00007fe26e62e000)
        libggperf.so => /home/oracle/ogg/./libggperf.so (0x00007fe26e3f2000)
        libggparam.so => /home/oracle/ogg/./libggparam.so (0x00007fe26cbdf000)
        libicui18n.so.56 => /home/oracle/ogg/./libicui18n.so.56 (0x00007fe26c719000)
        libicuuc.so.56 => /home/oracle/ogg/./libicuuc.so.56 (0x00007fe26c31d000)
        libicudata.so.56 => /home/oracle/ogg/./libicudata.so.56 (0x00007fe26a4ba000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003bd1800000)
        libxerces-c-3.1.so => /home/oracle/ogg/./libxerces-c-3.1.so (0x00007fe269e2a000)
        libantlr3c.so => /home/oracle/ogg/./libantlr3c.so (0x00007fe269c11000)
        libjvm.so => not found
        libggnnzitp.so => /home/oracle/ogg/./libggnnzitp.so (0x00007fe26919c000)
        libm.so.6 => /lib64/libm.so.6 (0x0000003bd2000000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003bd1400000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003bd0c00000)
        libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003bdf400000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003bdc800000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003bdc400000)

由上 libjvm.so => not found 没找到libjvm.so。

查看配置的LD_LIBRARY_PATH环境变量:

vi ~/.bash_profile

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

去$ORACLE_HOME/lib并未找到libjvm.so,说明确实缺少该文件。
最后得知在jdk的安装文件从下面有libjvm.so。
将jdk路径下的libjvm.so配置到LD_LIBRARY_PATH里面:

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/opt/jdk1.8.0_161/jre/lib/amd64/server

现在 ~/.bash_profile 格式为:

[oracle@oracle ~]$ vi .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
umask 022
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/opt/jdk1.8.0_161/jre/lib/amd64/server

export GGATE_HOME=/home/oracle/og

使配置生效:

source ~/.bash_profile 

重新执行:

[oracle@oracle ogg]$ ./ggsci 

Oracle GoldenGate for Big Data
Version 12.3.2.1.0 (Build 018)

Oracle GoldenGate Command Interpreter
Version 12.3.0.1.2 OGGCORE_OGGADP.12.3.0.1.2_PLATFORMS_180430.2321
Linux, x64, 64bit (optimized), Generic on May  1 2018 19:58:51
Operating system character set identified as UTF-8.

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

GGSCI (oracle) 1> 

ok,解决问题!

本原创文章未经允许不得转载 | 当前页面:学海无涯 » ogg提示./ggsci: error while loading shared libraries: libjvm.so: cannot open shared object file: No such file or directory

评论 1

  1. 你的博客咋不申请一个googleadsense呢 还能有广告收入呢。哈哈

    魅力934 2020-09-29    回复