exp: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No suc

将exp的脚本写在shell中,运行时出错,脚本很简单如下:

[client@NYS amrldvw]$ vi exp.sh 
#!/bin/sh


cd /u01/dump/amrldvw
owner=amrldvw
year=2018
sid=c208

exp ${owner}/${owner}@${sid} file=${owner}_${year}.dmp log=${owner}_${year}.log tables=%${year}% direct=y statistics=none
gzip ${owner}_${year}.dmp

出错信息如下:

[client@NYS amrldvw]$ at now
at> /u01/dump/amrldvw/exp.sh  > log.log 2>&1
at> <EOT>
job 215 at 2018-11-02 08:38
[client@NYS amrldvw]$ cat log.log 

exp: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory
gzip: amrldvw_2018.dmp: No such file or directory

不过这台机器直接运行exp是正常的,exp放在脚本中运行就出错了。

 

通过网上查找方法,解决如下:

确定当前的$ORACLE_HOME

[client@NYS amrldvw]$ cd $ORACLE_HOME/lib
[client@NYS lib]$ pwd
/home/client/app/oracle/product/10201/lib

确保$ORACLE_HOME/lib下面有libclntsh.so.10.1文件

[client@NYS lib]$ ll libclntsh.so.10.1 
-rwxrwxrwx. 1 client client 19007643 Jun 24  2008 libclntsh.so.10.1

用root帐号修改/etc/ld.so.conf,将/home/client/app/oracle/product/10201/lib添加进去

[root@NYS ~]# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/home/client/app/oracle/product/10201/lib

运行ldconfig

[root@NYS ~]# ldconfig
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmuc.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmalk.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmefud.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmasf.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmefut.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmeoci.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmefsql.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmefos.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libordim10.soO is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmarl.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmevq.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmadm.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmadbg.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmefvr.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmemso.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmuk.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmastk.so.0 is empty, not checked.
ldconfig: File /home/client/app/oracle/product/10201/lib/libnmefw.so.0 is empty, not checked.
ldconfig: /home/client/app/oracle/product/10201/lib/libexpat.so.0 is not a symbolic link

重新试一下是否正常

[client@NYS amrldvw]$ at now
at> /u01/dump/amrldvw/exp.sh >log.log 2>&1
at> <EOT>
job 220 at 2018-11-02 08:45

[client@NYS amrldvw]$ cat log.log 

Export: Release 10.2.0.4.0 - Production on Fri Nov 2 08:45:52 2018

Copyright (c) 1982, 2007, Oracle.  All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)

About to export specified tables via Direct Path ...
. . exporting table                 CABLE_REF_2018       5170 rows exported
. . exporting table               DAYPART_REF_2018        246 rows exported
. . exporting table           DEMO_BB_CAT_REF_2018       1312 rows exported
. . exporting table                   HH_INFO_2018          0 rows exported

问题解决。

参考:

https://blog.csdn.net/red10057/article/details/8202255

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值