select parsing_schema_name
, count(*) sql_cnt
, count(distinct substr(sql_text, 1, 100)) sql_cnt2
, sum(executions) executions
, round(avg(buffer_gets/executions)) buffer_gets
, round(avg(disk_reads/executions)) disk_reads
, round(avg(rows_processed/executions)) rows_processed
, round(avg(elapsed_time/executions/1000000),2) "ELAPSED_TIME(AVG)"
, count(case when elapsed_time/executions/1000000 >= 10 then 1 end) "BAD SQL"
, round(max(elapsed_time/executions/1000000),2) "ELAPSED_TIME(MAX)"
from v$sql
where last_active_time >= sysdate - 7
and executions > 0
group by parsing_schema_name
;
sql_cnt : sql 개수
sql_cnt2 : sql 개수(unique)
executions : 수행횟수
buffer_gets : 논리적 I/O
disk_reads : 디스크 I/O
rows_processed : 처리건수
ELAPSED_TIME(AVG) : 평균처리시간
BAD SQL : 악성 SQL (10초 이상)
ELAPSED_TIME(MAX) : 최대소요시간
* sql_cnt와 sql_cnt2 의 차이가 크다면 하드파싱 부하 심함
* buffer_gets, ELAPSED_TIME 가 큰 항목은 집중 튜닝 대상
--오라클 성능고도화
'튜닝' 카테고리의 다른 글
같은 SQL문장에 여러 Child 커서가 생기는 원인 (0) | 2016.12.27 |
---|---|
데이터 베이스 성능 튜닝 첫번째 라이브러리 캐시 최적화 (0) | 2016.12.27 |
v$system_event (0) | 2016.12.26 |
DBMS_XPLAN 활용 (0) | 2016.12.23 |
DBMS_MONITOR 활용 (특정 세션이나 모듈에 트레이스걸기) (0) | 2016.12.22 |