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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.