Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: help:hide/encrypt an oracle password in a shell script

Re: help:hide/encrypt an oracle password in a shell script

From: Mathieu Hornsperger <mlvmxh02_at_nmpks0.mpk.nt.com>
Date: 1997/04/17
Message-ID: <3355DBBA.FF6D5DF@nmpks0.mpk.nt.com>#1/1

wrote:
>
> I would appreciate if somebody can help me out
> with the following issue:
>
> I wrote a shell program that invokes Oracle's SQL*PLUS
> (eg. myid/password @sql_script.sql), but the problem
> is that ps -ef| grep sql will display the user and the
> oracle password. How can I hide the password?
>
> myid and password are passed as positional
> parameters, but I am thinking of changing it to interactive mode
> (menu-driven) so myid and password would be entered from a menu as follows:
>
> Oracle id: myid
> Password : ********
>
> the the script should invoke SQL*PLUS:
> myid/******** @sql_script.sql
>
> and ps -ef|grep sql hopefully will not show password,
>
> Thank you.
> Santiago Cabezas
> Oracle DBA
> santiago.cabezas_at_cplc.com
> Carolina Power&Light co.

You can handle that with a shell-script:

  1. Set in a shell script two variables : MY_USER and MY_PASSWORD
  2. In the script: sqlplus /NOLOG << m connect $MY_USER/$MY_PASSWORD <... other sql*plus stuff ...> exit m

With that, ps -ef shows sqlplus /NOLOG and nothing else anymore.

Hope this helps.

-- 
Mathieu HORNSPERGER
mailto:mlvmxh02_at_nortel.ca
ESN:  578 7714
Tel: +33 [0]1 64 76 77 14
Received on Thu Apr 17 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US