DBMS_ALERT.WAITANY挂起一段时间

时间:2017-01-23 10:55:45

标签: plsql

我有一份工作,会提交其他工作。我已经设置了我的pl / sql过程来使用dbms_alert.register注册n个作业。每个作业都将发送一个dbms_alert.signal。我已经在信号发出后立即发出了提交。

但有时它会挂在处理它们的服务器上。下面是相同的代码片段。所有警报/作业都会更新或插入不同的表中。他们可能使用针对相同或不同表的select查询来获取数据/记录。任何人都可以在服务器上找到可能导致此挂起问题的原因。

FUNCTION GenBociCltStm  RETURN NUMBER
            .......
            .........
             .......
        -- The following can be executed in any order (and in parallel)
        dbms_alert.register('CltMstAlert');
        dbms_alert.register('TrdPstAlert');
        dbms_alert.register('TrdLegAllAlert');
        dbms_alert.register('CrpActPstAlert');
        dbms_alert.register('SttPstAlert');
        dbms_alert.register('StkMovAlert');
        dbms_alert.register('StkHldAlert');
        dbms_alert.register('IntAlert');
        dbms_alert.register('TermLoanAlert');

        dbms_job.submit ( l_job,
                            ' BEGIN 
                PkgBociCltStmGen.GenBociCltStmCltMst; 
                exception when others then 
                    NULL;
                  END;
               dbms_alert.signal(''CltMstAlert'', ''GenBociCltStmCltMst Complete''); commit;',
               SYSDATE
               );

        dbms_job.submit ( l_job,
                            ' BEGIN 
                PkgBociCltStmGen.GenBociCltStmTrdPst; 
                exception when others then 
                    NULL;
                  END;
               dbms_alert.signal(''TrdPstAlert'', ''GenBociCltStmTrdPst Complete''); commit;',
               SYSDATE
               );

        dbms_job.submit ( l_job,
                            ' BEGIN 
                PkgBociCltStmGen.GenBociCltStmTrdLegAll; 
                exception when others then 
                    NULL;
                  END;
               dbms_alert.signal(''TrdLegAllAlert'', ''GenBociCltStmTrdLegAll Complete''); commit;',
               SYSDATE
               );

        dbms_job.submit ( l_job,
                            ' BEGIN 
                PkgBociCltStmGen.GenBociCltStmCrpActPst; 
                exception when others then 
                    NULL;
                  END;
               dbms_alert.signal(''CrpActPstAlert'', ''GenBociCltStmCrpActPst Complete''); commit;',
               SYSDATE
               );

        dbms_job.submit ( l_job,
                            ' BEGIN 
                PkgBociCltStmGen.GenBociCltStmSttPst; 
                exception when others then 
                    NULL;
                  END;
               dbms_alert.signal(''SttPstAlert'', ''GenBociCltStmSttPst Complete''); commit;',
               SYSDATE
               );

        dbms_job.submit ( l_job,
                            ' BEGIN 
                PkgBociCltStmGen.GenBociCltStmStkMov; 
                exception when others then 
                    NULL;
                  END;
               dbms_alert.signal(''StkMovAlert'', ''GenBociCltStmStkMov Complete''); commit;',
               SYSDATE
               );

        dbms_job.submit ( l_job,
                            ' BEGIN 
                PkgBociCltStmGen.GenBociCltStmStkHld; 
                exception when others then 
                    NULL;
                  END;
               dbms_alert.signal(''StkHldAlert'', ''GenBociCltStmStkHld Complete''); commit;',
               SYSDATE
               );

        dbms_job.submit ( l_job,
                            ' BEGIN 
                PkgBociCltStmGen.GenBociCltStmInt; 
                exception when others then 
                    NULL;
                  END;
               dbms_alert.signal(''IntAlert'', ''GenBociCltStmInt Complete''); commit;',
               SYSDATE
               );

    dbms_job.submit ( l_job,
                            ' BEGIN 
                PkgBociCltStmGen.GenBociCltStmTrmLon; 
                exception when others then 
                    NULL;
                  END;
                    dbms_alert.signal(''TermLoanAlert'', ''GenBociCltStmTrmLon Complete''); commit;',
                            SYSDATE
                            );
        commit;
         ......
         ......
         ......

        LOOP
            DBMS_ALERT.WAITANY(l_name, l_msg, l_status,6000);

            IF g_debug THEN
                SP_DEBUGLOG('===> alert '|| l_name,FALSE);
            END IF;

            l_counter := l_counter - 1;
            IF l_counter = 0 THEN
                EXIT;
            END IF;
        END LOOP;

任何建议都将受到高度赞赏!!

0 个答案:

没有答案