Database Reference
In-Depth Information
Connection
conn = DriverManager.getConnection
("jdbc:oracle:thin:@heesta:1521:ORA12CR1", "scott","tiger");
conn.setAutoCommit( false );
PreparedStatement pstmt =
conn.prepareStatement
("insert into "+ args[0] + " (x) values(?)" );
for( int i = 0; i < 25000; i++ )
{
pstmt.setInt( 1, i );
pstmt.executeUpdate();
}
conn.commit();
conn.close();
System.out.println( "done" );
}
}
Let's look at the single and dual user Statspack reports, as we did for the no bind variable example. We'll see
dramatic differences here. Here is the single-user report:
Elapsed: 0.07 (mins) Av Act Sess: 0.6
DB time: 0.04 (mins) DB CPU: 0.03 (mins)
Cache Sizes Begin End
~~~~~~~~~~~ ---------- ----------
Buffer Cache: 2,656M Std Block Size: 8K
Shared Pool: 640M Log Buffer: 14,808K
Load Profile Per Second Per Transaction Per Exec Per Call
~~~~~~~~~~~~ ------------------ ----------------- ----------- -----------
...
Parses: 158.5 317.0
Hard parses: 29.8 59.5
...
Instance Efficiency Indicators
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffer Nowait %: 100.00 Redo NoWait %: 100.00
Buffer Hit %: 98.99 Optimal W/A Exec %: 100.00
Library Hit %: 96.14 Soft Parse %: 81.23
Execute to Parse %: 97.72 Latch Hit %: 100.00
Parse CPU to Parse Elapsd %: 87.10 % Non-Parse CPU: 71.58
...
Top 5 Timed Events Avg %Total
~~~~~~~~~~~~~~~~~~ wait Call
Event Waits Time (s) (ms) Time
----------------------------------------- ------------ ----------- ------ ------
AQPC idle 1 30 30004 66.6
lreg timer 2 6 3004 13.3
heartbeat redo informer 4 4 1006 8.9
LGWR worker group idle 12 4 331 8.8
CPU time 1 2.1
Search WWH ::




Custom Search