SQLTRACE SQL n n l PARSING EXECUTE FETCH

  • Slides: 4
Download presentation

SQL_TRACE 실행되는 SQL의 통계자료를 트레이스 파일로 생성 n n l PARSING, EXECUTE, FETCH 별로

SQL_TRACE 실행되는 SQL의 통계자료를 트레이스 파일로 생성 n n l PARSING, EXECUTE, FETCH 별로 구분 l 사용 CPU시간, 추출소요시간 l 물리적(Disk)으로 읽은 블록 수 l 논리적(Memory)으로 읽은 블록 수 l 추출된 row 수 Parameters 지정 l SQL_TRACE TRUE l TIMED_STATISTICS TRUE l USER_DUMP_DEST directory l MAX_DUMP_FILE_SIZE number

tkprof Utility n 트레이스 파일 출력 및 분석 l count 분석 l cpu time

tkprof Utility n 트레이스 파일 출력 및 분석 l count 분석 l cpu time 분석 l elapsed time 분석 l disk i/o : memory i/o 분석 l rows 분석 l library cache miss 분석 0 0 100 l 실행계획 분석 ------- ------ --------- l Overall total 분석 ******************** SELECT * FROM EMP WHERE DEPTNO = 10 ORDER BY JOB call count cpu elapsed disk query current rows ------- ------ ---------Parse Execute Fetch 1 1 100 0. 04 0. 09 2. 54 0. 08 0. 11 2. 71 0 0 22 0 0 12510 0 0 557 Toatl 102 2. 67 2. 90 22 12510 557 Misses in Library cache during parse : 1 Parsing user id = 12 ( scott) Rows Execution Plan -----------------------------------------0 select statement 100 sort (order by) 100 table access by rowid of emp 22560 index range scan of emp_idxq 100 *********************

tkprof Utility 사 용 법 tkprof trace_file list_file [SORT=parameter] [PRINT=number] [insert=ins_file] [record=rec_file] [sys=no] [aggregate=no]

tkprof Utility 사 용 법 tkprof trace_file list_file [SORT=parameter] [PRINT=number] [insert=ins_file] [record=rec_file] [sys=no] [aggregate=no] [explain=username/password] l trace_file : 트레이스파일명 l list_file : 출력파일명 l parameter : 우측 참조 l number : 출력 SQL 수 l username : 사용자 이름 l password : 패스워드 PRSCNT, PRSCPU, PRSELA, PRSDSK, PRSQRY, PRSCU, PRSMIS n EXECNT, EXECPU, EXEELA, EXEDSK, EXEQRY, EXECU, EXEROW n FCHCNT, FCHCPU, FCHELA, FCHDSK, FCHQRY, FCHCU, FCHROW n