session and process

classic Classic list List threaded Threaded
4 messages Options
big
Reply | Threaded
Open this post in threaded view
|

session and process

big
Hi,
on 11.2.0.4 on AIX

How can I find number of sessions at a precise date time?

Any query?

How can I find number of processes at a precise date time?

Any query?

Thank you.
big
Reply | Threaded
Open this post in threaded view
|

Re: session and process

big
This post was updated on .
I found these:

SELECT count(*) from V$PROCESS;

SELECT sess.process, sess.status, sess.username, sess.schemaname, sql.sql_text
  FROM v$session sess,
       v$sql     sql
 WHERE sql.sql_id(+) = sess.sql_id
   AND sess.type     = 'USER';

And to find what a process does:

select sid,serial#,username,sql_id,schemaname,osuser,process,machine,port,program,type,paddr
from v$session
where PADDR = (select ADDR from V$PROCESS where SPID = 'YOURPID')

or:
SELECT instance_number, max(value) AS max_sessions, begin_interval_time AS time
FROM dba_hist_sysmetric_summary
WHERE metric_name = 'Session Count'
  AND begin_interval_time >= '<your_date_time>'
  AND begin_interval_time < '<your_date_time + 1 day>'  -- Include the full day
GROUP BY instance_number, begin_interval_time
ORDER BY max_sessions DESC;

How can I the date/time in them?

Regards.

Reply | Threaded
Open this post in threaded view
|

Re: session and process

ErmanArslansOracleBlog
Administrator
Use DBA_HIST_ACTIVE_SESSION_HISTORY and  V$SESSION. Build your query against these..

If you try to find whether or not you are approaching the limits (like process limit) at any time , you can also use v$resource_limit and dba_hist_resource_limit.
big
Reply | Threaded
Open this post in threaded view
|

Re: session and process

big
Thank you.