--orasrp_temp.sql
declare
v_cnt number;
begin
for idx in 1 .. 10000 loop
execute immediate
'select count(*) from user_objects where ' || mod(idx,100) ||' = ' ||mod(idx,10) into v_cnt;
end loop;
end;
/
ho sqlplus system/manager @orasrp_temp &
ho sqlplus system/manager @orasrp_temp &
ho sqlplus system/manager @orasrp_temp &
ho sqlplus system/manager @orasrp_temp &
ho sqlplus system/manager @orasrp_temp &
-- ho : 임시로 dos 모드로 변경
alter session set events '10046 trace name context forever , level 8';
@orasrp_temp
alter session set events '10046 trace name context off';
@trace_file -- 현재세션의 트레이스 파일 확인
select r.value || case when d.platform_name like 'M%' then'\'else '/' END||
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, v$database d
where p.addr =s.paddr
and r.name ='user_dump_dest'
and s.sid =(select sid from v$mystat where rownum = 1) ;
TRACE_FILE
--------------------------------------------------------------------------------
/oracle/app/oracle/admin/SCTEST/udump/sctest_ora_26959.trc
[oracle@sctest orasrp]$ ./orasrp -h
usage: orasrp [options] trcfile [outfile]
options:
-h, --help show this help message and exit
--version show program's version number and exit
-t, --text output in text format
--aggregate=YES/no aggregate similar statements
-bn, --binds=n how many unique bind-sets to display (1 by defaut)
-c, --config specify config file
--maxbinds=n how many unique bind-sets to analyze (all by default)
--recognize-idle-events=YES/no
recognize or not idle wait events
--sys=YES/no print sys statements
--sort how to sort statements in output (values like in tkprof)
-s, --server run httpd mode
-p, --port listen on alternate port (in httpd mode)
-r, --remote connect to remote machine:port
--display-sections what sections of report to display (all by default)
--skip-sections what sections of report to skip
--sessionid analyze data only for the specified session id
--threshold omit statements which spend less than threshold % from total time (not used by defaut)
--google-charts display charts using Google Chart API
SQL> ho ./orasrp --sys=no &trace_file orasrp.html
Enter value for trace_file: /oracle/app/oracle/admin/SCTEST/udump/sctest_ora_26959.trc
- 강좌 URL : http://www.gurubee.net/lecture/4318
- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.