This content has been marked as final. Show 2 replies
You can see SQL that has been recently executed using the v$SQL view - if you have permission to see it
I recommend you to install STATSPACK - it's a free tool that can be used instead of the Automatic Workload Repository (that is used in OEM).
This tool creates snapshots of V$ views in defined time period, so it enables you to see long runing queries in history.
If I were you I would run SQL trace just before the problematic part and then stop it just as it has finished. It would be better to run trace only for the problematic session or module - not for the whole database. SQL trace generates a file with all the executed queries, explain plans, stats, ...
In extreme case just create copy of v$sql before and after the problematic part and compare them (new sql_id, elapsed_time delta, ...)