RE: SQL trace for connections coming in for a database service

From: Allen, Brandon <Brandon.Allen_at_OneNeck.com>
Date: Fri, 17 Jul 2009 08:51:48 -0700
Message-ID: <64BAF54438380142A0BF94A23224A31E1128F41628_at_ONEWS06.oneneck.corp>



Good suggestion, but if I understand correctly, the serv_mod_act_trace_enable procedure will only trace any existing sessions for the specified service/module/action at the time the procedure is executed. If you want to automatically trace all future sessions for that service name as well, I think you might need to create a logon trigger like this:

CREATE OR REPLACE TRIGGER trace_service
AFTER LOGON ON DATABASE
BEGIN
  IF SYS_CONTEXT('userenv','service_name') = 'ssi' THEN

        dbms_monitor.session_trace_enable(waits=>true,binds=>true);   END IF;
END;
/

Regards,
Brandon

-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of D'Hooge Freek

exec dbms_monitor.serv_mod_act_trace_enable(service_name => 'service_name', waits => TRUE, binds => true);

Privileged/Confidential Information may be contained in this message or attachments hereto. Please advise immediately if you or your employer do not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of this company shall be understood as neither given nor endorsed by it.

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jul 17 2009 - 10:51:48 CDT

Original text of this message