Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Logon Trigger for SQL TRACING using (Third party tool)

Re: Logon Trigger for SQL TRACING using (Third party tool)

From: BSena <bill_sena_at_hotmail.com>
Date: 12 Mar 2004 18:52:09 -0800
Message-ID: <2ceca914.0403121852.632f474c@posting.google.com>


Thanks Niell,

I also like to say it seems that, I will give the name of the user in if condition in the logon trigger, in order to start sql tracing.

I further define that, I wanted that whenever this third party tool connect to database with any user, the sql tracing will start for that specific seesion and then read the sqltrace file implicitly for that session using TKPROF.
Looking forward to your suggestion.

Thanks

Bill

"Niall Litchfield" <n-litchfield_at_audit-commission.gov.uk> wrote in message news:<4051ab6b$0$3302$ed9e5944_at_reading.news.pipex.net>...
> "BSena" <bill_sena_at_hotmail.com> wrote in message
> news:2ceca914.0403112127.7dbaf612_at_posting.google.com...
> > Thanks Pete,
> >
> >
> > As you thought, I want to trace the use of a third party
> > Tool.
> > The users of this tool logon the same single database with different
> > service names.
> > I have visited your papers about SQL TRACING.
> > It contains lots of information about SQL TRACE.
> > But at that stage I am little bit confused.
> > If possible, Could you give some sample with respect to my query (SQL
> > tracing for third party tool via logon trigger),in order to the trace
> > that specific
> > session which is rinnung this third party tool.
> >
> > Thanks
> >
> > Bill
>
> You might find the following helpful. There are a couple of oddities. I
> massage the username because I am using a domain account for testing
> purposes. You probably wouldn't need to do this on *nix. I have cut out some
> info that might identify the app or the os environment we have so the
> trigger might not compile without a bit of editing.
>
> CREATE OR REPLACE TRIGGER TRG_<SCHEMA_NAME>_LOGON
>
> AFTER LOGON ON <SCHEMA_NAME>.SCHEMA
>
> DECLARE
>
> v_username varchar2(255);
>
> begin
>
> /* get the osuser */
>
> select sys_context('userenv','os_user') into v_username from dual;
>
> v_username := substr(v_username,instr(v_username,'\')+1);
>
> if v_username = '<oslogon_name>' then
>
> execute immediate 'alter session set events ''10046 trace name context
> forever,level 8''';
>
> end if;
>
> end;
>
> /
>
>
>
> cheers
Received on Fri Mar 12 2004 - 20:52:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US