executions [message #528571] |
Tue, 25 October 2011 13:00 |
sant_new
Messages: 165 Registered: June 2008
|
Senior Member |
|
|
Hi Friends,
I need to know how many number of times the sql's had been executed/run in an oracle session. Executions in V$sql, is it the right place to look at? Will it give the number of times the sql has been executed in a particular session?
Thanks again
|
|
|
|
Re: executions [message #528573 is a reply to message #528572] |
Tue, 25 October 2011 13:07 |
sant_new
Messages: 165 Registered: June 2008
|
Senior Member |
|
|
Okay. But right now there are no other sessions connected to this database.. so it should all be from this one session that I'm trying to get the sql executions for...
I tried this to get the number of times a sql has been executed, but I'm not sure if this is really right...
select c.user_name, c.sid, sql.sql_text, sql.executions
from v$open_cursor c, v$sql sql
where c.sql_id=sql.sql_id
and c.sid=151
order by executions desc
Please help... Thanks
|
|
|
Re: executions [message #528574 is a reply to message #528573] |
Tue, 25 October 2011 13:16 |
|
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
valid SQL
1 select c.user_name, c.sid, sql.sql_text, sql.executions
2 from v$open_cursor c, v$sql sql
3 where c.sql_id=sql.sql_id
4 and c.sid=151
5* order by executions desc
SQL> /
no rows selected
|
|
|