经典三列分析工具,适用于很多场景

最近帮一个客户开发了一个小工具,类似于nmon,可以把一段时间分析出来的结果做成多列折线图。这个工具主要是针对三列的,那么什么是经典三列。我在这儿给出的一个定义就是{时间,类型,数字}。只要是符合这三列的数据都可以套用这个小工具。举个例子:{时间,等待事件,数量}。我们通过dba_hist_active_session_history做一个查询,可以得出下列的结果集合。

SQL> select to_char(sample_time,'HH24:MI')||'|'||event||'|'||count(1) from dba_hist_active_sess_history where event is not null group by to_char(sample_time,'HH24:MI'),event order by 3 desc;
15:08|log file sync|448
15:08|db file sequential read|401
15:08|gc buffer busy|171
15:08|db file scattered read|87
15:08|db file parallel read|46
15:08|enq: TX - row lock contention|38
15:08|read by other session|19
15:09|log file sync|455
15:09|db file sequential read|391
15:09|gc buffer busy|141
15:09|db file scattered read|80
15:09|db file parallel read|50
15:09|enq: TX - row lock contention|36
15:09|read by other session|15
15:10|log file sync|462
15:10|db file sequential read|435
15:10|gc buffer busy|158
15:10|db file scattered read|75
15:10|db file parallel read|52
15:10|enq: TX - row lock contention|46
15:10|read by other session|26
15:11|log file sync|482
15:11|db file sequential read|429
15:11|gc buffer busy|156
15:11|db file scattered read|91
15:11|enq: TX - row lock contention|70
15:11|db file parallel read|45
15:11|read by other session|40
15:12|db file sequential read|487
15:12|log file sync|418
15:12|gc buffer busy|156
15:12|db file scattered read|96
15:12|enq: TX - row lock contention|38
15:12|db file parallel read|38
15:12|read by other session|34
15:13|db file sequential read|407
15:13|log file sync|378
15:13|gc buffer busy|129
15:13|db file scattered read|84
15:13|db file parallel read|52
15:13|db file parallel write|41
15:13|enq: TX - row lock contention|36
15:14|log file sync|525
15:14|db file sequential read|410
15:14|gc buffer busy|160
15:14|db file scattered read|88
15:14|db file parallel read|53
15:14|enq: TX - row lock contention|36
15:14|db file parallel write|30
15:15|log file sync|522
15:15|db file sequential read|437
15:15|gc buffer busy|155
15:15|db file scattered read|120
15:15|enq: TX - row lock contention|36
15:15|db file parallel read|35
15:15|db file parallel write|29
15:16|log file sync|564
15:16|db file sequential read|393
15:16|gc buffer busy|202
15:16|db file scattered read|87
15:16|db file parallel read|40
15:16|enq: TX - row lock contention|36
15:16|db file parallel write|28
15:17|db file sequential read|349
15:17|log file sync|301
15:17|log file switch completion|169
15:17|gc buffer busy|163
15:17|db file scattered read|73
15:17|buffer busy waits|47
15:17|db file parallel read|31

然后通过我的工具点加载按钮就可以得到下面这张图,是不是很简单呢?

当然这只是他其中的一种用法,我们还可以使用它来分析表空间的增长趋势,大表的增长趋势等等。对于业务数据,我们也是可以使用的,比如一年内各种产品的销售数据。只要是经典三列,都是可以的。

 

分享到: 更多

Post a Comment

Your email is never published nor shared. Required fields are marked *