Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I want to know the view or query which provides the total number of active and non-active session for a specific snapshot. Currently I am using the below query.

SELECT INSTANCE_NUMBER, count(*)*10 "DB Sessions"
FROM DBA_HIST_ACTIVE_SESS_HISTORY
where snap_id = '78131'
GROUP BY INSTANCE_NUMBER;

Any help will be appreciated.

share|improve this question
1  
What is your question? –  a_horse_with_no_name Apr 11 at 7:22
    
I'm fairly sure that DBA_ACTIVE_SESS_HISTORY only stores details of active sessions. It's in the name. –  Andrew Brennan Apr 11 at 10:23
    
I need the total number of sessions, include active and non-active sessions. –  محمد خليل Apr 11 at 10:57
    
If you just want the count then you should (by using a script and a table) sample gv$license as-needed. e.g. "select systimestamp, sessions_current,sessions_highwater from gv$license". Store the output in a table and then use it for whatever purpose. By default Oracle does not track this information in any of HIST tables. –  Raj Apr 11 at 12:35
    
Can i get the info from gv$license snapshot wise. As for the information i am able to get the total number of session by generating AWR report for the period. –  محمد خليل Apr 17 at 6:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.