Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Oracle Scheduler in Oracle 11g Databases

You're reading from   Mastering Oracle Scheduler in Oracle 11g Databases Schedule, manage, and execute jobs in Oracle 11g Databases that automate your business processes using Oracle Scheduler with this book and eBook

Arrow left icon
Product type Paperback
Published in Jun 2009
Publisher Packt
ISBN-13 9781847195982
Length 240 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Ronald Rood Ronald Rood
Author Profile Icon Ronald Rood
Ronald Rood
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Mastering Oracle Scheduler in Oracle 11g Databases
Credits
About the Author
About the Reviewers
1. Preface
1. Simple Jobs FREE CHAPTER 2. Simple Chain 3. Control the Scheduler 4. Managing Resources 5. Getting Out of the Database 6. Events 7. Debugging the Scheduler 8. The Scheduler in Real Life 9. Other Configurations 10. Scheduler GUI Tools

Statistics collection


From Oracle 10g onwards, Oracle has included a job that automatically collects optimizer statistics for us. So, there is no real need to make such a process again. It might look like inventing a different-colored wheel, but it can be useful if you want more control on how the statistics are collected.

For this, we will make a simple package named sched_stats. As many readers are more than likely to be still using Oracle 10g, the code that we will use is compatible for Oracle 10g as well as 11g. The package has the following four procedures:

  • schedule_run

  • run

  • statob

  • Drop_jobs

The schedule_run procedure

The Schedule_run procedure creates the job that is actually scheduled on a twice-daily basis and has all the parameters with defaults that can be overridden:

procedure schedule_run
( jobclass in varchar2 default 'DEFAULT_JOB_CLASS',
jobname in varchar2 default 'run_stats',
sjobprefix in varchar2 default 'stats_',
repinterval in varchar2 default'FREQ=DAILY;BYHOUR=5,17;BYMINUTE=4...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image