问题描述
在10g以后,一般情况下环境变量中没有必要设置LD_LIBRARY_PATH,但是一旦将ORACLE_HOME迁移到其他目录,则环境变量中还需要添加这个变量。
Linux和Unix支持TAR方式迁移ORACLE_HOME,如果有需要将ORACLE_HOME放到其他路径下,那么一般都会使用tar的方式将整个路径拷贝到目标目录。
但是迁移后,如果直接尝试sqlplus启动,可能报错:
[orat3@hpserver2 ~]$ sqlplus / AS sysdba sqlplus: error while loading shared libraries: libsqlplus.so: cannot OPEN shared object file: No such file OR directory
专家解答
而设置LD_LIBRARY_PATH后,问题解决:
[orat3@hpserver2 ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib [orat3@hpserver2 ~]$ sqlplus / AS sysdba SQL*Plus: Release 10.2.0.4.0 - Production ON Sun Mar 18 16:10:57 2012 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 SQL>
还有一种类似的错误:
[orat0@hpserver2 ~]$ sqlplus / AS sysdba SQL*Plus: Release 10.2.0.5.0 - Production ON Sun Mar 18 16:12:03 2012 Copyright (c) 1982, 2010, Oracle. ALL Rights Reserved. oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot OPEN shared object file: No such file OR directory ERROR: ORA-12547: TNS:lost contact Enter user-name: oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot OPEN shared object file: No such file OR directory ERROR: ORA-12547: TNS:lost contact Enter user-name: oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot OPEN shared object file: No such file OR directory ERROR: ORA-12547: TNS:lost contact SP2-0157: unable TO CONNECT TO ORACLE after 3 attempts, exiting SQL*Plus [orat0@hpserver2 ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib [orat0@hpserver2 ~]$ sqlplus / AS sysdba SQL*Plus: Release 10.2.0.5.0 - Production ON Sun Mar 18 16:12:18 2012 Copyright (c) 1982, 2010, Oracle. ALL Rights Reserved. Connected TO: Oracle DATABASE 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production WITH the Partitioning, OLAP, DATA Mining AND REAL Application Testing options SQL>
错误的表相虽然不同,但是解决方法是相同的。
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。