1 Reply Latest reply: Nov 26, 2012 11:15 AM by Marcus Rangel RSS

    Always trace an especific user

    K-
      Good afternoon!

      Is there a way to always trace (until disabled) and specific user instead of only a specific session itself? If does, how do I enable it?

      Thank you very much!
        • 1. Re: Always trace an especific user
          Marcus Rangel
          Maybe there are better ways, but I use logon triggers for that. Like this:
          CREATE OR REPLACE TRIGGER TRIGGER_TRACE_01
          AFTER LOGON ON DATABASE
          DECLARE
            STR VARCHAR2(127);
          BEGIN
            --
            IF USER = 'THEONE' THEN
               STR := 'ALTER SESSION SET TRACEFILE_IDENTIFIER=''TRACE_THEONE''';
               EXECUTE IMMEDIATE STR;
               STR := 'ALTER SESSION SET EVENTS ''10046 TRACE NAME CONTEXT FOREVER, LEVEL 8''';
               EXECUTE IMMEDIATE STR;
            END IF;
            --
          END TRIGGER_TRACE_01;