DBMS_SCHEDULER is awesome. It’s flexibility is remarkable. From setting up execution windows to remote execution to automatic notifications, there is a LOT to like. That doesn’t mean it’s perfect. For developers and DBAs, it can be a real pain to type out 2000+ characters to simply create a job. Being able to have such a fine level of control over the execution of a job has led to a very complex mechanism and infrastructure. This complexity, however, really sets the scene for a GUI – a nice visual interface that allows the user to input some information, which then churns out the nasty-looking code for you.
Of course if you enjoy using EM or Grid Control and you’re already there, feel free to use the web forms. But, if you already have SQL Developer spun up, you might as well do it there. I personally think our implementation is better, but please don’t tell anyone I said that
If you haven’t noticed this feature in SQL Developer, I forgive you. It’s at the very end of a very long tree list. If you connect to your database and expand a SCHEMA, you’ll see ‘SCHEDULER’ at the very bottom. In this case, it’s worth the scroll!
There’s a wizard interface that will walk you through the entire process of creating a new job, or you can use the traditional forms to create and alter existing jobs and schedules.
Let’s take a quick look. And by quick, I mean, let’s zoom into one very small aspect of working with the SCHEDULER and SQL Developer -
Defining repeating intervals for your job to execute
The mechanism for defining when your job will execute is nearly identical to setting up a schedule. It’s lurking under the covers. Look for the ‘edit’ button in the job and schedule forms – a la 
Clicking the edit button will bring you to a form that looks something like this:
This form is fairly self-explanatory, but a couple of notes:
- No worries, if you get frustrated with the form at some point, check the Advanced box and manually code your interval
- Check this to indicate last versus first occurrence, e.g. -1 would be the last day of the month. Handy as each month has a different number of days!
I know some of you will still insist on doing everything by the command-line
And that’s OK (grudging acceptance), but at least spin up SQL Developer to create your scripts. The beauty of these dialogs is that they show the underlying SQL statements so you can easily copy them into your .SQL files.



Twitter
RSS
GooglePlus
Facebook
Jul 11, 2012 @ 02:27:38
I liked the information very much. This can make scheduling a job very easy.
However, I am sorry to say when I expanded my schema I could not find Schedules option,
infact many other options were missing. Seems like my DB is not enabled with these features.
Thanks for the information though
Jul 11, 2012 @ 08:44:16
Every Oracle database comes with scheduling out-of-the-box. What version of Oracle are you connected to? DBMS_SCHEDULER made its debut in 10g.
Try
Also, what version of SQL Developer are you running?
Sep 28, 2012 @ 16:10:21
Finally, wizard for “SCHEDULER” is working.
Nice addition for the new version.
I like to execute commands manually from command line so I will certainly use SQL Developer to create scripts.
Keep up the good work!
Regards,
Marko
Jan 29, 2013 @ 10:30:12
My edit button to repeat interval is not working, so i have no idea to set interval
Jan 29, 2013 @ 10:34:16
When you say ‘not working’, can you elaborate a bit more about what is happening? Do you get an error message?
Jan 29, 2013 @ 12:41:00
Sorry for my short msg. My meaning is no form as your picture available, then i cannot define the repeating interval. When i click edit (small pencil icon) nothing happens. I use SQL developer version 3.2.xx
Thanks for any advise
Mar 21, 2013 @ 23:26:20
hello,
i find i create two job,the first is running,the second bu not runing?what s wrong with this.
thank u
Mar 22, 2013 @ 16:00:09
Who knows. Did you try testing the job that’s not working? If it’s a DBMS_SCHEDULER item it will have a run log as well to inspect.
Apr 15, 2013 @ 12:14:11
Hi!
I have DB links to another databases, when I try to start this job, I have error that table does not exists.
Apr 15, 2013 @ 12:59:14
‘this job’ – I don’t know what your job is doing. But if it is running a SELECT or similar to a table across the DB_LINK are you referencing the table appropriately?
Is your job running a stored procedure or script? Can you run that manually to reproduce/test for the ‘does not exist’ error?