需要使用sqlplus连接数据库,sqlplus没配好:
[root@ls4201 ~]# sqlplus
-bash: sqlplus: command not found
解决方法是:
1, 拷贝oracle客户端到目标机器:
scp /usr/lib/oracle ip:/usr/lib/oracle
2, 在/etc/profile.d/ 下添加oracle.sh 文件,把oracle客户端地址加到path环境变量上,也可以更改 ~/.bath_profile 文件实现:
oracle.sh :
LD_LIBRARY_PATH=/usr/lib/oracle/linux/client/lib
PATH=/usr/lib/oracle/linux/client/bin:$PATH
export PATH
export LD_LIBRARY_PATH
3,运行sqlplus,出现:
[root@ls4201 ~]# sqlplus
sqlplus: error while loading shared libraries: /usr/lib/oracle/linux/client/lib/libnnz11.so: cannot restore segment prot after reloc: Permission denied
4,执行以下命令:
[root@ls4201 ~]# getenforce
Enforcing
[root@ls4201 ~]# setenforce 0
[root@ls4201 ~]# getenforce
Permissive
5,sqlplus可以使用了。
[root@ls4201 ~]# sqlplus
SQL*Plus: Release 11.1.0.7.0 - Production on Wed Mar 30 16:38:10 2011
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Enter user-name: ^[^[
本栏目更多精彩内容:http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/