Re: sql_trace filtering

From: Mikhail Velikikh <mvelikikh_at_gmail.com>
Date: Tue, 21 Dec 2021 15:59:41 +0000
Message-ID: <CALe4Hpn8H1bgZuRkMYt0LBRfkm0QqLS-Bwbz+p2GXU5K_j-ggw_at_mail.gmail.com>



>
> Is it possible to add a filter for user ID/name as well? I've been
> searching, but can't seem to find any examples of this if so.
>

Yes, it is indeed possible with a proper syntax, e.g.:

alter system set events 'sql_trace[sql:bqka14bvd2zmb] {streq:username(),"TC1"}';

Please see a full Gist:
https://gist.github.com/mvelikikh/27a488e9104e63a55261c480b70a86f6

Yes, of course, for example, you can specify a filter by process: ospid or
> orapid or pname:
>

You cannot filter by username with the process filter.

On Tue, 21 Dec 2021 at 15:39, Sayan Malakshinov <xt.and.r_at_gmail.com> wrote:

> Hi Adric,
>
> Yes, of course, for example, you can specify a filter by process: ospid or
> orapid or pname:
>
> {process: ospid <string>[20],
> orapid <ub4>,
> pname <string>[20],
> con_id <ub8> }
>
>
> http://orasql.org/2021/05/20/oracle-diagnostic-events-cheat-sheet/
>
>
> http://orasql.org/files/events/doc/event/filter/oradebug-doc-event-filter-process.php
>
>
>
> On Tue, Dec 21, 2021 at 6:30 PM Gogala, Mladen <gogala.mladen_at_gmail.com>
> wrote:
>
>> *CAUTION: This email has originated from an extremely suspect and
>> sometimes very grumpy sender. Proceed with extreme caution and use the
>> Force.*
>> On 12/21/2021 10:14 AM, Adric Norris wrote:
>>
>> Is it possible to add a filter for user ID/name as well? I've been
>> searching, but can't seem to find any examples of this if so.
>>
>> Thanx!
>>
>> Hi Adric!
>>
>> You can create on logon trigger for the specified user and use "ALTER
>> SESSION" instead of "ALTER SYSTEM".
>>
>> Regards
>> --
>> Mladen Gogala
>> Oracle DBA
>> Tel: (347) 321-1217
>> Blog: https://dbwhisperer.wordpress.com
>>
>
>
> --
> Best regards,
> Sayan Malakshinov
> Oracle performance tuning engineer
> Oracle ACE
> http://orasql.org
>

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Dec 21 2021 - 16:59:41 CET

Original text of this message