This discussion is archived
1 Reply Latest reply: Nov 26, 2012 9:15 AM by Marcus Rangel RSS

Always trace an especific user

K- Newbie
Currently Being Moderated
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 Journeyer
    Currently Being Moderated
    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;

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points