Monday, July 21, 2008

Hiding Passwords From UNIX ps Command

Hiding Passwords From UNIX ps Command

When running an sql script from unix OS, the unix ps (process status) command will show the Oracle userid and password of the sqlplus session.

To get around this problem, you should consider using pipe in script to pass the the password into sqlplus Below are examples of piping in the password (userid system, password systempw) for sqlplus, import, and export.

$ echo system_password sqlplus -s system @MYSCRIPT
$ echo system_password imp system file=myfile.dmp tables=mytable
$ echo system_password exp system file=myfile.dmp tables=mytable

Alternatively, run the following commands:

$ sqlplus <<EOF
SYSTEM/system_password
SELECT ...
EXIT
EOF

No comments: