Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Oracle DBA_SCHEDULER_WINDOWS

Oracle Database Tips by Donald Burleson

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

Information about windows can be displayed using the dba_scheduler_windows view. The following script uses this view:

 

windows.sql

 

select

   window_name,

   resource_plan,

   enabled,

   active

from

   dba_scheduler_windows;

 

The output from the windows.sql script is displayed below:

 

job_user@db10g> @windows

 

WINDOW_NAME                    RESOURCE_PLAN           ENABL ACTIV

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

TEST_WINDOW_1                                          TRUE  FALSE

TEST_WINDOW_2                                          TRUE  FALSE

WEEKEND_WINDOW                                         TRUE  TRUE

WEEKNIGHT_WINDOW                                       TRUE  FALSE

 

4 rows selected.

 

Figure 11.24 shows the Scheduler Windows screen in the OEM DB Control.

 

Figure 11.24 - OEM DB Control: Scheduler Windows

 

The server normally controls the opening and closing of windows, but they also can be opened and closed manually using the open_window and close_window procedures.

 

PROCEDURE open_window (

 

  window_name             IN VARCHAR2,

  duration                IN INTERVAL DAY TO SECOND,

  force                   IN BOOLEAN DEFAULT FALSE)

 

PROCEDURE close_window (

 

  window_name             IN VARCHAR2)

 

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

  • window_name - A name that uniquely identifies the window

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

  • force - When set to FALSE, attempting to open a window when one is already open will result in an error unless the currently open window is the one that is attempting to open.  In this case, the close time is set to the current system time plus the specified duration.  Closing a window causes all jobs associated with that window to be stopped.

The following example opens, and then closes, test_window_2.  Notice how the active window switches back to weekend_window when test_window_2 is closed.

 

BEGIN

  -- Open window.

  DBMS_SCHEDULER.open_window (

   window_name => 'test_window_2',

   duration    => INTERVAL '1' MINUTE,

   force       => TRUE);

END;

/

 

SQL> @windows

 

WINDOW_NAME                    RESOURCE_PLAN        ENABL ACTIV

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

TEST_WINDOW_1                                       TRUE  FALSE

TEST_WINDOW_2                                       TRUE  TRUE

WEEKEND_WINDOW                                      TRUE  FALSE

WEEKNIGHT_WINDOW                                    TRUE  FALSE

 

4 rows selected.

 

BEGIN

  -- Close window.

  DBMS_SCHEDULER.close_window (

   window_name => 'test_window_2');

END;

/

 

SQL> @windows

 

WINDOW_NAME                    RESOURCE_PLAN        ENABL ACTIV

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

TEST_WINDOW_1                                       TRUE  FALSE

TEST_WINDOW_2                                       TRUE  FALSE

WEEKEND_WINDOW                                      TRUE  TRUE

WEEKNIGHT_WINDOW                                    TRUE  FALSE

 

4 rows selected.

 

Windows can be removed using the drop_window procedure.

 

PROCEDURE drop_window (

 

  window_name             IN VARCHAR2,

  force                   IN BOOLEAN DEFAULT FALSE)

 

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

  • window_name - A single or comma separated list of window names.  If a window group name is specified, all windows within that group will be dropped.  In addition, all jobs that use the specified window or window group as a schedule will be disabled, although running jobs will complete normally.

  • force - When set to FALSE, attempting to drop an open window will result in an error.  When set to TRUE, the open window is closed before it is dropped.

The following example drops the two test windows that were created earlier:

 

BEGIN

  DBMS_SCHEDULER.drop_window (

    window_name => 'test_window_1,test_window_2',

    force       => TRUE);

END;

/

 

The output from the windows.sql script confirms that the windows have been removed successfully.

 

SQL> @windows

 

WINDOW_NAME              RESOURCE_PLAN     ENABL ACTIV

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

WEEKEND_WINDOW                             TRUE  TRUE

WEEKNIGHT_WINDOW                           TRUE  FALSE

 

2 rows selected.

 

The following section will show how to group related windows together using window groups.


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.