Oracle Question - L...
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] Oracle Question - Last SQL command run by a user

8 Posts
4 Users
0 Reactions
58 Views
Posts: 13418
Full Member
Topic starter
 

Is there any way of finding the last SQL command executed against a database for a given user?


 
Posted : 08/09/2009 3:23 pm
Posts: 2
Free Member
 

V$SQL is the table you need but you need DBA access. I have never been allowed to play with it 🙁


 
Posted : 08/09/2009 3:31 pm
Posts: 2
Free Member
 

select
u.sid,
substr(u.username,1,12) user_name,
s.sql_text
from
v$sql s,
v$session u
where
s.hash_value = u.sql_hash_value
and
sql_text not like '%from v$sql s, v$session u%'
order by
u.sid;


 
Posted : 08/09/2009 3:36 pm
Posts: 2
Free Member
 

Sorry double thingy!


 
Posted : 08/09/2009 3:36 pm
Posts: 13418
Full Member
Topic starter
 

STW beats the combined muscle of Google & Oracle User Forum & teams or Oracle experts


 
Posted : 08/09/2009 3:48 pm
Posts: 0
Free Member
 

You need a £100K consultant....

Oh!


 
Posted : 08/09/2009 3:51 pm
Posts: 2763
Full Member
 

i find water boarding them for an hour usualy helps
after that they'll give up anything.


 
Posted : 08/09/2009 4:22 pm
Posts: 13418
Full Member
Topic starter
 

allthepies - You don't need to know everything, just to know how to get the info

😉


 
Posted : 08/09/2009 4:34 pm
Posts: 2
Free Member
 

"Information is not knowledge. "
Albert Einstein


 
Posted : 08/09/2009 4:42 pm