Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQLPlus scripts in Unix
On Wed, 02 Jun 1999 21:11:01 -0700, Mirza Mohsin Beg
<mbeg_at_netearnings.com> wrote:
>
>
>How about you execute your SQL code via a PL/SQL procedure that you schedule via
>DBMS_JOB package. That way your DB Server will run it internally.
That's a good way. You can also set up an "OPS$" account so you can access the database without specifying a password.
If your Unix user is called "jimmy", the corresponding Oracle account is called "ops$jimmy".
You can create the account via this command:
create user ops$jimmy identified externally ... etc.
At the shell you'd log in to SQL*Plus this way:
sqlplus /
The "/" replaces the "user/password" combo normally used.
In a script you might want to do it like this:
sqlplus -s / @myscript.sql
You can also change the prefix via the init.or parameter os_authent_prefix or something like that. OPS$ is the default.
>Of course if you are spooling output, you might want to use UTL_FILE package to
>do file I/O.
>
>
>-M
>
>
>
>Brian Peasland wrote:
>
>> I have an easy question. I want to set up a cron job to run an SQLPlus
>> script at certain times. My dilemma is how to hide the userid/password. If I
>> store that info in the script, I'm afraid others might be able to "see" it.
>> How can I automate some script processing and still be able to maintain
>> security. How do you do it?
>>
>> Thanks in advance!
>> Brian Peasland
>> peasland_at_msn.com
![]() |
![]() |