GSI

-- 최초 입력 데이터
idx         hostName                                           value       regDate                 flag
----------- -------------------------------------------------- ----------- ----------------------- ----
15934       P6901756001C                                       4           2009-02-19 16:25:36.150 0
15935       P6901756001C                                       5           2009-02-19 16:25:46.150 0
15936       P6901756001C                                       1           2009-02-19 16:25:56.167 0
15937       P6901756001C                                       3           2009-02-19 16:26:06.150 0
15938       P6901756001C                                       3           2009-02-19 16:26:16.150 0
15939       P6901756001C                                       3           2009-02-19 16:26:26.150 0
15940       P6901756001C                                       2           2009-02-19 16:26:36.150 0
15941       P6901756001C                                       2           2009-02-19 16:26:46.150 0
15942       P6901756001C                                       1           2009-02-19 16:26:56.150 0
15943       P6901756001C                                       2           2009-02-19 16:27:06.150 0
15944       P6901756001C                                       1           2009-02-19 16:27:16.150 0

-- 변경후 데이터
idx         hostName                                           value       valueSum    valueCount  regDate                 flag
----------- -------------------------------------------------- ----------- ----------- ----------- ----------------------- ----
5           P6901756001C                                       0           50          20          2009-02-19 15:45:00.000 0
6           P6901756001C                                       0           99          30          2009-02-19 15:50:00.000 0
7           P6901756001C                                       0           97          30          2009-02-19 15:55:00.000 0
8           P6901756001C                                       0           287         30          2009-02-19 16:00:00.000 0
9           P6901756001C                                       0           218         30          2009-02-19 16:05:00.000 0
10          P6901756001C                                       0           362         30          2009-02-19 16:10:00.000 0
11          P6901756001C                                       0           131         30          2009-02-19 16:15:00.000 0
12          P6901756001C                                       0           163         30          2009-02-19 16:20:00.000 0
13          P6901756001C                                       0           23          3           2009-02-19 16:25:00.000 0

-- 구성 내용
10초에 한번씩 입력 되는 해당 데이터의 내용을 5분 단위로 끊어서 새로운 테이블로 통계를 낸다.
값이 일정하지도 않을수 있고, 값의 주기가 조금씩 틀릴수도 있다.
우선 테스트를 통해서 더 보완 해야 할듯 하다. (커서를 몰라서 이렇게 걍 작성 했다.)

-- 배울점
1. 시간 값의 구간을 5분 단위로 구분

Posted by gsi
: