Re: Tracing query inside procedure without 10046

From: Mladen Gogala <gogala.mladen_at_gmail.com>
Date: Sat, 5 Aug 2023 12:53:32 -0400
Message-ID: <f526ba6b-cd2a-6690-faa0-83183bfd98cb_at_gmail.com>



On 8/5/23 05:33, Lothar Flatz wrote:
> Hi,
>
> no. You can set a trap that would automatically trace a certain sql_id
> when it executes.
> E.g.
> https://smarttechways.com/2018/12/10/trace-the-sql-query-with-sql-id-in-oracle/
> Traces in Oracle are very complex, there are options to trace almost
> everything you can imagine.
> Stefan Köhler is an expert on it.

It is also possible to turn on SQL Trace programmatically, through the DBMS_MONITOR package. It would work even better if you use DBMS_APPLICATION_INFO to set up client id and module id. You can then turn on tracing for client_id or module_id. However, I am not sure what does the OP want to do? Is the goal do determine procedure which starts the SQL or is the purpose to determine which SQL is causing the problem? For the latter, the application trace using DBMS_MONITOR is the Best Way (TM).

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Aug 05 2023 - 18:53:32 CEST

Original text of this message