Mastering Oracle Scheduler in Oracle 11g Databases
By Ronald Rood
()
About this ebook
Related to Mastering Oracle Scheduler in Oracle 11g Databases
Related ebooks
Oracle Database Mastery: Comprehensive Techniques for Advanced Application Rating: 0 out of 5 stars0 ratingsStarting Database Administration: Oracle DBA Rating: 3 out of 5 stars3/5DB2 9.7 for Linux, UNIX, and Windows Database Administration: Certification Study Notes Rating: 5 out of 5 stars5/5Modern Oracle Enterprise Architecture: Discover Oracle's Hidden Gems for Next Generation Database and Application Migrations Rating: 0 out of 5 stars0 ratingsOracle Ultimate DBA Interview Questions Rating: 5 out of 5 stars5/5Instant PostgreSQL Backup and Restore How-to Rating: 0 out of 5 stars0 ratingsOracle Data Guard 11gR2 Administration Beginner's Guide Rating: 0 out of 5 stars0 ratingsMastering Oracle Database: From Basics to Expert Proficiency Rating: 0 out of 5 stars0 ratingsPostgreSQL 9 Administration Cookbook: LITE Edition Rating: 3 out of 5 stars3/5Oracle GoldenGate With Microservices: Real-Time Scenarios with Oracle GoldenGate Rating: 0 out of 5 stars0 ratingsOracle Database 12c Backup and Recovery Survival Guide Rating: 5 out of 5 stars5/5PostgreSQL 9 High Availability Cookbook Rating: 5 out of 5 stars5/5Securing WebLogic Server 12c Rating: 0 out of 5 stars0 ratingsIntroduction to Oracle Database Administration Rating: 5 out of 5 stars5/5Concise Oracle Database For People Who Has No Time Rating: 0 out of 5 stars0 ratingsPostgreSQL Replication - Second Edition Rating: 0 out of 5 stars0 ratingsOracle Database 11g - Underground Advice for Database Administrators: Beyond the basics Rating: 0 out of 5 stars0 ratingsOracle® Financials Interview Questions: Unofficial Oracle Financials Certification Review Rating: 3 out of 5 stars3/5PostgreSQL Administration Essentials Rating: 0 out of 5 stars0 ratingsOracle ERP Guide for Financials Rating: 0 out of 5 stars0 ratingsMySQL Management and Administration with Navicat Rating: 0 out of 5 stars0 ratingsPostgreSQL 11 Administration Cookbook: Over 175 recipes for database administrators to manage enterprise databases Rating: 0 out of 5 stars0 ratingsOracle SOA Suite 11g Administrator's Handbook Rating: 0 out of 5 stars0 ratingsGetting Started with SQL Server 2014 Administration Rating: 0 out of 5 stars0 ratingsMicrosoft SQL Server 2008 R2 Administration Cookbook Rating: 5 out of 5 stars5/5Mastering MariaDB Rating: 0 out of 5 stars0 ratingsOracle Database Security Interview Questions, Answers, and Explanations: Oracle Database Security Certification Review Rating: 0 out of 5 stars0 ratingsIBM InfoSphere Replication Server and Data Event Publisher Rating: 0 out of 5 stars0 ratingsLearning ELK Stack: Build mesmerizing visualizations, analytics, and logs from your data using Elasticsearch, Logstash, and Kibana Rating: 0 out of 5 stars0 ratings
Information Technology For You
An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5How to Find a Wolf in Siberia (or, How to Troubleshoot Almost Anything) Rating: 0 out of 5 stars0 ratingsCybersecurity Playbook for Executives Rating: 0 out of 5 stars0 ratingsData Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5CompTia Security 701: Fundamentals of Security Rating: 0 out of 5 stars0 ratingsHealth Informatics: Practical Guide Rating: 0 out of 5 stars0 ratingsHow to Write Effective Emails at Work Rating: 4 out of 5 stars4/5CompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsCreating your MySQL Database: Practical Design Tips and Techniques Rating: 3 out of 5 stars3/5Google SketchUp for Game Design: Beginner's Guide Rating: 5 out of 5 stars5/5Cyber Security Consultants Playbook Rating: 0 out of 5 stars0 ratingsPractical Ethical Hacking from Scratch Rating: 5 out of 5 stars5/5How Computers Really Work: A Hands-On Guide to the Inner Workings of the Machine Rating: 0 out of 5 stars0 ratingsCOMPUTER SCIENCE FOR ROOKIES Rating: 0 out of 5 stars0 ratingsA concise guide to PHP MySQL and Apache Rating: 4 out of 5 stars4/5CompTIA ITF+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam FC0-U61 Rating: 5 out of 5 stars5/5CompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsITIL® V3 Foundation Complete Certification Guidebook: ITIL v3, #1 Rating: 0 out of 5 stars0 ratingsDevOps Handbook: What is DevOps, Why You Need it and How to Transform Your Business with DevOps Practices Rating: 4 out of 5 stars4/5Mastering Excel Formulas Save Time and Boost Productivity Rating: 5 out of 5 stars5/5Getting started with Audacity 1.3 Rating: 5 out of 5 stars5/5ChatGPT: The Future of Intelligent Conversation Rating: 4 out of 5 stars4/5Machine Learning Interview Questions Rating: 5 out of 5 stars5/5Windows 11 For Beginners: The Ultimate Step-By-Step Guide To Learning How To Use Windows Like A Pro Rating: 0 out of 5 stars0 ratingsLearning Microsoft Endpoint Manager: Unified Endpoint Management with Intune and the Enterprise Mobility + Security Suite Rating: 0 out of 5 stars0 ratingsApple iPhone iOS 16 New Features Rating: 0 out of 5 stars0 ratings
Reviews for Mastering Oracle Scheduler in Oracle 11g Databases
0 ratings0 reviews
Book preview
Mastering Oracle Scheduler in Oracle 11g Databases - Ronald Rood
Table of Contents
Mastering Oracle Scheduler in Oracle 11g Databases
Credits
About the Author
About the Reviewers
Preface
An overview of Oracle Scheduler
Database background
Scheduling events in the database
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code for the book
Errata
Piracy
Questions
1. Simple Jobs
Creating a user
Running your Jobs
PL/SQL block
Stored procedure
Executable
Program
Defining arguments for your jobs
Metadata arguments
Normal application arguments
Summary
2. Simple Chain
Jobs
Chains
Statuses
Chains and steps
Rules
Evaluation interval
Privileges
Steps to create a chain
Hands-on with chains
Programs
SHUTDOWN
COPYFILES
STARTUP
Program state
DB Console
Chain definition
Running the chain
Tricks with chains
Manipulating the running chains
Analyzing the chain
Summary
3. Control the Scheduler
Job creation
Job execution
Scheduler management
Logging
Log detail level
Log purging
Summary
4. Managing Resources
Resource consumer group
Creating resource consumer groups
Class
Plan
Window
Window groups
Monitoring
Problems with Resource Manager
Problems that Resource Manager solves
Summary
5. Getting Out of the Database
Security
Installation on Windows
Installation on Linux
Upgrading the remote job agent
Silent install of the remote job agent
Base release
Patch to the latest available level
Preparing the database for remote agent usage
Verifying the XDB installation
Setting the HTTP port
Creating remote Scheduler objects
Setting registration password
Configuring a remote agent
Troubleshooting
Multiple agents on the same host
Credentials
Creating job—targeting Unix
Creating job—targeting Windows
Runtime observations of the remote Scheduler
Resource Manager
Summary
6. Events
Monitoring job events
Events in chains
Event-based scheduling
Summary
7. Debugging the Scheduler
Unix—all releases
Windows usage
Bugs
Job environment
Checks to do in the database
Summary
8. The Scheduler in Real Life
Statistics collection
The schedule_run procedure
The run procedure
The statob procedure
The drop_jobs procedure
Generating the jobs
Performing the analysis
Generating the scheduled run
Backups
Things that can scare you
Diving into the code
Reading the event queue
Scheduling for the HOT backups
Scheduling the DARC process
Scheduling the final BARC process
How to use the calendar
Tools
How to schedule on the first day of a month
How to schedule only on Monday
How to schedule on the first Monday of a month
How to schedule on the first working day of a month
How to schedule on the first working Monday of a month
How to schedule on the nth Monday of a month
How to schedule on the last working day of a month
How to schedule in the first quarter of a year
How to schedule on the first Monday of the first quarter
Summary
9. Other Configurations
RAC
Job creation/modification
The job_class definition
Standby databases
Creating jobs in a logical standby database
Running jobs in a logical standby database
Summary
10. Scheduler GUI Tools
DB Console
Grid Control
DbVisualizer
Summary
Index
Mastering Oracle Scheduler in Oracle 11g Databases
Ronald Rood
Mastering Oracle Scheduler in Oracle 11g Databases
Copyright © 2009 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: June 2009
Production Reference: 1100609
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847195-98-2
www.packtpub.com
Cover Image by Ninoslav Babić (<[email protected]>)
Credits
Author
Ronald Rood
Reviewers
Hans Forbrich
Mennan Tekbir
Robin Buitenhuis
Syed Jaffar Hussain
Acquisition Editor
James Lumsden
Development Editor
Ved Prakash Jha
Technical Editors
Ishita Dhabalia
John Antony
Copy Editor
Sneha Kulkarni
Editorial Team Leader
Gagandeep Singh
Project Team Leader
Lata Basantani
Project Coordinator
Leena Purkait
Proofreader
Camille Guy
Indexer
Hemangini Bari
Production Coordinator
Shantanu Zagade
Cover Work
Shantanu Zagade
About the Author
Ronald Rood is an IT professional for over 20 years. His private domain is named after the first account that was created on a computer for him. That account was ronr on a DPS9 system, and so his private domain is called ronr.nl where you can contact him using <[email protected]>. He eagerly joined the Oracle community and became a skilled, innovating DBA and troubleshooter. He is a master of C, PRO*C, lots of scripting languages, and—of course—PL/SQL. Ronald’s real power is in the combination of the rich Unix world and Oracle. According to him, there is no such thing as a problem that cannot be solved; it just might take a little time.
Ronald speaks several languages such as Dutch, English, German, and some French. In the private time that he shares with his wife and two children, he likes to take an occasional dive (from the sky), fly with radio-controlled models, ride recumbents, and work as a volunteer for a local water scouts group.
Currently, Ronald is one of the Ciber Oracle consultants in The Netherlands and cooperates in many projects for many large companies. Before writing this book, Ronald wrote Oracle-related articles for the Dutch Oracle user group magazine. On his blog, you can find some short articles about various items, but most are related to Oracle.
I would like to thank everyone who helped me writing this book. Not in the least, Sandra for having lots of patience for me while writing, Silvana and Alex for being great children I can be proud of, Robin and the other reviewers for challenging me to write better, and Harold for showing me that there is a way that might or might not be seen. I also would like to thank my colleagues of Ciber for being my colleagues, and Mark for giving me the challenges that I like so much. Without my parents, I would never have existed at all, but they gave me the opportunity to study without ever asking anything in return. Bedankt ma, bedankt pa zonder jullie was het nooit wat geworden.
About the Reviewers
Hans Forbrich has been around computers for 40 years. While studying for his B.Sc. EE in the 70s, he worked as a contract programmer to help pay for school. Hans has been working with the Oracle products since 1984. While at Nortel in the field service group, he met Oracle Database version 4. He joined Oracle Canada to work in the Communications vertical from 1996 to 2002. In 2003, Hans started Forbrich Computer Consulting Ltd., which has become a successful international Oracle consultancy and Oracle training partner based in St. Albert, near Edmonton, Alberta, Canada.
As an Oracle ACE Director and OCP, Hans frequently responds in various Oracle Forums, teaches for Oracle University, consults with Oracle customers on maximizing value from Oracle licenses, and speaks at Oracle User Group conferences around the world. He holds a strong belief that Oracle products provide significant value, and the key to extracting that value—and reducing the effective cost of the product—is in understanding the product and using the right tool for the job.
I thank my wife of 27 years for her patience, especially while I experiment in the lab. I also thank my two sons for their patience, their assistance at computer setups, and their help in those same experiments. (And I am proud to note that Son #1, aka Employee #2, aka Chief Network and Systems Administrator, has achieved his M.Sc. EE this past year!) Finally, I thank Edmonton Opera and my colleagues there for allowing me to break away from computers and unwind on stage with the Edmonton Opera Chorus.
Mennan Tekbir has a master's degree in Computer Sciences, and has worked for several telecommunications companies around the world. He is mainly focused on performance analysis, designing and implementing frameworks, automated PL/SQL code generation, and fraud detection with data mining.
Robin Buitenhuis is an experienced Oracle DBA. During his study at the Universiteit Twente, he came in contact with Oracle RDBMS 6.0 en Forms 2.3. From that moment on, he has always worked with Oracle products. He is also a member of the board of the Dutch Oracle Usergroup (www.ogh.nl).
Syed Jaffar Hussain has more than 16 years of Information Technology (IT) experience, which includes over eight years as a Production Oracle DBA. He is an Oracle ACE, Oracle 10g Certified Master (OCM), OCP DBA (v8i, 9i, and10g), and Oracle 10g RAC Certified Expert. He is currently involved in 8 node production and 6 node development RAC setup with more than 60 databases running across the nodes. He has a broad experience in Oracle advanced technologies such as RAC, DataGuard, RMAN, and Performance Tuning. He occasionally presents Oracle University five-day courses and one-day seminars on behalf of Oracle EMEA. He has also worked for a couple of multinational banks in Saudi Arabia. He is currently involved with the Oracle 11g RAC book.
He is a frequent contributor at Oracle OTN forums and regularly writes to his blog, (http://jaffardba.blogspot.com). He is reachable at
I would like to thank my wife Ayesha and my three kids Ashfaq, Arfan, and Aahil for allowing me to concentrate on this task.
Preface
Welcome to the world of Oracle Scheduler! Oracle Scheduler is a free utility included in the Oracle database that makes the Oracle RDBMS the most powerful scheduling tool on our planet (and in the known parts of the galaxy).
An overview of Oracle Scheduler
The Oracle Scheduler can be used to automate not only the simple maintenance tasks, but also the complex business logic. Traditionally, only PL/SQL could be executed in the Scheduler. Later, operating system scripts were added to it, and now we can run jobs on remote systems and cross platform as well. This can turn the Oracle Scheduler into the spider in your Web, controlling all the jobs running in the organization and giving you a single point for control.
Database background
Relational database management systems (RDBMS) can be very powerful. With a little code, we can use the RDBMS as a filesystem, mail server, HTTP server, and now also as a full-blown job Scheduler that can compete very well with other commercial job Schedulers. The advantage that Oracle gives us is in terms of price, flexibility, and phenomenal power. The scheduling capabilities are all a part of the normal Oracle license for the RDBMS, whereas others have a serious price tag and often require a database for the repository to store the metadata of the jobs.
Scheduling events in the database
Since Oracle added the procedural option to the database, they also included some scheduling power provided by dbms_jobs. Although a bit restricted, it was used extensively. However, no one would even think about using this as an Enterprise-level Scheduler tool. This changed when Oracle introduced 10gR2. In this release, Oracle could not only start jobs that ran outside the database, but they also added the job chain.
In 11g, Oracle also added the option to run jobs on remote systems where no database is running. Now it's time to rethink what the database actually is. In the early days, a database was just a bunch of code that could hold data in tables. Today, the Oracle RDBMS can do that—and that too well—along with many more things. In fact, the Oracle RDBMS can perform so many tasks so amazingly, that it's surprising that we still call it just a database. We could easily turn it into a personal assistant.
Oracle Scheduler 11g can:
Run jobs where no database ever was before
Use different operating system credentials per job
React on events
Schedule jobs on multiple platforms simultaneously
Give a tight security
What this book covers
Chapter 1 will get you going with the Scheduler as quickly as possible. In the end, you will automate simple tasks that are now maintained in cron, task manager, or the good old DBMS_JOB package, for example.
Chapter 2 will show you a lot of possibilities of chains with many examples and explanations. In short, it will tell you all you ever wanted to know about chains, but were afraid to ask.
Chapter 3 is for all you people living in an organization that requires strict job separation. This chapter will show how to make good use of the Scheduler and apply job separation.
Chapter 4 is a very important chapter that explains how to crank up the power of a system to the limits by combining the Scheduler and the Resource Manager. Here you will find how to get the best out of your system.
Chapter 5 will be of a great help in setting up remote external jobs introduced in Oracle 11g. How is this related to the old-fashioned local external jobs that we know since Oracle 10g and why we should get rid of the old external jobs? Get your answers here.
Chapter 6 helps the reader to get a firm grip on events and explains how to make good use of events. Events sound like voodoo, but in the end are an extra tool found in the Scheduler.
Chapter 7 considers the fact that when the jobs get more complicated, it gets harder to understand why something works differently than planned. This chapter gives the reader a fresh look at how to follow and debug Scheduler jobs.
Chapter 8 will give you some creative implementations of more or less common tasks—this time implemented using the Scheduler. This chapter gives a working code with clear explanations. This broadens the horizon and will take down the barriers that might exist between other environments and Oracle.
Chapter 9 shows how the Scheduler can be used in other configurations such as standby databases and RAC.
Chapter 10 shows how the Scheduler can be managed and monitored remotely through a web interface.
What you need for this book
Most examples will run fine with just a database. When the Oracle Scheduler Agent is discussed, you will also need a remote Scheduler Agent installed and running. In this case, the version of the database has to be at least 11.1.0.6 because this is the first release that includes the remote Scheduler Agent support. The installation, upgrade, and configuration of the Oracle