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

Home -> Community -> Usenet -> c.d.o.misc -> Re: sqlplus and unix - hidden user and password

Re: sqlplus and unix - hidden user and password

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Thu, 13 Jan 2000 13:48:54 GMT
Message-ID: <387DD7C6.785BC2F2@edcmail.cr.usgs.gov>


Kevin,

Here is a snippet from a shell program that I wrote to generate a weekly report:

   sqlplus system @$SCRIPT_HOME/weekly_reports.sql < $SCRIPT_HOME/pass

In the script, I set the environment variable SCRIPT_HOME to point to the subdir where my scripts are. If you are calling SQL*Plus from a script, you will need to provide the absolute path to your SQL script and your password file. That's why I set up the environment variable in my script.

HTH,
Brian

Kevin A Lewis wrote:
>
> Yours appeared at first sight to be the most promising of the answers
> however
>
> with a file dba/abcd.efg contining the password i cannot get the following
> to work
>
> sqlplus system @test.sh < dba/abcd.efg
>
> SQL*Plus: Release 8.0.5.0.0 - Production on Wed Jan 12 16:4:25 2000
>
> (c) Copyright 1998 Oracle Corporation. All rights reserved.
>
> Enter password:
> ERROR:
> ORA-01017: invalid username/password; logon denied
>
> any ideas
>
> Regards
>
> --
> Kevin A Lewis (BOCM PAULS LTD) - Animal Feed Manufacturer - Ipswich United
> Kingdom)
> <Kevin_A_Lewis_at_Hotmail.com>
>
> The views expressed herein by the author of this document
> are not necessarily those of BOCM PAULS Ltd.
> Brian Peasland <peasland_at_edcmail.cr.usgs.gov> wrote in message
> news:387B34A4.2B09FCF7_at_edcmail.cr.usgs.gov...
> > You can also put the password as the only line in a file. Save that file
> > as "passwd" or other name. Do a "chmod 400 passwd" so that noone else
> > can see your password file. Then you can call scripts through cron (or
> > other) by doing:
> >
> > sqlplus userid @scriptfile < passwd
> >
> > The advantage of this method is that should your user's password change,
> > you only have to change it in one location, not many different scripts.
> >
> > HTH,
> > Brian
> >
> >
> > Sigrid Staudte wrote:
> > >
> > > Hi...
> > >
> > > I'm starting sqlplus from a unix shell in a shell script with the
> command
> > >
> > > sqlplus user/password<<EOF
> > > ...
> > > sql-statements
> > > ...
> > > exit;
> > > EOF
> > >
> > > The database is running on the unix server. When I start the command
> > >
> > > ps -ef |grep user
> > >
> > > then the complete command sqlplus user/password is displayed. So can
> > > anybody find out the username and password.
> > > Is there a possibility to hidden user and password? Is there another
> > > way to start sqlplus in a shell script, so that nobody can seen the
> > > user and password with the ps command.
> > >
> > > Regards...
> > >
> > > Sigrid
Received on Thu Jan 13 2000 - 07:48:54 CST

Original text of this message

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