Home » SQL & PL/SQL » SQL & PL/SQL » what select send user?
what select send user? [message #365351] Thu, 11 December 2008 11:47 Go to next message
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 #365354 is a reply to message #365351] Thu, 11 December 2008 12:11 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Sometimes joining v$session and v$sql.

Regards
Michel
Re: what select send user? [message #365368 is a reply to message #365354] Thu, 11 December 2008 14:11 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
See column "parsing_schema_name" for sessions no longer present.
Re: what select send user? [message #375910 is a reply to message #365351] Mon, 15 December 2008 06:03 Go to previous messageGo to next message
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 #375913 is a reply to message #375910] Mon, 15 December 2008 06:09 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
in mysql is it possible too?

This is an Oracle forum.

Regards
Michel
Re: what select send user? [message #375920 is a reply to message #365351] Mon, 15 December 2008 06:20 Go to previous messageGo to next message
guif
Messages: 17
Registered: November 2008
Junior Member
Sorry for the confusion.
I have this table replicate into an Oracle database.

Re: what select send user? [message #375941 is a reply to message #375920] Mon, 15 December 2008 07:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So what is the question?
What is the relation with the original question?

Regards
Michel
Re: what select send user? [message #375943 is a reply to message #365351] Mon, 15 December 2008 07:19 Go to previous messageGo to next message
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 #375949 is a reply to message #365351] Mon, 15 December 2008 07:28 Go to previous messageGo to next message
guif
Messages: 17
Registered: November 2008
Junior Member
the question is that i don't know what Querie i make for my database and how to make it

[Updated on: Mon, 15 December 2008 07:41]

Report message to a moderator

Re: what select send user? [message #375965 is a reply to message #375949] Mon, 15 December 2008 08:42 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
But a query for what???

Regards
Michel
Re: what select send user? [message #375986 is a reply to message #365351] Mon, 15 December 2008 09:53 Go to previous messageGo to next message
guif
Messages: 17
Registered: November 2008
Junior Member
the query to know what's the user and the Select that the user send to my Oracle
Re: what select send user? [message #375995 is a reply to message #375986] Mon, 15 December 2008 10:05 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From where?
Where do you want to execute the query?
If from Oracle, read my first answer.
If not, read my second answer.

Regards
Michel
Re: what select send user? [message #376007 is a reply to message #365351] Mon, 15 December 2008 11:41 Go to previous messageGo to next message
guif
Messages: 17
Registered: November 2008
Junior Member
i don't know to joining v$session and v$sql....
Re: what select send user? [message #376013 is a reply to message #376007] Mon, 15 December 2008 12:09 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It depends on your version.

Regards
Michel
Re: what select send user? [message #376042 is a reply to message #376013] Mon, 15 December 2008 14:32 Go to previous message
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.
Previous Topic: Small Urgent Help Neede in PL?SQL
Next Topic: Same query different results
Goto Forum:
  


Current Time: Sat Dec 03 07:55:48 CST 2016

Total time taken to generate the page: 0.10674 seconds