[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to know the history of sql commands executed by a user on linux

Posted on 2011-03-09
5
Medium Priority
?
296 Views
Last Modified: 2012-06-21
Hi,

I would like to know if there is any location where the sql commands executed by a user are stored. Any help is appreciated.

Thanks in advance.
0
Comment
Question by:Cha1tu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

Expert Comment

by:Franck Pachot
ID: 35093881
Hi,
You can check v$sql for a PARSING_SCHEMA_NAME (user) and order by LAST_ACTIVE_TIME
Regards,
Franck.
0
 
LVL 2

Author Comment

by:Cha1tu
ID: 35094579
Thank you Franck for your response. The SQL_FULLTEXT is giving a vague idea of what the user may have done something like " insert into sys.wri$_optstat_opr (operation, target, start_time, end_time) valu  "

How do we interpret it? Can we actually get back the query as it was executed?
0
 
LVL 15

Accepted Solution

by:
Franck Pachot earned 2000 total points
ID: 35094961
You see statements typed by the users as well as recursive statements (from a pl/sql procedure for exemple)
Not sure, but sys.wri$_optstat_opr may come from the call to dbms_stats.gather_system_stats
0
 
LVL 2

Author Comment

by:Cha1tu
ID: 35095346
Thank you Franck,

I now understood what you said. But is there any way we can filter only the full commands and not the recursive statements?
0
 
LVL 15

Expert Comment

by:Franck Pachot
ID: 35095922
No you can't :(
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question