05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

224<br />

CHAPTER 6 ■ LOCKING AND LATCHING<br />

}<br />

}<br />

conn = DriverManager.getConnection<br />

("jdbc:oracle:thin:@dellpe:1521:ora10gr1",<br />

"scott","tiger");<br />

conn.setAutoCommit( false );<br />

Statement stmt = conn.createStatement();<br />

for( int i = 0; i < 25000; i++ )<br />

{<br />

stmt.execute<br />

("insert into "+ args[0] +<br />

" (x) values(" + i + ")" );<br />

}<br />

conn.commit();<br />

conn.close();<br />

I ran the test in “single user” mode <strong>and</strong> the Statspack report came back with this<br />

information:<br />

Elapsed:<br />

0.52 (mins)<br />

Cache Sizes (end)<br />

~~~~~~~~~~~~~~~~~<br />

Buffer Cache: 768M Std Block Size: 8K<br />

Shared Pool Size: 244M Log Buffer: 1,024K<br />

Load Profile<br />

~~~~~~~~~~~~ Per Second Per Transaction<br />

--------------- ---------------<br />

...<br />

Parses: 810.58 12,564.00<br />

Hard parses: 807.16 12,511.00<br />

....<br />

Top 5 Timed Events<br />

~~~~~~~~~~~~~~~~~~ % Total<br />

Event Waits Time (s) Call Time<br />

-------------------------------------------- ------------ ----------- ---------<br />

CPU time 26 55.15<br />

class slave wait 2 10 21.33<br />

Queue Monitor Task Wait 2 10 21.33<br />

log file parallel write 48 1 1.35<br />

control file parallel write 14 0 .51<br />

I included the SGA configuration for reference, but the relevant statistics are as follows:<br />

• Elapsed time of approximately 30 seconds<br />

• 807 hard parses per second<br />

• 26 CPU seconds used

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!