PDA

View Full Version : shell scripts to execute stored procedures


samasamajam
12-28-02, 04:28
Hi all

could someone plss suggest the differant ways in which, scheduling of Shell Scripts which execute database(oracle8.1.7) stored procedures, is possible in a sun solaris server or unix.
The shell scripts and the stored procedures should be triggered at specified intervals of time.
Plss elaborate as to how this can be done using cron jobs and Control-M in particular

thebap
02-27-03, 08:26
use a cronjob to execute a script like the one below :-

==%<=====================================
#!/usr/bin/sh
### Analyze the FRED schema
###

ORACLE_HOME=/oracle8i/app/oracle/product/817
PATH=/oracle8i/app/oracle/product/817/bin:$PATH
ORACLE_SID=FREDDB
export ORACLE_HOME PATH ORACLE_SID
$ORACLE_HOME/bin/sqlplus '/ as sysdba' << EOF
execute dbms_stats.gather_schema_stats ownname=>'FRED',cascade=>TRUE);
EOF
==%<=====================================

Ensure that you set ORACLE_HOME,PATH & ORACLE_SID as running from a CRON does not provide you with these by default !!!

Gud Luk

kazooka
03-19-03, 05:55
Do you have any idea as to how i would do a multiline replacement in sed

thebap
03-19-03, 06:00
Yes thanks I do.

But why ask this within an ORACLE forumn ?????


sed 's/<search>/<replace>/g'

NB: g means global - default is for the current line ....

If you need UNIX scripting help then try a UNIX site.

kazooka
03-19-03, 06:06
Sorry bout that

But just one last question plz.

I need to replace
CALL "ABC"
with

CALL "OBE"
DISPLAY "hello"

without overwriting and i cant seem to get it done.
plz