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

Posted on 2011-03-09
Last Modified: 2012-06-21

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.
Question by:Cha1tu
  • 3
  • 2
LVL 15

Expert Comment

by:Franck Pachot
ID: 35093881
You can check v$sql for a PARSING_SCHEMA_NAME (user) and order by LAST_ACTIVE_TIME

Author Comment

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?
LVL 15

Accepted Solution

Franck Pachot earned 500 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

Author Comment

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?
LVL 15

Expert Comment

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Encryption Decryption in Oracle 12 102
Difference in number of minutes between 2 timestamps 16 39
SQL Query 34 79
Oracle 10g standard edition server with 4 processors 3 24
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ā€¦
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

932 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now