9 Replies Latest reply: Aug 29, 2012 8:02 AM by user12099976 RSS

    WINDOW remains ACTIVE after calling CLOSE_WINDOW

    753478
      Hello. I have a strange problem which I want to share with you guys, to see if you can shed some light on it.

      I have a WINDOW, which no matter what won't change its ACTIVE status to FALSE, even though after calling multiple times CLOSE_WINDOW sucessfully. The WINDOW is ENABLED and no jobs are currently running that could be using it. I even see in record saved in windowlog after I call CLOSE_WINDOW on it with REASON="Manual close" and operation CLOSE, but if I check its ACTIVE status on dbms_scheduler_windows or grid control it remains TRUE. I have no clue why is this happening. Shouldn't the window be CLOSED (ACTIVE = FALSE) after I call CLOSE_WINDOW on it ? If not, why ? What can I be doing wrong ?

      This is 11gR2 on HP-UX 11.31

      Thanks for any help!
        • 1. Re: WINDOW remains ACTIVE after calling CLOSE_WINDOW
          damorgan
          Not being able to see the commands you used to open it.
          Or what you tried to do to close it.
          Doesn't give us much to work with.
          • 2. Re: WINDOW remains ACTIVE after calling CLOSE_WINDOW
            753478
            Hi Damorgan, thanks for your reply.

            I have said I have used method CLOSE_WINDOW of the DBMS_SCHEDULER package to close. I dont know how or when it was opened to be honest, I just know it remains ACTIVE no matter how many times I call CLOSE_WINDOW.
            • 3. Re: WINDOW remains ACTIVE after calling CLOSE_WINDOW
              damorgan
              I am very familiar with what you wrote. Please reread what I wrote.

              It is insufficient for you to tell us what you did ... we need to see the actual DDL to help you. Almost nowhere in Oracle is there only one way to do something.

              http://www.builderau.com.au/strategy/developmentprocess/soa/How-developers-should-ask-for-help/0,339028278,339299138,00.htm
              • 4. Re: WINDOW remains ACTIVE after calling CLOSE_WINDOW
                753478
                damorgan,

                See output below.
                SQL> select enabled, active
                  2    from dba_scheduler_windows
                  3   where window_name = 'PROCESOS_NOCTURNOS_4AM'
                  4  /
                
                ENABL ACTIV
                ----- -----
                TRUE  TRUE
                
                SQL> begin
                  2     dbms_scheduler.close_window( 'PROCESOS_NOCTURNOS_4AM' );
                  3  end;
                  4  /
                
                PL/SQL procedure successfully completed.
                
                SQL> select enabled, active
                  2    from dba_scheduler_windows
                  3   where window_name = 'PROCESOS_NOCTURNOS_4AM'
                  4  /
                
                ENABL ACTIV
                ----- -----
                TRUE  TRUE
                
                SQL>
                Windows remains ACTIVE. They are not any jobs running under it, also, DBA_SCHEDULER_WINDOW_LOGS records the call with reason=Manual close. Why does the windows remains active?
                • 5. Re: WINDOW remains ACTIVE after calling CLOSE_WINDOW
                  753478
                  Anyone please?
                  • 6. Re: WINDOW remains ACTIVE after calling CLOSE_WINDOW
                    Eric337
                    Maybe the window reopens due to the repeat interval used. Pls post the ddl used to create the window.
                    Another thing to try is to disable the window before closing.
                    • 7. Re: WINDOW remains ACTIVE after calling CLOSE_WINDOW
                      753478
                      Here is the DDL
                      BEGIN
                      DBMS_SCHEDULER.CREATE_WINDOW(
                      window_name=>'"PROCESOS_NOCTURNOS_4AM"',
                      resource_plan=>'SYSTEM_PLAN',
                      start_date=>to_timestamp_tz('2009-09-04 -4:00', 'YYYY-MM-DD TZH:TZM'),
                      duration=>numtodsinterval(2, 'minute'),
                      repeat_interval=>'FREQ=WEEKLY;BYDAY=TUE,WED,THU,FRI,SAT;BYHOUR=4;BYMINUTE=0;BYSECOND=0',
                      end_date=>null,
                      window_priority=>'LOW',
                      comments=>'Ventana de Tiempo para los Procesos que Iniciaran a las 4AM de Martes-Sabado, por dos minutos.');
                      END;
                      Edited by: user12036918 on Jul 14, 2010 1:02 PM
                      • 8. Re: WINDOW remains ACTIVE after calling CLOSE_WINDOW
                        Eric337
                        Other then a small value for the duration of your window everyting looks ok.
                        You could try the following:

                        disable all windows, then close the open window (I assume "PROCESOS_NOCTURNOS_4AM")
                        and run the following script:


                        -- Run as sys


                        exec dbms_scheduler.set_scheduler_attribute('SCHEDULER_DISABLED', 'TRUE');



                        Rem ----------------------------
                        Rem Clear current_window attribute
                        Rem ----------------------------

                        exec dbms_ijob.set_enabled(FALSE);


                        alter system flush shared_pool;
                        alter system flush shared_pool;


                        declare
                        cwo number;
                        begin
                        select o.obj# into cwo from sys.obj$ o where
                        o.name = 'CURRENT_OPEN_WINDOW' and o.namespace = 51;


                        update sys.scheduler$_global_attribute set value = null, attr_tstamp = null,
                        attr_intv = null, additional_info = null where obj# = cwo;

                        end;
                        /

                        exec dbms_scheduler.set_scheduler_attribute('SCHEDULER_DISABLED', 'FALSE');
                        exec dbms_ijob.set_enabled(TRUE);


                        After this enable your windows.
                        • 9. Re: WINDOW remains ACTIVE after calling CLOSE_WINDOW
                          user12099976
                          I had a similar problem and the following worked.



                          BEGIN
                          DBMS_SCHEDULER.DISABLE ( '"PROCESOS_NOCTURNOS_4AM"');
                          END;
                          /

                          BEGIN
                          DBMS_SCHEDULER.ENABLE ( '"PROCESOS_NOCTURNOS_4AM"');
                          END;
                          /

                          EXECUTE DBMS_SCHEDULER.OPEN_WINDOW ('"PROCESOS_NOCTURNOS_4AM"','');

                          EXECUTE DBMS_SCHEDULER.CLOSE_WINDOW ('"PROCESOS_NOCTURNOS_4AM"');

                          Select window_name,active from DBA_SCHEDULER_WINDOWS;

                          Edited by: user12099976 on Aug 29, 2012 3:01 PM