Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> FW: FW: Running SQL script from the UNIX prompt
Sorry, I got blinded by our own internal rules (no hard-coded
userid/passwords in any scripts, period) so I just ignored that one. I
guess the answer is, if one is worried about security, your method appears
to be the way to go.
Yes, there are several options. The one I use is to execute sqlplus redirecting a file as input, which contains the password and sql script:
sqlplus -s < somefile
somefile contains
userid/password @somesqlscript exit
The down side of this, is the password is hard coded in a file. Anyone who has access to this file gets the password. However, at least you can limit access to this file. With the other method, anyone can see the passeord by issuing the ps -ef.
----------------------[Reply - Original Message]----------------------
Sent by:"Winegarden, Gary NY PO1" <WINEGARDEN_at_PO1.NY.UNISYS.COM> OK, a valid point, but do you have an alternate answer to the original question?
Watch out for this solution:
#sqlplus username/passwd @sql_script_name
Someone issuing a ps -ef will pick up the password.
----------------------[Reply - Original Message]----------------------
Sent by:Robert Hatcher <robert.hatcher_at_CITICORP.COM>
>
> Hi!
>
> I have a .sql script that I usually run from SQL*Plus using the @
command. Is
> there any way of running that script from the UNIX prompt, ie, without
getting
> into SQL*Plus first?
>
yes.
#sqlplus username/passwd @sql_script_name
It will return you to the unix prompt. Add a "-s" after sqlplus to put it
in
quiet mode.
![]() |
![]() |