EVENT# EVENT_ID NAME PARAMETER1 PARAMETER2 PARAMETER3 WAIT_CLASS
------- ----------- ------------------------------- ------------ --------------- ------------ ------------
58 2779959231 latch: cache buffers chains address number tries Concurrency
64 2161531084 buffer busy waits file# block# class# Concurrency
65 1478861578 gc buffer busy file# block# id# Cluster
72 143262751 enq: RO - fast object reuse name|mode 2 0 Application
105 3999721902 log file parallel write files blocks requests System I/O
115 2652584166 db file sequential read file# block# blocks User I/O
116 506183215 db file scattered read file# block# blocks User I/O
120 3905407295 gc current request file# block# id# Cluster
161 3926164927 direct path read file number first dba block cnt User I/O
183 310662678 enq: TX - row lock contention name|mode usn<<16 | slot sequence Application
SQL> SELECT EVENT
, WAIT_CLASS
, ROUND(TIME_WAITED_MICRO/10000) WAIT_TIME
FROM V$SYSTEM_EVENT
ORDER BY 3 DESC;
EVENT WAIT_CLASS WAIT_TIME
-------------------- ------------- -----------
rdbms ipc message Idle 8715943
pmon timer Idle 989758
smon timer Idle 921911
SQL*Net message from Idle 242761
Streams AQ: waiting Idle 81265
jobq slave wait Idle 77948
PX Idle Wait Idle 64566
db file sequential r User I/O 13862
class slave wait Idle 5275
os thread startup Concurrency 1449
PX Deq: Par Recov Ex Idle 738
SQL> SELECT EVENT
, WAIT_CLASS
, ROUND(TIME_WAITED_MICRO/10000) WAIT_TIME
, TOTAL_WAITS,TOTAL_TIMEOUTS,TIME_WAITED
FROM V$SESSION_EVENT
ORDER BY 3 DESC;
EVENT WAIT_CLASS WAIT_TIME TOTAL_WAITS TOTAL_TIMEO TIME_WAITED
-------------------- ---------- ----------- ----------- ----------- -----------
rdbms ipc message Idle 966184 3230 3224 966184
pmon timer Idle 966068 3261 3258 966068
rdbms ipc message Idle 966062 9616 9614 966062
smon timer Idle 891922 74 29 891922
rdbms ipc message Idle 805076 10 8 805076
SQL*Net message from Idle 218885 325 0 218885
Streams AQ: waiting Idle 81265 2 2 81265
db file sequential r User I/O 7019 2987 0 7019
db file sequential r User I/O 1176 292 0 1176
events in waitclass Other 1024 3 1 1024
SQL> SELECT *
FROM V$EVENT_HISTOGRAM
WHERE EVENT# = 116;
EVENT# EVENT WAIT_TIME_M WAIT_COUNT
----------- ------------------------ ----------- -----------
116 db file sequential read 1 31521650
116 db file sequential read 2 530788
116 db file sequential read 4 1340789
116 db file sequential read 8 1733350
116 db file sequential read 16 166426
116 db file sequential read 32 45824
116 db file sequential read 64 12965
116 db file sequential read 128 1077
116 db file sequential read 256 343
116 db file sequential read 512 53
116 db file sequential read 1024 20
116 db file sequential read 2048 0
116 db file sequential read 4096 0
116 db file sequential read 8192 1
SQL Trace는 SQL튜닝 뿐만 아니라 대기현상을 분석하는데 있어서도 대단히 유용함.
오라클 초기에 제공한 SQL Trace의 기능에 비해 최근에 상당히 확장되어 Extended SQL로 칭함.
SQL Trace는 기본적으로 10046 진단이벤트를 통해 활성화됨
레벨 | 설명 |
1 | SQL문장의 실행정보만을 제공 |
4 | LEVEL 1+ 바인드 변수 값을 제공한다. (원본trc파일을 확인해야함) |
8 | LEVEL 1+대기이벤트정보를 제공한다. (원본trc파일을 확인해야함) |
12 | LEVEL1 + LEVEL4 + LEVEL8 모든 정보를 제공한다. |
1) 현재 세션에서 작업하고자 하는 경우
시작 시 : alter session set events '10046 trace name context forever, level 12';
종료 시 : alter session set events '10046 trace name contet off';
2) 다른 세션에 대해 Trace를 수행하는 경우
? Dbms_system
-- 특정 세션에 'TIMED_STATISTICS' 초기화파라미터 적용(boolean값 적용 시)
exec sys.dbms_system.set_bool_param_in_session
( sid =>
, serial =>
, parname => 'TIMED_STATISTICS'
, bval => true );
-- 특정 세션에 'TIMED_STATISTICS' 초기화파라미터 적용(특정 값 적용 시)
exec sys.dbms_system.set_int_param_in_session
( sid =>
, serial =>
, parname => 'MAX_DUMP_FILE_SIZE'
, intbal => 2147483647 );
-- 특정 세션에 레벨 12의 10046트래이스 실행
exec sys.dbms_system.set_ev(sid, serial#, 10046, 12, '');
? Dbms_monitor : 특정 module, action, service를 기준으로도 수집가능하다.( 10g이상)
? Oradebug
H3. Oradebug와 덤프(dump)
Oradebug는 DBA를 위한 가장 강력한 툴.(반드시 sysdba권한이 필요함)
오라클 디버깅이 목적이나 오라클을 관리하거나 내부 메커니즘을 테스트하는데 도움이 됨.
? Oradebug에 대한 자세한 내용은 http://www.evdbt.com/Oradebug_Modrakovic.pdf참조
woong:SYS >
1 oradebug help
HELP [command] Describe one or all commands
------------ ------------------------------------ ------------------------------
SETMYPID Debug current process
SETOSPID <ospid> Set OS pid of process to debug
SETORAPID <orapid> ['force'] Set Oracle pid of process to debug
SHORT_STACK Dump abridged OS stack
DUMP <dump_name> <lvl> [addr] Invoke named dump
DUMPSGA [bytes] Dump fixed SGA
DUMPLIST Print a list of available dumps
EVENT <text> Set trace event in process
SESSION_EVENT <text> Set trace event in session
DUMPVAR <p|s|uga> <name> [level] Print/dump a fixed PGA/SGA/UGA varia
DUMPTYPE <address> <type> <count> Print/dump an address with type info
SETVAR <p|s|uga> <name> <value> Modify a fixed PGA/SGA/UGA variable