what select send user? [message #365351] |
Thu, 11 December 2008 11:47  |
guif
Messages: 17 Registered: November 2008
|
Junior Member |
|
|
Is it possible with a Select, know what's the user and the Selectthat the user send to my Oracle????
|
|
|
|
|
Re: what select send user? [message #375910 is a reply to message #365351] |
Mon, 15 December 2008 06:03   |
guif
Messages: 17 Registered: November 2008
|
Junior Member |
|
|
in mysql is it possible too?
I have a very simple table. In my case:
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| func |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| proc |
| procs_priv |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
If any user put: select * from hosts;
Now, is possible to see this query? For example, this query is very hard...
|
|
|
|
|
|
Re: what select send user? [message #375943 is a reply to message #365351] |
Mon, 15 December 2008 07:19   |
subhra_88
Messages: 14 Registered: April 2007 Location: Bangalore
|
Junior Member |
|
|
You can do this easily using toad through session browser.
Else you can also write your own query by joining the views mentioned above by Michel.
|
|
|
|
|
|
|
|
|
Re: what select send user? [message #376042 is a reply to message #376013] |
Mon, 15 December 2008 14:32  |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
The OP asked a simple question and the basic answer is simple.
select COMMAND_TYPE, SQL_TEXT, PARSING_SCHEMA_NAME, MODULE, ACTION, LAST_ACTIVE_TIME
--, SQL_FULLTEXT
from v$sql
where PARSING_SCHEMA_NAME = ...
Be sure to understand that v$sql shows currently cached statements. SQL that's been aged out or flushed won't be in there. Invalid statements won't be there either. The solution could be different in a RAC environment (gv$sql), if you have stored pl/sql that uses "definer rights" etc. so run some tests to verify the SQL gives you what you want, including DB link connections, "cursor sharing" or whatever.
|
|
|