Warning: Creating default object from empty value in /home/customer/www/gavinsoorma.com/public_html/wp-content/themes/specular/admin/inc/class.redux_filesystem.php on line 29
Using DBMS_SCHEDULER to run a UNIX shell script | Oracle DBA – Tips and Techniques
News
Perth, Australia
+ (61) 417713124
prosolutions@gavinsoorma.com

Using DBMS_SCHEDULER to run a UNIX shell script

  • Posted by Gavin Soorma
  • On June 18, 2009
  • 1 Comments

CREATE A PROGRAM

begin

dbms_scheduler.create_program

(

program_name => ‘UPDATE_VERITAS’,

program_type => ‘EXECUTABLE’,

program_action => ‘/opt/oracle/scripts/blade08/update_veritas.sh’,

enabled => TRUE,

comments => ‘Check the Time’

);

end;

/

 CREATE A SCHEDULE
 

begin

dbms_scheduler.create_schedule

(

schedule_name => ‘EVERY_6_HOURS’,

repeat_interval => ‘FREQ=HOURLY; INTERVAL=6?,

comments => ‘Every 6 Hours’

);

end;

/

 
CREATE A JOB
 

begin

dbms_scheduler.create_job

(

job_name => ‘RUN_UPDATE_VERITAS’,

program_name => ‘UPDATE_VERITAS’,

schedule_name => ‘EVERY_6_HOURS’,

comments => ‘Run the program UPDATE_VERITAS every 6 Hours’,

enabled => TRUE

);

end;

/

 

RUN THE JOB MANUALLY

exec dbms_scheduler.run_job(’RUN_UPDATE_VERITAS’);

 
Check the job run status and other details      
 

select log_id, log_date, job_name, status, error#, additional_info
 from dba_scheduler_job_run_details
where job_name =’RUN_UPDATE_VERITAS’;

 

1 Comments

Manzoor
  • Oct 30 2009
Hi could you pls put the contents of the script - ‘/opt/oracle/scripts/blade08/update_veritas.sh’

Leave Reply

Your email address will not be published. Required fields are marked *