• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

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

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
Cha1tu
Asked:
Cha1tu
  • 3
  • 2
1 Solution
 
Franck PachotCommented:
Hi,
You can check v$sql for a PARSING_SCHEMA_NAME (user) and order by LAST_ACTIVE_TIME
Regards,
Franck.
0
 
Cha1tuAuthor Commented:
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
 
Franck PachotCommented:
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
 
Cha1tuAuthor Commented:
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
 
Franck PachotCommented:
No you can't :(
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now