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