Suppressing passwd when calling sqlplus from shell script

末鹿安然 提交于 2019-12-12 20:50:43

问题


My script calls sqlplus in the standard format:

sqlplus $USER/$PASSWD@$DBNAME

Obviously, this is not very safe because ps -ef displays the entire command, including the passwd.

How can I invoke sqlplus without a manual prompt but still hide the passwd?

Thanks


回答1:


What you need is a different method of authentication, such as the Oracle Wallet.

Here's a walk-through in the documentation.

http://docs.oracle.com/cd/E11882_01/network.112/e16543/authentication.htm#CBHGEBEI




回答2:


BAD:

sqlplus $USER/$PASSWD@$SID<<!!

...
--some SQL
...

!!

ps -ef displays connect string

GOOD:

sqlplus /nolog<<!!

connect $USER/$PASSWD@$SID;

...
--some SQL
...

!!

ps -ef does not display connect string



来源:https://stackoverflow.com/questions/13476419/suppressing-passwd-when-calling-sqlplus-from-shell-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!