Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Catch All Queries Executed on DB Programmatically

Former Member
0 Likes
811

Hi all,

I have a requirement where I need to catch all queries (SELECT, INSERT, UPDATE, DELETE) being executed against the data base server from SAP server programmatically, anybody can advise on this?

Thanks

5 REPLIES 5
Read only

Sandra_Rossi
Active Contributor
0 Likes
765

You could debug what is done during the SQL trace (transaction code ST05), and reproduce it into your program. There are probably many threads which discuss of that (search function module PERFORMANCE_TRACE_ON, PERFORMANCE_TRACE_GET, etc., there are also classes now to read the traces)

Read only

0 Likes
765

Thank you for your suggestion but I'm looking for something the runs continuously, not just when a trace is running.

Read only

0 Likes
765

No you can't do that, you would put the server down. Can you imagine how many SQL operations per second there are in the system! I can't imagine you have to trace everything, what is your exact requirement?

Read only

0 Likes
765

As far as I know ST04 is already doing that so why can't we have something similar?

Read only

0 Likes
765

So, if it's a tool in your database system, you should refer to the database editor's documentation or forum, to see where and how this trace is stored (not at the "ABAP side" anyway). If your ST04 tool displays the data, then same remark as above: "You could debug what is done during the [trace display], and reproduce it into your program"