Skip to Main Content
Oracle PL/SQL for DBAs
book

Oracle PL/SQL for DBAs

by Arup Nanda, Steven Feuerstein
October 2005
Intermediate to advanced content levelIntermediate to advanced
454 pages
14h 44m
English
O'Reilly Media, Inc.
Content preview from Oracle PL/SQL for DBAs

Managing Named Programs

I’ve explained two basic scheduling concepts: the job and the schedule. A third important concept is the program: the actual code that will be executed as scheduled. Now that you’ve learned how to call different types of programs, you might be tempted (quite justifiably) to place all scheduled processes —whether in stored procedures, PL/SQL anonymous blocks, or operating system executables—under Scheduler control. There is, however, one complication that you will need to be aware of. According to the syntax you’ve seen so far, you need to pass the full path of your executable (or your PL/SQL block or stored procedure) to the parameter job_action in the CREATE_JOB procedure. If the path is long (as it may often be), it may be inconvenient to specify the entire path. And if you supply it more than once, you are again introducing opportunities for errors to enter your scheduling process.

Fortunately, DBMS_SCHEDULER allows you to define named programs, which make it extremely easy to reference the program to be executed. Named programs are essentially synonyms for the actual code being executed. Instead of calling the actual code segment, you simply reference the name you have given the program. Then, if you ever need to change your job to run a different program, you will not need to change the job definition. All you have to do is swap the new executable into the program, and your job will call the right one.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle PL/SQL Best Practices

Oracle PL/SQL Best Practices

Steven Feuerstein
Expert Oracle PL/SQL

Expert Oracle PL/SQL

Ron Hardman, Michael McLaughlin
Oracle PL/SQL For Dummies

Oracle PL/SQL For Dummies

Michael Rosenblum, Paul Dorsey

Publisher Resources

ISBN: 0596005873Supplemental ContentErrata Page