Oracle Job Scheduler Guide With Examples – Part III

This is the last article in our 3 article series we have written on Oracle Job Scheduler. In this article we will see oracle job scheduler example that will tell us how we can schedule a windows executable batch file.

Guide Index

  1. Oracle Job Scheduler Guide With Examples – Part I
  2. Oracle Job Scheduler Guide With Examples – Part II
  3. Oracle Job Scheduler Guide With Examples – Part III

Schedule an Executable (Batch file)

As mentioned earlier we can schedule an external executable file using oracle scheduler. We have a simple java program that generates file. We have written a batch wrapper for that and we will schedule this batch file as one of our step in chain.

This is code we have in run-java-program.bat

We will add one program RUNJAVA as 

Create one chain JAVATEST and add a single step as

Add start and end rule as shown below.

As we have only one step, once you are done our oracle job scheduler example will look like this in SQL Developer.

Now schedule a job running every 30 seconds as 

Important Note

If job or chain is running external program, we need make sure that Oracle Schedule Service is up and running. If its down you will get errors in the execution of job or chain. In below screen its disabled by default. Before you schedule make sure below service is running.

Once the job is scheduled it will start running and files will start getting created as per your java file and batch file configuration. Below is sample output.

Simple, right? I bet you wont find this simple oracle job scheduler example anywhere else 🙂

Below I have listed some of the PL/SQL blocks or commands that will help you to drop Job, Program, Chain etc.

Drop Job

Drop Program

Drop Chain 

Drop Chain Step

Drop Chain Rule

Before we close our article let me share the tables we have used for our illustrations in entire series.

You can use below query to get some details on the Jobs we have scheduled in the oracle schema

That’s it. I guess we are good to conclude our 3 article series on Oracle Job Scheduler. Please feel free to get back to us if you have any queries.

You can refer the Oracle package and tables scripts from out Git repository.

Download from Git

  1. praveen D
    October 3, 2019 | Reply
  2. hin
    June 5, 2019 | Reply
    • Shilpa
      June 6, 2019 | Reply
  3. Bhupinder Singh
    November 16, 2018 | Reply
    • Pavan
      November 18, 2018 | Reply
  4. Galih
    November 7, 2018 | Reply
    • Pavan
      November 9, 2018 | Reply

Add a Comment

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