I need to capture Oracle stored procedures calls (with parameters) to trace an application (which uses JDBC to connect to the DB). I need something like sp_trace_setevent for Rpc:Completed event in MS SQL SERVER.
I do not have access to this application, but have mostly all rights in the database. I would like to stay in PL/SQL (and Oracle SQL Developer 3.2.20).
I have tried:
Oracle SQL Developer UI "Tools"/ "RealTime SQL Monitoring" and "Tools"/ "Sessions" instruments but can't understand how to enabling accumulating information instead of capturing moment snapshot.
exploring
v$sql
- it seems there are no sp calls.v$sqlarea
differences (Oracle: is there a tool to trace queries, like Profiler for sql server? , mdj3884 reply) - there I am able to find my test call, but without parameters...Suggestion from Tom's article : http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:767025833873. Particularly, it is looping through
v$sqltext_with_newlines
, but I can't understand what is a script result. Something more like moment snapshot; isn't it? But then why they call it tracking?use
DBMS_APPLICATION_INFO
- as I understand using this I can add custom info toV$SESSION
andV$SESSION_LONGOPS
- it can be useful for monitoring tasks but I can't imagine how it can be used for accumulating information about sp calls and theirs parameters.use
DBMS_MONITOR
for enabling tracing into file. but I can't find option to enable tracing only sp call events, also it requires access to the server files.DBMS_PROFILER
- collects as I understand by default it collects only statistics (min, max time); there should be possibility to add custom information toplsql_profiler_runs
but I can't find this table (whenDBMS_PROFILER
is in place).
What to see next? What I have missed?
P.S. If the only one way is to change SP body (those SP which need to be traced) then what is the quickest and safest way to log sp parameters from sp body in Oracle? It could be logging to custom table, but may be I could choose between generating another types of events (that are not rollbacked, something like SQL Server custom trace events)?