Oracle Consulting Oracle Training Development

Remote DBA

Remote DBA Plans  

Remote DBA Service

Remote DBA RAC

   
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 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





   

 

 

 

Remote DBA services

Remote DBA Support

Remote DBA RAC

Remote DBA Reasons

Remote Oracle Tuning

Remote DBA Links

Oracle DBA Support

Oracle DBA Forum

Oracle Disaster

Oracle Training

Oracle Tuning

Oracle Training

 Remote DBA SQL Server

Remote MSSQL Consulting

Oracle DBA Hosting

Oracle License Negotiation

 

 


 

 

 

        
 

 Oracle Job Scheduling Window Groups
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.

A window group is a collection of related job scheduling windows which can be assigned to the schedule_name parameter of a job instead of a schedule object.  It can be created with zero, one or many windows as group members using the create_window_group procedure.

 

PROCEDURE create_window_group(

 

  group_name             IN VARCHAR2,

  window_list            IN VARCHAR2 DEFAULT NULL,

  comments               IN VARCHAR2 DEFAULT NULL)

 

The parameters associated with this procedure and their usage are as follows:

  • group_name - A name that uniquely identifies the window group

  • window_list - A comma separated list of windows associated with the window group

  • comments - Free text allowing the user to record additional information

The following code creates a window group and assigns the two test windows defined in the previous section.

 

BEGIN

  DBMS_SCHEDULER.create_window_group (

    group_name  => 'test_window_group',

    window_list => 'test_window_1, test_window_2',

    comments    => 'A test window group');

END;

/

 

Figure 11.25 shows the Create Window Group screen in the OEM DB Control.

 

Figure 11.25 – OEM DB Control: Create Window Group

 

Information about window groups can be displayed using the dba_scheduler_window_groups and  dba_scheduler_wingroup_members views.  The following script uses both views to display a summary of window group information.

 

window_groups.sql

 

prompt

prompt WINDOW GROUPS

prompt --------------

 

select

   window_group_name,

   enabled,

   number_of_windowS

from

   dba_scheduler_window_groups

;

 

prompt

prompt WINDOW GROUP MEMBERS

prompt ---------------------

 

select

   window_group_name,

   window_name

from

   dba_scheduler_wingroup_members

;

 

The output from the window_groups.sql script shows that the window group was created successfully.

 

SQL> @window_groups

 

WINDOW GROUPS

-------------

 

WINDOW_GROUP_NAME              ENABL NUMBER_OF_WINDOWS

------------------------------ ----- -----------------

MAINTENANCE_WINDOW_GROUP       TRUE                  2

TEST_WINDOW_GROUP              TRUE                  2

 

WINDOW GROUP MEMBERS

--------------------

 

WINDOW_GROUP_NAME              WINDOW_NAME

------------------------------ ------------------------------

MAINTENANCE_WINDOW_GROUP       WEEKEND_WINDOW

MAINTENANCE_WINDOW_GROUP       WEEKNIGHT_WINDOW

TEST_WINDOW_GROUP              TEST_WINDOW_1

TEST_WINDOW_GROUP              TEST_WINDOW_2

 

Figure 11.26 shows the Scheduler Window Groups screen in the OEM DB Control.

 

Figure 11.26 – OEM DB Control: Scheduler Window Groups

 

Windows can be added and removed from a group using the add_window_group_member and remove_window_group_member procedures, respectively.

 

PROCEDURE add_window_group_member (

 

  group_name             IN VARCHAR2,

  window_list            IN VARCHAR2)

 

PROCEDURE remove_window_group_member (

 

  group_name             IN VARCHAR2,

  window_list            IN VARCHAR2)

 

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

  • group_name - A name that uniquely identifies the window group

  • window_list - A comma separated list of windows to be added or removed from the window group

The following example creates a new window, adds it to a group and then removes it from the group.  Figure 11.27 shows the Edit Window Group screen in the OEM DB Control.  Windows can be added and removed from a window group using this screen.

 

Figure 11.27 – OEM DB Control: Edit Window Group

 

Windows groups are removed using the drop_window procedure.

 

PROCEDURE drop_window_group (

  group_name             IN VARCHAR2,

  force                  IN BOOLEAN DEFAULT FALSE)

 

The parameters associated with this procedure and their usage are as follows:

  • group_name - A name that uniquely identifies the window group

  • force - When set to FALSE, an error is produced if any jobs reference the specified window group.  When set to TRUE, any dependent jobs are disabled.

The following example shows how to drop a window group:

 

BEGIN

  DBMS_SCHEDULER.drop_window_group (

    group_name => 'test_window_group',

    force      => TRUE);

END;

/

 

The output from the window_groups.sql  script shows that the window group has been removed.

 

SQL> @window_groups

 

WINDOW GROUPS

-------------

 

WINDOW_GROUP_NAME              ENABL NUMBER_OF_WINDOWS

------------------------------ ----- -----------------

MAINTENANCE_WINDOW_GROUP       TRUE                  2

 

 

WINDOW GROUP MEMBERS

--------------------

 

WINDOW_GROUP_NAME              WINDOW_NAME

------------------------------ ------------------------------

MAINTENANCE_WINDOW_GROUP       WEEKEND_WINDOW

MAINTENANCE_WINDOW_GROUP       WEEKNIGHT_WINDOW

 

The following section will explain common procedures and functions for managing the scheduler objects that have been created.

 


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

 

Advance SQL Tuning Book 

BC Oracle support

Oracle books by Rampant

Oracle monitoring software

 

 

 

 

 

 

 

 

 

BC Remote Oracle Support

Remote DBA

Remote DBA Services

Copyright © 1996 -  2013 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.