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: enable sql trace on users

Re: enable sql trace on users

From: <mark.powell_at_eds.com>
Date: 17 Oct 2002 15:45:22 GMT
Message-ID: <aomlui$m8p$1@news.netmar.com>


In article <6dabc692.0210170351.791f7154_at_posting.google.com>, Teresa <tpreto7_at_sapo.pt> writes:
>tpreto7_at_sapo.pt (Teresa) wrote in message
news:<6dabc692.0210161531.5781fc30_at_posting.google.com>...
>> I would liek to set up sql tracing on some users, can someone please
>> tell me how can I do it. I needed in order to view how many times some
>> users are connecting to the database then I need to set up user
>> profiles for that specific users that are taking to many connections.
>> Any ideias would be great
>> Thanks
>> Teresa
>
>
>Thank you Stan
>
>Can you please tell me where do I apply this: I have 3 users in the
>entire schema which I would like to monitor,
>Thanks again
>Teresa
>
>
>if (user='blah') then
> execute immediate 'alter session set sql_trace=true';
>end if;

Teresa, if you actually want to trace the SQL that the users are running instead of just monitoring how often they connect then you would need to code a database event trigger for the logon event and this trigger would fire every time someone makes a connection to the db instance but only turn tracing on for the username 'blah' in your example.

The cooperative FAQ at http://www.jlcomp.demon.co.uk/faq/ind_faq.html has an article on turning trace on for an existing session that may be of interest, and it also has an article related to locating sessions based on OS PIDs and similar activities you may have an interest in.

You can find information on database event triggers in the DBA Admin manual to start and the SQL manual.

HTH -- Mark D Powell --

Received on Thu Oct 17 2002 - 10:45:22 CDT

Original text of this message

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