Echo password to sql*plus [message #528455] |
Tue, 25 October 2011 01:58 |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
Hi all,
I'm trying to find an easy way to have a a unix script to call sqlplus and log onto the database, however I'm sure you'll realise that this leaves the password knocking about in ps.
I know that I can do this for batches to avoid it
But if I execute that above to simply make an ad-hoc session it exits immediately, is there any easy way around this?
Basically trying to save myself some trouble typing the passwords all the time but masking it from the PS list.
|
|
|
|
|
Re: Echo password to sql*plus [message #534789 is a reply to message #528460] |
Fri, 09 December 2011 04:02 |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
I should really have followed up on this earlier.
I went for a program doing this:
cat >~/sql/pwtmp.sql<< EOF
conn $UNAME/$ORA_USER_PW
@login
EOF
chmod 700 ~/sql/pwtmp.sql
sqlplus /nolog @pwtmp.sql
#rm ~/sql/pwtmp.sql
Not perfect, but good enough for my needs.
Just leaves
sqlplus /nolog @pwtmp.sql
on a ps -ef execution.
[Updated on: Fri, 09 December 2011 04:02] Report message to a moderator
|
|
|