대기 이벤트 = System API Call


SQL*Net messate from client

오라클 서버 프로세스가 사용자에게 결과를 전송하고 다음 Fetch Call이 올때까지 대기한 시간을 더한 값

서버로부터 데이터를 Fetch하고 클라이언트 내부적으로 많은 연산을 수행한 후에 다음 Fetch Call을 날리는 배치 프로그램에서 크게 나타남

SQL*Net message from client 대기는 Network 성능과는 직접적인 관련이 없다



SQL*Net messate to client

Server Process가 OS에서 Network Send API 요청을 하고 응답이 오기를 기다린다는 것을 의미

OS는 Server Process가 요청한 Data를 TCP Send Buffer에 넣는 것으로 일을 마치고 Server Process에게 응답을 보낸다. 즉, SQL*Net message to client 대기는 실제 Network 전송이 끝나기를 기다린다는 의미가 아니라 OS가 Send Buffer에 성공적으로 Data를 등록하기를 기다린다는 것을 의미한다



db file sequential read

Single Block Read 방식으로 디스크 블록을 읽을때 발생



SQL*Net more data to client

클라이언트에게 전송할 데이터가 남았는데 네트워크 부하때문에 바로 전송하지 못할때 발생

"more" 수식어가 붙는 경우에는 Data의 전송량이 커서 한번에 전송하지 않고 여러 번에 나누어서 한다는 것을 의미합니다. more가 붙은 경우에는 message가 아닌 "data"라는 용어가 사용된다는 것에 주의하세요. 가령 아주 긴 SQL 문장을 Oracle에 수행요청하는 경우 Oracle은 OS에 전송 요청을 하면 응답이 올 때까지 SQL*Net more data from client 이벤트를 대기합니다. 거꾸로 아주 큰 Data를 Client에게 보내주어야 하는 경우(LOB이 대표적인 경우) Oracle은 SQL*Net more data to client 이벤트를 대기합니다. 




오라클 성능고도화

블로그 이미지

마스터오라클

오라클 성능 튜닝에 관해 STUDY한 자료를 정리하는 블로그입니다.

,

TKPROF 사용 기본

튜닝 2016. 12. 22. 08:57

1. pktrof 위치 (ex:로컬 오라클 11 Express Edition)

D:\oraclexe\app\oracle\product\11.2.0\server\bin



2. 트레이스 파일 위치는 아래와 쿼리로 확인

select r.value || '/' || lower(t.instance_name) || '_ora_'  

    || ltrim(to_char(p.spid)) || '.trc' trace_file          

from   v$process p, v$session s, v$parameter r, v$instance t

where  p.addr = s.paddr                                     

and    r.name = 'user_dump_dest'                            

and    s.sid = (select sid from v$mystat where rownum = 1) ;



3. 파일명을 찾기 쉽게 변환하기 위해 세션에 자기만의 tracefile 명칭 심기

alter session set tracefile_identifier='funora';



4.자기 세션에 trace 실행 및 쿼리 실행

alter SESSION SET SQL_TRACE = TRUE;

SELECT  DEPTNO, JOB, SUM(SAL)

FROM    EMP

GROUP BY DEPTNO, JOB

UNION ALL

SELECT  DEPTNO, NULL JOB, SUM(SAL)

FROM    EMP

GROUP BY DEPTNO, NULL

ORDER BY DEPTNO, JOB;

alter SESSION SET SQL_TRACE = FALSE;



5.tkprof를 이용해 변환

tkprof 파일명 변환할파일명

ex) tkprof xe_ora_17552_funora.trc  report.prf sys=no



6.메모장등으로 report.prf 를 열기

친절하게도 상단에 각 항목의 설명이 나와있다.

********************************************************************************

count    = number of times OCI procedure was executed

cpu      = cpu time in seconds executing 

elapsed  = elapsed time in seconds executing

disk     = number of physical reads of buffers from disk

query    = number of buffers gotten for consistent read

current  = number of buffers gotten in current mode (usually for update)

rows     = number of rows processed by the fetch or execute call

********************************************************************************


SELECT  DEPTNO, JOB, SUM(SAL)

FROM    EMP

GROUP BY DEPTNO, JOB

UNION ALL

SELECT  DEPTNO, NULL JOB, SUM(SAL)

FROM    EMP

GROUP BY DEPTNO, NULL

ORDER BY DEPTNO, JOB


call     count       cpu    elapsed       disk      query    current     rows

------- ------  -------- ---------- ---------- ---------- ----------  ----------

Parse        1      0.00       0.00          0          0          0           0

Execute     1      0.00       0.00          0          0          0           0

Fetch        1      0.00       0.00          0         12          0          12

------- ------  -------- ---------- ---------- ---------- ----------  ----------

total         3      0.00       0.00          0         12          0          12


Misses in library cache during parse: 0

Optimizer mode: ALL_ROWS

Parsing user id: 48  

Number of plan statistics captured: 1


Rows (1st) Rows (avg) Rows (max)  Row Source Operation

---------- ---------- ----------  ---------------------------------------------------

   12   12   12  SORT ORDER BY (cr=12 pr=0 pw=0 time=508 us cost=8 size=186 card=14)

   12   12   12   UNION-ALL  (cr=12 pr=0 pw=0 time=289 us)

    9     9    9       HASH GROUP BY (cr=6 pr=0 pw=0 time=284 us cost=4 size=165 card=11)

   14   14   14        TABLE ACCESS FULL EMP (cr=6 pr=0 pw=0 time=42 us cost=3 size=210 card=14)

    3     3     3      HASH GROUP BY (cr=6 pr=0 pw=0 time=131 us cost=4 size=21 card=3)

   14   14   14        TABLE ACCESS FULL EMP (cr=6 pr=0 pw=0 time=11 us cost=3 size=98 card=14)


********************************************************************************


CR : Consistent Block Read

PR : Disk Block Read

PW : Disk Block Write

TIME : Elapsed Time



오라클 성능고도화


블로그 이미지

마스터오라클

오라클 성능 튜닝에 관해 STUDY한 자료를 정리하는 블로그입니다.

,

select r.value || '/' || lower(t.instance_name) || '_ora_'  

    || ltrim(to_char(p.spid)) || '.trc' trace_file          

from   v$process p, v$session s, v$parameter r, v$instance t

where  p.addr = s.paddr                                     

and    r.name = 'user_dump_dest'                            

and    s.sid = (select sid from v$mystat where rownum = 1) ;

블로그 이미지

마스터오라클

오라클 성능 튜닝에 관해 STUDY한 자료를 정리하는 블로그입니다.

,