Re: How I run a shell script from the scheduler on 10.2.0.2.0 ?

  • From: "Stefan Knecht" <knecht.stefan@xxxxxxxxx>
  • To: owensmith99@xxxxxxxxx
  • Date: Fri, 7 Sep 2007 11:38:58 +0200

Owen

What user owns the extproc Binary in $ORACLE_HOME/bin ? The scheduler will
fork a process to execute your script '/h/oracle/scripts/tst.sh' as that
user. Ensure the user has execute rights (and can change into that
directory). Per default - if I'm not mistaken, it's user "nobody".

Stefan

On 9/7/07, Owen Smith <owensmith99@xxxxxxxxx> wrote:
>
> Hello Oracle People,
>
> I'd like to run a shell script from the Scheduler in my 10g database.
>
> Right now it is a simple shell script.
>
> Eventually it will wrap RMAN commands to back up my DB.
>
> I wrote a simple pl/sql script to create a job:
>
> -- cr_job10.sql
>
> BEGIN
> DBMS_SCHEDULER.CREATE_JOB (
>    job_name             => 'my_backup_job',
>    job_type             => 'EXECUTABLE',
>    job_action           => '/h/oracle/scripts/tst.sh',
>    start_date           => '06-SEP-07 5.33.00PM US/Pacific',
>    repeat_interval      => 'FREQ=DAILY',
>    end_date             => '08-SEP-07 4.00.00PM US/Pacific',
>    enabled              =>  TRUE,
>    comments             => 'My Backup Job');
> END;
> /
>
> I see no errors when I run the above procedure.
>
> I checked DBA_SCHEDULER_JOBS and the job is in there.
>
> The scheduler, though, errors out with an error which I see in a trace
> file:
>
> /h/oracle/admin/orcl/bdump/orcl_j000_22396.trc
> Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
> With the Partitioning, OLAP and Data Mining options
> ORACLE_HOME = /h/oracle/product/10r2
> System name:    SunOS
> Node name:      sol
> Release:        5.10
> Version:        Generic_118855-14
> Machine:        i86pc
> Instance name: orcl
> Redo thread mounted by this instance: 1
> Oracle process number: 15
> Unix process pid: 22396, image: oracle@sol (J000)
>
> *** ACTION NAME:(MY_BACKUP_JOB) 2007-09-06 17:33:00.175
> *** MODULE NAME:(DBMS_SCHEDULER) 2007-09-06 17:33:00.175
> *** SERVICE NAME:(SYS$USERS) 2007-09-06 17:33:00.175
> *** CLIENT ID:() 2007-09-06 17:33:00.175
> *** SESSION ID:(140.13520) 2007-09-06 17:33:00.175
> *** 2007-09-06 17:33:00.175
> ORA-12012: error on auto execute of job 53267
> ORA-27369: job of type EXECUTABLE failed with exit code: 274662
>
> I googled on this:
>
> ORA-27369: job of type EXECUTABLE failed with exit code: 274662
>
> Google returned only 1 hit.
>
> There, I see some evidence that I need to configure something inside
> of Oracle to run shell scripts from the scheduler, but possibly just
> for machines running windows.  I'm running Solaris.
>
> Do any of you know what I need to configure inside of Oracle to
> run shell scripts from the scheduler?
>
> -Owen
> --
> //www.freelists.org/webpage/oracle-l
>
>
>


-- 
=========================

Stefan P Knecht
Consultant
Infrastructure Managed Services

Trivadis AG
Europa-Strasse 5
CH-8152 Glattbrugg

Phone +41-44-808 70 20
Fax +41-808 70 12
Mobile +41-79-571 36 27
stefan.knecht@xxxxxxxxxxxx
http://www.trivadis.com

OCP SCSA SCNA
=========================

Other related posts: