[Oracle] 오라클 성능 관리 > AutoTrace
AutoTrace 결과에는 SQL을 튜닝하는데 유용한 정보들이 많이 포함되어 있어 가장 즐겨 사용되는 도구 중 하나다.
쿼리수행결과, 실행계획, 실행통계
- set autotrace on : SQL실제수행 + 결과 + 실행계획 + 실행통계
- set autotrace on explain : SQL 실제수행 + 결과 + 실행계획
- set autotrace on statistics : SQL실제수행+결과+실행통계
- set autotrace traceonly : SQL 실제수행 + 실행계획 + 실행통계
- set autotrace traceonly explain : 실행계획
- set autotrace traceonly statistics SQL 실제수행 + 실행통계
# 실행통계까지 함께 확인하려면 v_$sesstat, v_$statname, v_$mystat 뷰에 대한 읽기 권한 필요
SQL> @?/sqlplus/admin/plustrce.sql
SQL> grant plustrace to scott;
# statistics 모드로 AutoTrace를 활성화시키면 새로운 세션이 하나 열리면서 현재 세션의 통계정보를 대신 쿼리해서 보여준다.
만약 같은 세션에서 수행한다면 세션통계를 쿼리할 때의 수행통계까지 뒤섞이기 때문에 별도의 세션을 사용하는 것.
AutoTrace 와 SQL Trace - TKProf
* db block gets = current : Current 모드에서 읽은 버퍼 블록 수
* consistent gets = query : Consistent 모드에서 읽은 버퍼 블록 수
* physical reads = disk : 디스크로 부터 읽은 블록 수
* SQL*Net roundtrips to/from client = fetch count
* rows processed = fetch rows
cr = consistent 모드 블록 읽기
pr = 디스크 블록 읽기
pw = 디스크 블록 쓰기
time = 소요시간(us=microsecond)
# alter session set sql_trace = true
트레이스 파일 정보 (. trc)
'개발자' 카테고리의 다른 글
[Java] 예외, Error, Runtimeexception (0) | 2013.02.27 |
---|---|
[Eclipse] plugin – Java Decompiler Plugin (0) | 2013.02.08 |
[Oracle] 오라클 성능 관리 > Explain plan (0) | 2012.02.20 |
[Oracle] Sequential 액세스 선택도 높이기 – 테스트 중… (0) | 2012.02.20 |
[Oracle] 오라클 성능 관리 > Tkprof Interface (SQL Trace) (0) | 2012.02.18 |