Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: create a batch file to execute script
Here is a copy of some email one of our DBA's sent out. I used this method
on some scripts yesterday and it worked fine. This was probably for 7.3.4
so I don't know about 8.0.4.
Good Luck!
Ron
Problem:
You can see the a sqlplus users password when issuing the ps command. Example:
oracle_at_merger1:> ps -ef | grep sqlplus
applmgr 26300 27999 0 16:10:20 ttyp6 0:00 sqlplus apps/apps_at_merger1 applmgr 3707 7402 0 07:16:18 ? 0:00 sqlplus -silent APPS/APPS
Solution:
SQL Script my.sql containing the apps password:
connect apps/appspasswd
select sysdate from dual;
exit;
To avoid revealing the apps password type the following to execute the
script:
sqlplus /nolog @my.sql
The ps will show sqlplus /nolog. Example
oracle_at_merger1:> ps -ef | grep sqlplus
oracle 9465 9210 6 07:54:36 ttyp3 0:00 sqlplus /nolog @my.sql
-----Original Message-----
From: Lisa_Koivu_at_gelco.com [mailto:Lisa_Koivu_at_gelco.com]
Sent: Friday, June 09, 2000 11:02 AM
To: Multiple recipients of list ORACLE-L
Subject: RE: create a batch file to execute script
Ron,
seems to me there just isn't a foolproof way around that. I've used hide.c
and
it works sometimes - it screws up my export script though. I've also tried
<<!
or <<EOF right after sqlplus and that doesn't work either (on Solaris 2.6).
Plus there's a bug in 8.0.4 that you can't connect to a remote db if you do
username_at_dbname. You must use username/pw_at_dbname. I've kind of given up.
Yes
it's bad but what else can I do? There's so many other fires that this fell
to
the bottom.
"Smith, Ron L." <rlsmith_at_kmg.com> on 06/09/2000 10:11:30 AM
Please respond to ORACLE-L_at_fatcity.com
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: (bcc: Lisa Koivu/GELCO)
Be careful with scripts like this. Anyone can see the password on Unix with
the PS command.
Ron Smith
Database Administration
rlsmith_at_kmg.com
-----Original Message-----
Sent: Friday, June 09, 2000 9:25 AM
To: Multiple recipients of list ORACLE-L
I would recommend either calling the second script at the end of the first
script,
or
making a third script that simply calls the other two:
plus33.exe scott/tiger_at_my_db @script3
script3.sql::
@@script1
@@script2
exit
HTH,
Steve Monaghan
> -----Original Message-----
> From: B, Ravindra [mailto:Ravindra.B_at_Compaq.com]
> Sent: Friday, June 09, 2000 12:42 AM
> To: 'ORACLE-L_at_fatcity.com'
> Cc: 'Steve.Monaghan_at_wcom.com'
> Subject: RE: create a batch file to execute script
>
>
> Steve,
>
> Thanks for the mail.It worked for me.
>
> What if I want to execute two scripts in the same sqlplus session.
> I tried
>
> plus33.exe scott/tiger_at_my_db @script1 @script2
>
> But this doesn't work.The second script doesn't get executed.
>
> How can I do this.Pls advice.
>
> Regards,
> Ravindra
>
> -----Original Message-----
> From: Steven Monaghan [mailto:Steve.Monaghan_at_wcom.com]
> Sent: Thursday, June 08, 2000 11:16 PM
> To: Multiple recipients of list ORACLE-L
> Subject: RE: create a batch file to execute script
>
>
> Put parameters after the executable.
>
> First parameter is the login.
> Second is the script.
>
> plus33.exe scott/tiger_at_my_db @script1
>
> We do this all the time here on NT. Works file. We even have
> looping batch
> files to kick off scripts every so many minutes. Put an exit at
> the end of
> the script if you want the window to close when done.
>
> Steve Monaghan
> Worldcom
>
> > -----Original Message-----
> > From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of B, Ravindra
> > Sent: Thursday, June 08, 2000 10:18 AM
> > To: Multiple recipients of list ORACLE-L
> > Subject: create a batch file to execute script
> >
> >
> > How can i create a batch file under windows Nt platform that will invoke
> > sqlplus and run a
> > sql file for me.i was able to create a batch file that will execute the
> > plus33.exe and log in
> > as system user.But i was not able to get the script (c.sql) executed.
> >
> > pls advice
> >
> > thanks,
> > ravindra
> > --
> > Author: B, Ravindra
> > INET: Ravindra.B_at_compaq.com
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
> >
>
> --
> Author: Steven Monaghan
> INET: Steve.Monaghan_at_wcom.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
-- Author: Steven Monaghan INET: Steve.Monaghan_at_wcom.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Author: Smith, Ron L. INET: rlsmith_at_kmg.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Author: INET: Lisa_Koivu_at_gelco.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and inReceived on Fri Jun 09 2000 - 13:21:40 CDT