sample_time分组活动会话趋势

2024年 7月 13日 35.3k 0

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;

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论