Re: SQLPLUS within UNIX script problem

From: Robert Fazio <dbabob_at_hotmail.nospam.com>
Date: Sat, 15 Mar 2003 03:25:12 GMT
Message-ID: <Xns933EE411497B8dbabobhotmailcom_at_63.240.76.16>


harry827_at_yahoo.com (hs) wrote in
news:12c8e030.0303061135.187ac996_at_posting.google.com:

> The only reason, I am using this syntax is because I do not want the
> password to show up when someone does a ps -ef. By passing the
> password in as a variable, it does not show up on the ps command as
> opposed to sqlplus -s userid/password.
>
> BTW, tried with hard coded variables, still the same result.
>
> Harry
>
> cgk1_at_rocketmail.com (ck) wrote in message
> news:<be868a14.0303051817.173c2ba9_at_posting.google.com>...

>> harry827_at_yahoo.com (hs) wrote in message
>> news:<12c8e030.0303040552.45507e87_at_posting.google.com>... 
>> > I have a command that looks like the following in a unix shell
>> > script log=`sqlplus -s $DW_USER_at_$ORACLE_SID @$SCRDIR/$4 << +
>> > $PSWD
>> > +`

My strongest suggestion if connecting to a local database would be to use an os authenticated connection. Look under OS_AUTHENT_PREFIX for a description. This would allow the following

sqlplus -s / _at_$SRCDIR/$4 >/dev/null 2>&1

This would hide all information, then you could make sure in your .sql that you spool your output to a file to parse after.

If you are connecting to a database that is not on the system that you are running on, you will have to something a little different.

sqlplus -s /nolog _at_$SRCDIR/$4 >/dev/null 2>&1

in $4 (.sql file)

connect system/manager_at_$ORACLE_SID
spool output.lst
select what from thetable;
...
exit

>> > When I look a the output in $log I not only see the result set but
>> > also every file in that directory. Almost seems like echo * is
>> > happening somewhere along the line. Anyone know how I can get
>> > around this ?

Not sure, I can't see anything in your description that would cause that to occur. Are you sure you aren't adding to that $log elsewhere? Received on Sat Mar 15 2003 - 04:25:12 CET

Original text of this message