RE: trace via logon trigger

  • From: "Norris, Gregory T [ITS]" <gregory.t.norris@xxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 13 May 2004 09:10:43 -0500

I've used the following trigger successfully in the past, under Oracle =
8.1.7.  You need to grant ALTER SESSION directly to the trigger owner.  =
In hindsight, it would probably be better to update it to "after logon =
on schema" (don't recall why I did it this way), but it works fine =
as-is.

----- <snip> -----
create or replace trigger set_trace after logon on database
DECLARE
   username              varchar2(30);

BEGIN
   username :=3D sys_context('USERENV','SESSION_USER');
   if username =3D 'LLWEBC' then
      execute immediate 'ALTER SESSION SET EVENTS ''10046 TRACE NAME =
CONTEXT FOREVER, LEVEL 4''';
   end if;

END;
/
----- <snip> -----

It would probably=20


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Ken Payton
Sent: Thursday, May 13, 2004 8:44 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: trace via logon trigger


Anyone have any tips on setting up a logon trigger for initiating a =3D
10046 event.  I tried the following but although it shows no errors it =
=3D
does not start the session tracing.

execute immediate 'alter session set events ''10046 trace name context =
=3D
forever, level 4'' ';
----------------------------------------------------------------
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: