How To Hide Unix Passwords
Table of Contents


When running a SQL script from UNIX, the UNIX ps (process status) command has a nasty habit of showing the Oracle user-id and password of the sqlplus session. To get around this problem, pipe the password into sqlplus instead of putting it in as part of the sqlplus command line (which is what shows up in the ps listing).

Below are examples of piping in the password (user-id: system; password: systempw) for sqlplus, imp, and exp. If put into a UNIX shell command file, such as myfile.ksh, ensure chmod 700 myfile.ksh is run so that only the owner user-id can see the Oracle passwords in the file.


      echo systempw  | sqlplus -s system @myfile.sql 

      echo systempw  | imp system file=myfile.dmp tables=mytable 

      echo systempw  | exp system file=myfile.dmp tables=mytable 

      cat myfile.ksh | sqlplus -s system @myfile.sql
© copyright 2001-2014 | all rights reserved