Free Oracle Tips

Oracle Consulting Oracle Training Development

Remote DBA

 

Remote DBA Plans
Remote DBA Service

 
Remote DBA Oracle Home
Remote DBA Oracle Training
Remote DBA SQL Tuning Consulting
Remote DBA Oracle Tuning Consulting
Remote DBA Data Warehouse Consulting
Remote DBA Oracle Project Management
Remote DBA Oracle Security Assessment
Remote DBA Unix Consulting
Burleson Books
Burleson Articles
Burleson Web Courses
Burleson Qualifications
Oracle Internals Magazine
Oracle Links
Remote DBA Oracle Monitoring
Remote DBA Support Benefits
Remote DBA Plans & Prices
Our Automation Strategy
What We Monitor
Oracle Apps Support
Print Our Brochure
Contact Us (e-mail)
Oracle Job Opportunities
Oracle Consulting Prices





   

 


        
 

 Oracle Job Scheduling Windows
Oracle Tips by Burleson Consulting

Advanced Oracle Utilities: The Definitive Reference by Rampant TechPress is written by the top Oracle database experts (Bert Scalzo, Donald Burleson, and Steve Callan).  The following is an excerpt from the book.

Windows define the times when resource plans are active.  Since job classes point to resource consumer groups, and therefore resource plans, this mechanism allows control over the resources allocated to job classes and their associated jobs during specific time periods.  A window can be assigned to the schedule_name  parameter of a job instead of a schedule object.

 

Only one window can be active at any time with one resource plan assigned to the window.  The effects of resource plan switches are instantly visible to running jobs that are assigned to job classes.

 

A window can be created using the create_window procedure with a predefined or inline schedule.

 

PROCEDURE create_window (

 

 window_name             IN VARCHAR2,

  resource_plan           IN VARCHAR2,

  schedule_name           IN VARCHAR2,

  duration                IN INTERVAL DAY TO SECOND,

  window_priority         IN VARCHAR2                 DEFAULT 'LOW',

  comments                IN VARCHAR2                 DEFAULT NULL)

 

PROCEDURE create_window (

 

  window_name             IN VARCHAR2,

  resource_plan           IN VARCHAR2,

  start_date              IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,

  repeat_interval         IN VARCHAR2,

  end_date                IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,

  duration                IN INTERVAL DAY TO SECOND,

  window_priority         IN VARCHAR2                 DEFAULT 'LOW',

  comments                IN VARCHAR2                 DEFAULT NULL)

 

The parameters associated with these procedures and their usage are as follows:

  • window_name  - A name that uniquely identifies the window

  • resource_plan - The resource plan associated with the window.  When the window opens, the system switches to use the associated resource plan.  When the window closes, the system switches back to the previous resource plan.

  • schedule_name - The name of the schedule associated with the window.  If this is specified, the start_date, repeat_interval and end_date must be NULL.

  • start_date - The date when this window will take effect.  This may be in the future if the window is to be set up in advance.

  • repeat_interval - The definition of how often the window should open.  A value of NULL indicates that the window should only open once.

  • end_date - The date when this window will stop.  This, combined with the start_date parameter, enables a window to be scheduled for a finite period of time.

  • duration - The length of time in minutes the window should remain open

  • window_priority - The priority (LOW or HIGH) of the window.  In the event of multiple windows opening at the same time, windows with a high priority take precedence over windows with a low priority, which is the default.

  • comments - Free text that allows the user to record additional information

The following code shows how the create_window procedures can be used:

 

BEGIN

  -- Window with a predefined schedule.

  DBMS_SCHEDULER.create_window (

    window_name     => 'test_window_1',

    resource_plan   => NULL,

    schedule_name   => 'TEST_HOURLY_SCHEDULE',

    duration        => INTERVAL '30' MINUTE,

    window_priority => 'LOW',

    comments        => 'Window with a predefined schedule.');

END;

/

 

BEGIN

  -- Window with an inline schedule.

  DBMS_SCHEDULER.create_window (

    window_name     => 'test_window_2',

    resource_plan   => NULL,

    start_date      => SYSTIMESTAMP,

    repeat_interval => 'freq=hourly; byminute=0',

    end_date        => NULL,

    duration        => INTERVAL '30' MINUTE,

    window_priority => 'LOW',

    comments        => 'Window with an inline schedule.');

END;

/

 

The SYS user is the owner of all windows, so any schedules referenced by them must also be owned by SYS.

 

Figure 11.23 shows the Create Window screen in the OEM DB Control.

 

Figure 11.23 – OEM DB Control: Create Window

     


Fo
r more details on Oracle utilities, see the book "Advanced Oracle Utilities" by Bert Scalzo, Donald K. Burleson, and Steve Callan.

You can buy it direct from the publisher for 30% off directly from Rampant TechPress.

Remote DBA Service
 

Oracle Tuning Book

Free Oracle dictionary reference poster

BC Oracle support

Oracle books by Rampant

Oracle monitoring software

North Carolina Oracle Users Group

 

 Arabian horse breeder

Seeing eye horses

 

 

 

 

 

Burleson is the American Team

American Flag

 

 

BC Remote Oracle Support
P.O. Box 511 • Kittrell, NC, 27544

Remote DBA

Remote DBA Services

 

Copyright © 1996 -  2011 by Burleson Enterprises. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.