how to see the monitor the queries issued by various users [message #57319] |
Thu, 05 June 2003 06:47 |
rameshkumar
Messages: 12 Registered: May 2003
|
Junior Member |
|
|
hi all,
i just want some info.
In my database, i have around 200 users. all the users work on that, and issue various queries.
I want to monitor and find out the queries which r issued by them.
Plz provide me the various methods of finding out.
Thanks for ur kind response.
bye
|
|
|
Re: how to see the monitor the queries issued by various users [message #57346 is a reply to message #57319] |
Fri, 06 June 2003 17:13 |
Trifon Anguelov
Messages: 514 Registered: June 2002
|
Senior Member |
|
|
Use this query to get the information:
REM user_query.sql
REM
REM List all user sessions and their queries
clear columns breaks
column username format a15 heading 'Username'
column status format a10 heading 'Status'
column text format a64 heading 'SQL Text'
set pages 1000
set lines 132
break on status on sid on username
alter session set optimizer_goal=choose;
select ses.sid,
ses.serial#,
ses.username,
ses.status,
sql.sql_text
from v$session ses,
v$sqltext sql
where ses.sql_address = sql.address and
ses.sql_hash_value = sql.hash_value and
ses.username is not null
order by sid, username, sql.piece
/
Hope that helps,
clio_usa
OCP - DBA
Visit our Web site
|
|
|