安装ora2pg中遇到的问题 /usr/bin/ld: 找不到 -lnsl,make: *** [Makefile:524:blib/arch/auto/DBD/Oracle/Oracle.so] 错

[root@db223 software]# export ORACLE_HOME=/home/app
[root@db223 software]# export PATH=$ORACLE_HOME/bin:$PATH
[root@db223 software]# export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
[root@db223 software]# cd DBD-Oracle-1.70
[root@db223 DBD-Oracle-1.70]# perl Makefile.PL -l

Multiple copies of Driver.xst found in: /usr/local/lib64/perl5/auto/DBI/ /usr/lib64/perl5/vendor_perl/auto/DBI/ at Makefile.PL line 39.
Using DBI 1.643 (for perl 5.026003 on x86_64-linux-thread-multi) installed in /usr/local/lib64/perl5/auto/DBI/

Configuring DBD::Oracle for perl 5.026003 on linux (x86_64-linux-thread-multi)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a linux, Ver#4.19
Using Oracle in /home/app
DEFINE _SQLPLUS_RELEASE = "1903000000" (CHAR)
Oracle version 19.3.0.0 (19.3)
Found direct-link candidates: libclntsh.so
Oracle sysliblist: -ldl -lm -lpthread -lnsl -lirc -limf -lirc -lrt -laio -lresolv -lsvml
Found header files in /home/app/rdbms/public.
Your LD_LIBRARY_PATH env var is set to '/home/app/lib:'

client_version=19.3

.

.

.
***  If you have problems...
     read all the log printed above, and the README and README.help.txt files.
     (Of course, you have read README by now anyway, haven't you?)

[root@db223 DBD-Oracle-1.70]# make
 

/usr/bin/ld: 找不到 -lnsl
collect2: 错误:ld 返回 1
make: *** [Makefile:524:blib/arch/auto/DBD/Oracle/Oracle.so] 错误 1

 [root@db223 oracle]# yum install -y libnsl
Repository extras is listed more than once in the configuration
上次元数据过期检查:5:39:50 前,执行于 2022年10月25日 星期二 05时51分46秒。
软件包 libnsl-2.28-164.el8.x86_64 已安装。
依赖关系解决。
无需任何处理。
完毕!

[root@db223 oracle]# find / -name libnsl.so
/home/app/lib/stubs/libnsl.so

发现/usr/lib64/路径下找不到 libnsl.so,而且yum安装的是 libnsl-2.28.so版本,版本有点高 从其他机器上拷贝对应的版本libnsl-2.17.so

[root@db223 DBD-Oracle-1.70]# cd /usr/lib64/
[root@db223 lib64]# ll libnsl*
-rw-r--r--  1 root root 115816 10月 25 12:27 libnsl-2.17.so
-rwxr-xr-x  1 root root 163696 8月  25 2021 libnsl-2.28.so
lrwxrwxrwx  1 root root     14 8月  25 2021 libnsl.so.1 -> libnsl-2.28.so
lrwxrwxrwx. 1 root root     15 5月  11 2019 libnsl.so.2 -> libnsl.so.2.0.0
-rwxr-xr-x. 1 root root 120592 5月  11 2019 libnsl.so.2.0.0
[root@db223 lib64]# chmod 755 libnsl-2.17.so
[root@db223 lib64]# ll libnsl*
-rwxr-xr-x  1 root root 115816 10月 25 12:27 libnsl-2.17.so
-rwxr-xr-x  1 root root 163696 8月  25 2021 libnsl-2.28.so
lrwxrwxrwx  1 root root     14 8月  25 2021 libnsl.so.1 -> libnsl-2.28.so
lrwxrwxrwx. 1 root root     15 5月  11 2019 libnsl.so.2 -> libnsl.so.2.0.0
-rwxr-xr-x. 1 root root 120592 5月  11 2019 libnsl.so.2.0.0
 

[root@db223 lib64]# rm -rf libnsl.so
[root@db223 lib64]# ln -s libnsl-2.17.so libnsl.so
[root@db223 lib64]# ll libnsl*
-rwxr-xr-x  1 root root 115816 10月 25 12:27 libnsl-2.17.so
-rwxr-xr-x  1 root root 163696 8月  25 2021 libnsl-2.28.so
lrwxrwxrwx  1 root root     14 10月 25 12:35 libnsl.so -> libnsl-2.17.so
lrwxrwxrwx  1 root root     14 8月  25 2021 libnsl.so.1 -> libnsl-2.28.so
lrwxrwxrwx. 1 root root     15 5月  11 2019 libnsl.so.2 -> libnsl.so.2.0.0
-rwxr-xr-x. 1 root root 120592 5月  11 2019 libnsl.so.2.0.0
[root@db223 DBD-Oracle-1.70]# make
[root@db223 DBD-Oracle-1.70]# make install

之后安装完成。

你可能感兴趣的:(ora2pg,ora2pg,postgresql,oracle,-lnsl,DBD-Oracle)