sample_time分组活动会话趋势

sample_time分组活动会话趋势

分钟级别的活动会话分布

set linesize 260 pagesize 1000

alter session set nls_date_format=’yyyy-mm-dd hh24:mi:ss’;

select trunc(sample_time,’mi’),count(*)

          from gv$active_session_history

         where sample_time between

               to_date(‘&date1’, ‘yyyy-mm-dd hh24:mi:ss’) and

               to_date(‘&date2’, ‘yyyy-mm-dd hh24:mi:ss’)

               and inst_id in (select instance_number from v$instance)

         group by trunc(sample_time,’mi’)

         order by trunc(sample_time,’mi’);

 

秒级别的活动会话分布

set linesize 260 pagesize 1000

alter session set nls_date_format=’yyyy-mm-dd hh24:mi:ss’;

select sample_time,sample_id,count(*)

          from gv$active_session_history

         where sample_time between

               to_date(‘&date1’, ‘yyyy-mm-dd hh24:mi:ss’) and

               to_date(‘&date2’, ‘yyyy-mm-dd hh24:mi:ss’)

               and inst_id in (select instance_number from v$instance)

         group by sample_time,sample_id

         order by sample_time,sample_id;

上一篇 【openGauss/MogDB】一种对数据库的列表型参数进行设置的方式
下一篇 Mac App Store 白屏怎么办?这 10 招帮你轻松修复