Oracle Advanced Queue-死锁数据库

时间:2019-03-19 17:29:50

标签: oracle oracle11g oracle-aq

当前使用OAQ作为消息队列来接收日志事件。 Oracle 11gr2

真的很简单

PROCEDURE insert_queue(p_new_rec ag$lds_evt.evt_rec_typ, p_old_rec ag$lds_evt.evt_rec_typ) IS
    enqueue_options      DBMS_AQ.ENQUEUE_OPTIONS_T;
    message_properties   DBMS_AQ.MESSAGE_PROPERTIES_T;
    message_handle       RAW(16);
    MESSAGE              ldsi_aq_event_updates_type;
BEGIN
    MESSAGE := ldsi_aq_event_updates_type(COALESCE(p_new_rec.channel_type, p_old_rec.channel_type),
                                          NVL(p_new_rec.lot_id, p_old_rec.lot_id),
                                          COALESCE(p_new_rec.lot_lotid, p_old_rec.lot_lotid),
                                          COALESCE(p_new_rec.lot_system_code, p_old_rec.lot_system_code),
                                          NVL(p_new_rec.id, p_old_rec.id),
                                          NVL(p_new_rec.evtt_id, p_old_rec.evtt_id),
                                          p_new_rec.evtt_code,
                                          p_old_rec.target_area,
                                          p_new_rec.target_area,
                                          p_old_rec.solved_ny,
                                          p_new_rec.solved_ny,
                                          p_old_rec.delegated_ny,
                                          p_new_rec.delegated_ny);

    enqueue_options.visibility := DBMS_AQ.immediate;
    DBMS_AQ.enqueue(queue_name => 'LDSI_TMP_OWNER.LDSI_AQ_EVENT_UPDATES',
                    enqueue_options => enqueue_options,
                    message_properties => message_properties,
                    payload => MESSAGE,
                    msgid => message_handle);
END;

对于出队,我们得到了

PROCEDURE dequeue_event(context    IN RAW,
                        reginfo    IN SYS.AQ$_REG_INFO,
                        descr      IN SYS.AQ$_DESCRIPTOR,
                        payload    IN RAW,
                        payloadl   IN NUMBER) IS
    l_dequeue_options      DBMS_AQ.DEQUEUE_OPTIONS_T;
    l_message_properties   DBMS_AQ.MESSAGE_PROPERTIES_T;
    l_message_handle       RAW(16);
    l_message              ldsi_aq_event_updates_type;
BEGIN
    l_dequeue_options.wait := DBMS_AQ.no_wait;
    l_dequeue_options.msgid := descr.msg_id;
    l_dequeue_options.consumer_name := descr.consumer_name;
    DBMS_AQ.dequeue(queue_name => descr.queue_name,
                    dequeue_options => l_dequeue_options,
                    message_properties => l_message_properties,
                    payload => l_message,
                    msgid => l_message_handle);
            ldsi_event.update_mrb_b(p_message => l_message);
    COMMIT;
END;

我们注册了一个自动将所有内容出队的订户。 正常工作,直到有大量流量通过...直到队列开始累加,它开始阻止所有计划作业,然后最终使oracle崩溃。 每秒可以支持多少消息有什么限制?这可能是资源问题吗?

0 个答案:

没有答案