Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: How I run a shell script from the scheduler on 10.2.0.2.0 ?
Here is an example of using dbms_scheduler on Solaris 5.9 +
10.2.0.2
(the dir below shows 10.2.0 but is at 10.2.0.2 patch level)
BEGIN
dbms_scheduler.drop_job('exp_erpdb');
END;
/
BEGIN
dbms_scheduler.create_job(
job_name => 'exp_erpdb', job_type => 'EXECUTABLE', job_action => '/home/oracle/scripts/exp_erpdb.sh', start_date => '20-JUN-07 09:00:00 PM', end_date => null, repeat_interval => 'freq=daily; byhour=21; byminute=00;', job_class => 'DBAMaintJobs', enabled => FALSE, comments => 'This job creates daily exp logfiles');END;
$ /home/oracle/scripts> ls -l /home/oracle/scripts/exp_erpdb.sh
-rwxr----- 1 oracle dba 1176 Aug 7 20:11
/home/oracle/scripts/exp_erpdb.sh
$ /home/oracle/scripts> more /home/oracle/scripts/exp_erpdb.sh #!/bin/ksh . /home/oracle/oracle.env
$ /home/oracle/product/10.2.0/bin> ls -l |grep ext
-rwxr-x--- 1 oracle dba 28808 Oct 24 2006 extjob
-rwxr-xr-x 1 oracle dba 28496 Feb 20 2006 extjobO
-rwx------ 1 oracle dba 28808 Oct 24 2006 extjobo
-rwxr-xr-x 1 oracle dba 28496 Feb 20 2006 extjoboO
-rwxr-x--x 1 oracle dba 33136 Oct 24 2006 extproc
-rwxr-xr-x 1 oracle dba 26200 Oct 24 2006 extproc32
-rw-r--r-- 1 oracle dba 26252 Jan 9 2006 extproc32O
-rwxr-x--- 1 oracle dba 0 Feb 25 2006 extprocO
-rwxr-xr-x 1 oracle dba 315 Mar 27 2006
extusrupgrade
$ /home/oracle/product/10.2.0/bin> ls -l |grep ext
-rwxr-x--- 1 oracle dba 28808 Oct 24 2006 extjob
-rwxr-xr-x 1 oracle dba 28496 Feb 20 2006 extjobO
-rwx------ 1 oracle dba 28808 Oct 24 2006 extjobo
-rwxr-xr-x 1 oracle dba 28496 Feb 20 2006 extjoboO
-rwxr-x--x 1 oracle dba 33136 Oct 24 2006 extproc
-rwxr-xr-x 1 oracle dba 26200 Oct 24 2006 extproc32
-rw-r--r-- 1 oracle dba 26252 Jan 9 2006 extproc32O
-rwxr-x--- 1 oracle dba 0 Feb 25 2006 extprocO
-rwxr-xr-x 1 oracle dba 315 Mar 27 2006
extusrupgrade
$ /home/oracle/product/10.2.0/bin>
$ /home/oracle/product/10.2.0/rdbms/admin> ls -l |grep extern
-rw-r----- 1 oracle dba 1532 Mar 27 16:55
externaljob.ora
-rw-r----- 1 oracle dba 1534 Dec 22 2005
externaljob_original.ora
$ /home/oracle/product/10.2.0/rdbms/admin> grep =
externaljob_original.ora
run_user = nobody
run_group = nobody
$ /home/oracle/product/10.2.0/rdbms/admin> $ /home/oracle/product/10.2.0/rdbms/admin> $ /home/oracle/product/10.2.0/rdbms/admin> grep = externaljob.orarun_user = oracle
--
http://www.freelists.org/webpage/oracle-l
Received on Sat Sep 08 2007 - 02:19:30 CDT