 scott@MWDB> create table t ( x int );  表已創建。
scott@MWDB> create table t ( x int );  表已創建。 scott@MWDB> create or replace PRocedure proc1
scott@MWDB> create or replace PRocedure proc1 2 as
2 as 3 begin
3 begin 4 for i in 1 .. 10000
4 for i in 1 .. 10000 5 loop
5 loop 6 execute immediate
6 execute immediate 7 'insert into t values ( :x )' using i;
7 'insert into t values ( :x )' using i; 8 end loop;
8 end loop; 9 end;
9 end; 10 /  過程已創建。
10 /  過程已創建。 scott@MWDB> create or replace procedure proc2
scott@MWDB> create or replace procedure proc2 2 as
2 as 3 begin
3 begin 4 for i in 1 .. 10000
4 for i in 1 .. 10000 5 loop
5 loop 6 execute immediate
6 execute immediate 7 'insert into t values ( 'i')';
7 'insert into t values ( 'i')'; 8 end loop;
8 end loop; 9 end;
9 end; 10 /
10 / exec runstats_pkg.rs_start
exec runstats_pkg.rs_start exec proc1
exec proc1 exec runstats_pkg.rs_middle
exec runstats_pkg.rs_middle exec proc2
exec proc2 exec runstats_pkg.rs_stop(1000)  測試結果:
exec runstats_pkg.rs_stop(1000)  測試結果: Run1 ran in 180 hsecs
Run1 ran in 180 hsecs Run2 ran in 764 hsecs
Run2 ran in 764 hsecs run 1 ran in 23.56% of the time
run 1 ran in 23.56% of the time
 Name Run1 Run2 Diff
Name Run1 Run2 Diff STAT...recursive calls 10,124 12,243 2,119
STAT...recursive calls 10,124 12,243 2,119 STAT...redo size 2,316,668 2,310,452 -6,216
STAT...redo size 2,316,668 2,310,452 -6,216 LATCH.cache buffers chains 73,789 81,264 7,475
LATCH.cache buffers chains 73,789 81,264 7,475 STAT...parse count (hard) 2 10,014 10,012
STAT...parse count (hard) 2 10,014 10,012 LATCH.library cache pin 80,200 95,846 15,646
LATCH.library cache pin 80,200 95,846 15,646 LATCH.library cache pin alloca 40,113 62,894 22,781
LATCH.library cache pin alloca 40,113 62,894 22,781 LATCH.session allocation 24 31,209 31,185
LATCH.session allocation 24 31,209 31,185 LATCH.row cache enqueue latch 112 41,612 41,500
LATCH.row cache enqueue latch 112 41,612 41,500 LATCH.row cache objects 128 41,774 41,646
LATCH.row cache objects 128 41,774 41,646 LATCH.child cursor hash table 18 70,980 70,962
LATCH.child cursor hash table 18 70,980 70,962 LATCH.library cache 110,365 239,250 128,885
LATCH.library cache 110,365 239,250 128,885 STAT...session pga memory 0 131,072 131,072
STAT...session pga memory 0 131,072 131,072 LATCH.shared pool 50,234 259,418 209,184
LATCH.shared pool 50,234 259,418 209,184
 Run1 latches total versus runs -- difference and pct
Run1 latches total versus runs -- difference and pct Run1 Run2 Diff Pct
Run1 Run2 Diff Pct 366,906 938,493 571,587 39.10%
366,906 938,493 571,587 39.10%新聞熱點
疑難解答