Re: sql_trace filtering

  • From: Sayan Malakshinov <xt.and.r@xxxxxxxxx>
  • To: Martin Berger <martin.a.berger@xxxxxxxxx>
  • Date: Wed, 22 Dec 2021 19:42:38 +0300

Hi Martin,

Mikhail maybe will add more details, I'll just say about username():

Username is an action from library rdbms:
http://orasql.org/files/events/doc/event/action/oradebug-doc-event-action-username.php
You can find other actions with `oradebug doc event action` command:
http://orasql.org/files/events/oradebug-doc-event-action.php



Best regards,
Sayan Malakshinov
Oracle performance tuning expert
Oracle Database Developer Choice Award winner
Oracle ACE
http://orasql.org

ср, 22 дек. 2021 г., 19:29 Martin Berger <martin.a.berger@xxxxxxxxx>:

Hi Mikhail,

that looks great!
Do you know of any other values we can compare? (e.g. action, module,
client_id)
Or more generic: where did you get the username() from?

thank you,
 Martin

Am Di., 21. Dez. 2021 um 16:59 Uhr schrieb Mikhail Velikikh <
mvelikikh@xxxxxxxxx>:

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@xxxxxxxxx>
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@xxxxxxxxx>
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



--
Martin Berger                Oracle ♠
martin.a.berger@xxxxxxxxx @martinberx <https://twitter.com/martinberx>
^∆x      http://berxblog.blogspot.com

Other related posts: