sql을 분석하기 위해 trace file을 생성하여 그 결과를 보고 분석할 수가 있다.
이 tracefile은 user_dump_dest에 지정된 디렉토리에 생성되게 되어있다.
그런데 만약 여러 유저가 trace file을 생성한다면 내것이 무엇인지 찾지 못할 것이다.
내것이 무엇인지 확인하려면 어떻게 해야할까?
일단 현재 user_dump_dest에 있는 파일을 보자.
# ls -lrt
total 66
-rw-r--r-- 1 dba02 dba 140 Apr 13 09:42 afiedt.buf
-rw-r--r-- 1 dba02 dba 238 Apr 15 09:30 t.sql
-rw-r----- 1 oracle dba 21427 Apr 15 09:50 dba02_ora_21033.trc
-rw-r----- 1 oracle dba 2975 Apr 15 09:51 dba02_ora_21646.trc
-rw-r--r-- 1 dba02 dba 6623 Apr 15 09:51 tuning.txt
dba02_ora_21646.trc
맨뒤에 있는 숫자가 process의 id이다.
그러면 process id는 어떻게 찾을까?
SQL> select p.spid
2 from v$process p, v$session s
3 where p.addr = s.paddr
4 and s.audsid = userenv('SESSIONID');
SPID
------------
21646
참 쉽죠?
'Oracle > Tuning' 카테고리의 다른 글
cursor_sharing (0) | 2011.05.09 |
---|---|
LOCK 관련 실습 (1) | 2010.01.25 |
LRU 알고리즘 (0) | 2010.01.19 |
Tuning the Buffer Cache (0) | 2010.01.18 |
Tuning the Shared Pool (1) | 2010.01.16 |