从 shell 脚本调用 sqlplus 时抑制 passwd [英] Suppressing passwd when calling sqlplus from shell script
本文介绍了从 shell 脚本调用 sqlplus 时抑制 passwd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的脚本以标准格式调用sqlplus
:
My script calls sqlplus
in the standard format:
sqlplus $USER/$PASSWD@$DBNAME
显然,这不是很安全,因为 ps -ef
显示整个命令,包括密码.
Obviously, this is not very safe because ps -ef
displays the entire command, including the passwd.
如何在没有手动提示的情况下调用 sqlplus 但仍然隐藏密码?
How can I invoke sqlplus without a manual prompt but still hide the passwd?
谢谢
推荐答案
坏处:
sqlplus $USER/$PASSWD@$SID<<!!
...
--some SQL
...
!!
ps -ef
显示连接字符串
好:
sqlplus /nolog<<!!
connect $USER/$PASSWD@$SID;
...
--some SQL
...
!!
ps -ef
不显示连接字符串
这篇关于从 shell 脚本调用 sqlplus 时抑制 passwd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文