今天要使用DB2數據庫,切換db2inst1用戶時在linux shell中不顯示路徑了,顯示為-bash-4.1#。
並且在使用DB2的命令時提示SQL10007N Message "-1390" could not be retrieved. Reason code: "3".
經過查詢資料后發現應該是環境變量的問題。
cd /home/db2inst1
vim ~/.bash_profile
在db2inst1用戶的環境變量文件中添加:
export PATH=$PATH:$HOME/bin:/home/db2inst1/sqllib/bin if [ -f /home/db2inst1/sqllib/db2profile ] then source /home/db2inst1/sqllib/db2profile fi
記得使環境變量生效
source ~/.bash_profile
此時恢復正常