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只是簡單的工作。 –