0
我试图从终端执行sqlplus。我已经定义.bash_profile中添加如下LD_LIBRARY_PATH线:即使设置了LD_LIBRARY_PATH,SQLPlus客户端也无法运行
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
LD_LIBRARY_PATH=/usr/local/instantclient_12_2:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
调用sqlplus中我得到这个错误:
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
当我明确出口在终端路径这只是解决:
出口LD_LIBRARY_PATH=/usr/local/instantclient_12_2:${LD_LIBRARY_PATH}
如果我已经在bash_profile中定义了错误,为什么错误仍然存在?
P.S:更改后我注销重新启动我的机器以刷新环境。但没有成功。
使用〜/ .bashrc,而不是〜/ .bash_profile中,并把有出口LD_LIBRARY_PATH =在/ usr /本地/ instantclient_12_2:$ {LD_LIBRARY_PATH}。 提到环境文件名称之前的点。 –
它工作。所以,为什么bashrc比bash_profile更受欢迎? – learner
.bash_profile在登录时执行一次。你可以在那里放置mem,cpu或磁盘统计信息。另一方面,.bashrc在登录和shell调用的其他方法上执行。我的意思是sudo,/ bin/bash等。正如你上面所说的.bashrc只是简单的工作。 –