ORACLE -- last 10+ SQL statements

How can I see the last 10+ SQL
statements that ran on my Oracle
server ?

Example
  SELECT * FROM CUSTOMERS
  DELETE * FROM USERS
  etc
finance_teacherAsked:
Who is Participating?
 
slightwv (䄆 Netminder) Commented:
Check out LAST_ACTIVE_TIME in V$SQLAREA.

that is the last time the SQL PLAN was last active.  I'm not sure what sets that column but I would hope the CBO looks at the plan before it executes the SQL.
0
 
sdstuberCommented:
unless you have auditing turned on for everything,  no, you can't.

If you do, then you should be able to see them in dba_audit_trail
0
 
sdstuberCommented:
last_active_time is not the last "run" time though.

just the last time the plan was active, which would be at fetch time.

The statement being active might have started hours ago. but only fetched part of it, a thousand statements might have been run since then between fetches.

So, it still might be the "correct" answer, it depends on what is meant by "last statement ran"
0
 
slightwv (䄆 Netminder) Commented:
Good point.  Didn't consider that.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.