■ 개요

시스템 통계 수집은 정기적으로 이루어져야 한다.

시스템 통계 수집은 기존 실행계획을 무효화하지 않는다.

 

■ 프로시저

dbms_stats.gather_system_stats: 시스템 통계 수집
dbms_stats.set_system_stats: 명시적으로 직접 설정
dbms_stats.get_system_stats: 시스템 통계 정보를 확인

 

gathering_mode:

- noworkload | interval
- start | stop

 

noworkload: 기본값, 몇분 정도 걸릴 수 있고 DB크기에 따라 다르다.
                    DB와 테이블스페이스 생성 후 gather_system_stats('noworkload')를 실행할 것을 권장한다.
interval: 지정된 간격동안 시스템 작업을 캡쳐한다.

 

start | stop: 시작 정지를 지정할 수 있다. 예를 들어 시작 후 작업을 걸고 stop하여 정확한 통계를 수집할 수 있다.

 

※10gR2부터는 시작 시 시스템 통계 필수 부분이 자동으로 수집된다

 

■ 시스템 통계 수집 예제1

exec dbms_stats.gather_system_stats(interval => 120, stattab => 'mystats',statid => 'OLTP'); --첫째날 낮
exec dbms_stats.gather_system_stats(interval => 120, stattab => 'mystats',statid => 'BATCH'); --첫째날 밤
exec dbms_stats.import_system_stats(stattab='mystats',statid='OLTP'); --낮에는 이 통계를 사용하도록 dictionary에 import
exec dbms_stats.import_system_stats(stattab='mystats',statid='DW'); --밤에는 이 통계를 사용하도록 dictionary에 import

 

※위 작업 전에 먼저 통계용 테이블을 dbms_stats.create_stat_table 을 통해 만들어야 한다.

 

■ 시스템 통계 수집 예제2

exec dbms_stats.gather_system_stats(gathering_mode => 'start');

 

workload 수행

exec dbms_stats.gather_system_stats(gathering_mode => 'stop');

 

위 예제는 해당 워크로드가 수행될 때의 시스템 통계를 수집하는 것이 목적이다.

 

'Knowledge > Perfomance Tuning' 카테고리의 다른 글

수동통계수집(gathering statistics manually)  (0) 2015.12.29
histogram 고려사항  (0) 2015.12.29
자동 통계 수집(automatic statistics gathering)  (0) 2015.12.29
Additional statistics  (0) 2015.12.19
Common wait events  (0) 2015.12.19
Posted by neo-orcl
,

 

 statistics name

description 

recommend action 

 redo log space requests

리두 로그 파일에 공간 확보를 하기 위해 대기한 횟수

tune checkpoint, dbwr, archive process

use bigger log file

consistent changes

consistent read를 위해 롤백된 횟수

Automatic undo management 사용

tune work load

consistent gets

consistent read모드로 읽은 블럭 수

Automatic undo management 사용

tune work load

table fetch by continued row

migration or chained rows

reorganization

 

조회 방법.

 

select name, value from v$sysstat where name like 'redo log space reque%'

union all

select name, value from v$sysstat where name like 'consistent changes%'

union all

select name, value from v$sysstat where name like 'con%'

union all

select name, value from v$sysstat where name like 'table fetch by continuted row';

 

NAME                                                                  VALUE
---------------------------------------------------------------- ----------
redo log space requests                                                 124
consistent changes                                                   930117
concurrency wait time                                                  3854
consistent gets                                                     4241014
consistent gets from cache                                          4191819
consistent gets from cache (fastpath)                               2249943
consistent gets - examination                                       1670409
consistent gets direct                                                49195
consistent changes                                                   930117
Posted by neo-orcl
,

 

대기 이벤트명

영역 

 점검대상

 Buffer busy wait

버퍼캐시, DBWR 

문제 발생시에 v$session_wait 

 Free buffer waits

버퍼캐시, DBWR 

OS통계통한 write speed 검토, 버퍼캐시 통계 

 db file scattered read,

db file sequential read

I/O, SQL튜닝 

v$sqlarea PHYSICAL_READ_REQUESTS, v$filestat readtim

enqueue waits (enq:)

LOCK 

v$enqueue_stat 

library cache waits 

Latch 

v$sqlarea parsing calls, child cursor 

 log buffer space

log buffer, lgwr 

v$sysstat 'redo buffer allocation retries', 디스크성능

 log file sync

over commit, lgwr 

v$sysstat 'user commits'+'user rollbacks', 디스크성능

 

Posted by neo-orcl
,