Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: trace via logon trigger
This was my solution, although for some reason I was having trouble with =
the tick's.
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Wolfgang Breitling
Sent: Thursday, May 13, 2004 10:31 AM
To: oracle-l_at_freelists.org
Subject: RE: trace via logon trigger
I don't like to use a wider scope than necessary to solve a problem, =
i.e.=20
use a "logon on database" trigger when a "logon on schema" is =
sufficient.=20
Limit potential damage to the smallest possible exposure.
This works for me:
SQL> create user kpayton identified by kpayton;
User created.
SQL> create or replace trigger kpayton.logon_trigger
2 after logon on kpayton.schema
3 begin
4 execute immediate 'alter session set events ''10046 trace name=20
context forever, level 4''';
5 exception
6 when others then null;
7 end;
8 /
Trigger created.
SQL> show errors
No errors.
SQL>
PS. Just because it works outside the trigger doesn't mean it will work=20
inside the trigger. User kpayton needs the "alter session" privilege=20
granted explicitly and directly.
At 07:58 AM 5/13/2004, you wrote:
>This should work...
>create or replace trigger set_system_event
>after logon on database
>declare
>v_user dba_users.username%TYPE:=3Duser;
>sql_stmt1 varchar2(256) :=3D'alter session set events =
'||chr(39)||'10046
>trace name context forever, level 12'||ch
>r(39);
>begin
> if (v_user=3D'XXXX') THEN
> execute immediate sql_stmt1;
> end if;
>end;
>/
regards
Wolfgang Breitling
Centrex Consulting Corporation
www.centrexcc.com=20
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html ----------------------------------------------------------------- ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line. -- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Thu May 13 2004 - 18:05:50 CDT