RE: trace via logon trigger

  • From: "Khedr, Waleed" <Waleed.Khedr@xxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 13 May 2004 11:47:47 -0400

Usually all the stuff I do in the logon triggers are driven by metadata =
stored in a cached table.
so for example, you can have one logon trigger that reads the list of =
users of a table and compare it to the user that is attempting logon to =
decide actions need to be done.

Waleed

-----Original Message-----
From: Wolfgang Breitling [mailto:breitliw@xxxxxxxxxxxxx]
Sent: Thursday, May 13, 2004 10:31 AM
To: oracle-l@xxxxxxxxxxxxx
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

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //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@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: