Loop
for i in 1 .. 2000
loop
try to get latch
if got latch, return
if i = 1 then misses = misses+1
end loop
INCREMENT WAIT COUNT
sleep
Add WAIT TIME
End loop;
SQL> begin
2 for i in .. 10
3 loop
4 for x in (select * from user_tables where table_name = 'T'||i )
5 loop
6 execute immediate 'drop table ' || x.table_name;
7 end loop;
8 execute immediate 'create table t' || i || '(x int)';
9 end loop;
10 end;
11 /
PL/SQL procedure successfully completed.
import java.sql.*;
public class instest
{
static public void main(String args[]) throws Exception
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection
conn = DriverManager.getConnection
("jdbc:oracle:thin:@dellpe:1521:ora10gr1",
"scott","tiger");
conn.setAutoCommit( false );
Statement stmt = conn.createStatement();
for( int i = 0; i < 25000; i++ )
{
stmt.execute
("insert into "+ args[0] +
" (x) values(" + i + ")" );
}
conn.commit();
conn.close();
}
}
Elapsed: 0.52 (mins)
Cache Sizes (end)
~~~~~~~~~~~~~~~~~
Buffer Cache: 768M Std Block Size: 8K
Shared Pool Size: 244M Log Buffer: 1,024K
Load Profile
~~~~~~~~~~~~ Per Second Per Transaction
--------------- ---------------
...
Parses: 810.58 12,564.00
Hard parses: 807.16 12,511.00
....
Top 5 Timed Events
~~~~~~~~~~~~~~~~~~ % Total
Event Waits Time (s) Call Time
-------------------------------------------- ------------ ----------- ---------
CPU time 26 55.15
class slave wait 2 10 21.33
Queue Monitor Task Wait 2 10 21.33
log file parallel write 48 1 1.35
control file parallel write 14 0 .51
Elapsed: 0.78 (mins)
Load Profile
~~~~~~~~~~~~ Per Second Per Transaction
--------------- ---------------
Parses: 1,066.62 16,710.33
Hard parses: 1,064.28 16,673.67
Top 5 Timed Events
~~~~~~~~~~~~~~~~~~ % Total
Event Waits Time (s) Call Time
-------------------------------------------- ------------ ----------- ---------
CPU time 74 97.53
log file parallel write 53 1 1.27
latch: shared pool 406 1 .66
control file parallel write 21 0 .45
log file sync 6 0 .04
Latch Name Requests Misses Sleeps Sleeps 1->3+
---------------- ------------- ----------- -------- ------------
shared pool 1,126,006 229,537 406 229135/398/4/0
library cache 1,108,039 45,582 7 45575/7/0/0
import java.sql.*;
public class instest
{
static public void main(String args[]) throws Exception
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection
conn = DriverManager.getConnection
("jdbc:oracle:thin:@dellpe:1521:ora10gr1",
"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();
}
}
Elapsed: 0.12 (mins)
Load Profile
~~~~~~~~~~~~ Per Second Per Transaction
--------------- ---------------
...
Parses: 8.43 29.50
Hard parses: 0.14 0.50
Top 5 Timed Events
~~~~~~~~~~~~~~~~~~ % Total
Event Waits Time (s) Call Time
-------------------------------------------- ------------ ----------- ---------
CPU time 4 86.86
log file parallel write 49 0 10.51
control file parallel write 4 0 2.26
log file sync 4 0 .23
control file sequential read 542 0 .14
Elapsed: 0.20 (mins)
Load Profile
~~~~~~~~~~~~ Per Second Per Transaction
--------------- ---------------
Parses: 6.58 26.33
Hard parses: 0.17 0.67
Top 5 Timed Events
~~~~~~~~~~~~~~~~~~ % Total
Event Waits Time (s) Call Time
-------------------------------------------- ------------ ----------- ---------
CPU time 11 89.11
log file parallel write 48 1 9.70
control file parallel write 4 0 .88
log file sync 5 0 .23
log buffer space 2 0 .05
- 강좌 URL : http://www.gurubee.net/lecture/4407
- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.