Suppressing passwd when calling sqlplus from shell

2019-07-20 14:48发布

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

2条回答
\"骚年 ilove
2楼-- · 2019-07-20 15:10

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

查看更多
对你真心纯属浪费
3楼-- · 2019-07-20 15:14

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

查看更多
登录 后发表回答