Where can I find data to plot a graph of Number of active sessions in a day

skarangi
SQL-Fighter

Hi,

 

I want to generate a graph with X  axis as time in a day ( at a granularity of second) and y axis as active sessions at that moment. Can you please tell me which table data I can use to do that?  

 

Regards,
Sreekanth

1 ACCEPTED SOLUTION

Accepted Solutions

mwellbro
Xpert

Hi @skarangi ,

when I do something like that I generate a custom list of timestamps in a WITH block with the required granularity ( seconds in your case ) and "slice" against exa_dba_audit_sql 
" WHERE MY_TIMESTAMP BETWEEN START_TIME AND STOP_TIME ".

If you have auditing enabled that´s what I´d do.

You´ll need to use ALTER SESSION SET TIMESTAMP_ARITHMETIC_BEHAVIOR = 'DOUBLE' ; in order to produce your timestamps in the following fashion:

ALTER SESSION SET TIMESTAMP_ARITHMETIC_BEHAVIOR = 'DOUBLE' ;

select CURRENT_TIMESTAMP + ( ( 1/24/60/60 ) * level) from dual connect by level<=600;


Cheers,
Malte

View solution in original post

1 REPLY 1

mwellbro
Xpert

Hi @skarangi ,

when I do something like that I generate a custom list of timestamps in a WITH block with the required granularity ( seconds in your case ) and "slice" against exa_dba_audit_sql 
" WHERE MY_TIMESTAMP BETWEEN START_TIME AND STOP_TIME ".

If you have auditing enabled that´s what I´d do.

You´ll need to use ALTER SESSION SET TIMESTAMP_ARITHMETIC_BEHAVIOR = 'DOUBLE' ; in order to produce your timestamps in the following fashion:

ALTER SESSION SET TIMESTAMP_ARITHMETIC_BEHAVIOR = 'DOUBLE' ;

select CURRENT_TIMESTAMP + ( ( 1/24/60/60 ) * level) from dual connect by level<=600;


Cheers,
Malte

View solution in original post