Show all queries coming to an Oracle database

user1186971 picture user1186971 · Feb 3, 2012 · Viewed 34.1k times · Source

I need to see all queries coming to database. How to do that? I could not get proper results from a Google search.

Answer

Sathyajith Bhat picture Sathyajith Bhat · Feb 3, 2012

Enable SQL Trace & all the queries coming to the database will be logged.

ALTER SESSION SET sql_trace = true;
ALTER SESSION SET tracefile_identifier = mysqltrace;

The trace file will be present in the udump directory.

If you want to audit the database, look at my previous answer.