* Paralle 수행을 위한 환경 체크
sys@ARTDOM>show parameters job_queue_processes
NAME_COL_PLUS_SHOW_PARAM TYPE VALUE_COL_PLUS_SHOW_PARAM
\-----------------------------\- \----------\- \-----------------------------\-
job_queue_processes integer 10
* Tablespace 생성
sys@ARTDOM>create tablespace manual ;
Tablespace created.
* Table 생성 \[ Freelists 1 로 생성 \]
sys@ARTDOM>create table t ( x date, y char(255) default 'x' )
2 storage ( freelists &1 )
3 tablespace manual ;
Enter value for 1: 1
old 2: storage ( freelists &1 )
new 2: storage ( freelists 1 )
Table created.
* Parallel Insert Procedure 작성 \[ do_insert \]
sys@ARTDOM>create or replace procedure do_insert
as
l_stop date default sysdate+5/24/60 ;
l_date date default sysdate;
begin
while ( l_date < l_stop )
loop
insert into t ( x )
values ( sysdate )
returning x into l_date ;
commit ;
end loop ;
end ;
/
Procedure created.
* Table Count Check
sys@ARTDOM>select count( * ) from t ;
0
* 성능 Snap 작성
perfstat@ARTDOM>exec perfstat.statspack.snap
* PCT_FREE, PCT_USED, FREELISTS 체크
select TABLE_NAME,TABLESPACE_NAME,PCT_FREE,PCT_USED,FREELISTS
from dba_tables where table_name ='T';
T MANUAL 10 40 1
* Insert 작업 수행
sys@ARTDOM>declare
l_job number ;
begin
for i in 1..5
loop
dbms_job.submit(l_job, 'do_insert;');
end loop ;
commit ;
end ;
/
PL/SQL procedure successfully completed.
sys@ARTDOM>host sleep 400
* 성능 Snap 작성
sys@ARTDOM>exec perfstat.statspack.snap ;
PL/SQL procedure successfully completed.
* 성능 Report 작성
sys@ARTDOM>@/app/oracle/product/10.1.0/rdbms/admin/spreport.sql
* FREELISTS 5 Table 생성 후 테스트 진행
sys@ARTDOM>drop table t ;
Table dropped.
sys@ARTDOM>create table t ( x date, y char(255) default 'x')
storage ( freelists &1 )
tablespace manual ;
Enter value for 1: 5
Table created.
* 성능 Snap 작성
sys@ARTDOM>exec perfstat.statspack.snap ;
PL/SQL procedure successfully completed.
sys@ARTDOM>declare
l_job number ;
begin
for i in 1..5
loop
dbms_job.submit(l_job, 'do_insert;');
end loop ;
commit ;
end ;
/
PL/SQL procedure successfully completed.
* 성능 Snap 작성
sys@ARTDOM>host sleep 400
sys@ARTDOM>exec perfstat.statspack.snap ;
PL/SQL procedure successfully completed.
* 성능 Report 작성
sys@ARTDOM>@/app/oracle/product/10.1.0/rdbms/admin/spreport.sql
* FREELIST GROUP 에 대한 테스트
* FREELIST GROUPS 을 1로 생성
sys@ARTDOM>create table t ( x date, y char(255) default 'x')
2 storage ( freelists 5 FREELIST GROUPS 1 )
3 tablespace manual ;
Table created.
sys@ARTDOM>exec perfstat.statspack.snap
PL/SQL procedure successfully completed.
sys@ARTDOM>declare
2 l_job number ;
3 begin
4 for i in 1..10
5 loop dbms_job.submit ( l_job, 'do_insert;');
6 end loop ;
7 commit ;
8 end ;
9 /
PL/SQL procedure successfully completed.
sys@ARTDOM>host sleep 400
sys@ARTDOM>exec perfstat.statspack.snap ;
PL/SQL procedure successfully completed.
sys@ARTDOM>@/app/oracle/product/10.1.0/rdbms/admin/spreport.sql
* FREELIST GROUPS 을 5로 생성
sys@ARTDOM>drop table t ;
Table dropped.
sys@ARTDOM>create table t ( x date, y char(255) default 'x')
2 storage ( freelists 5 FREELIST GROUPS 5 )
3 tablespace manual ;
Table created.
sys@ARTDOM>exec perfstat.statspack.snap
PL/SQL procedure successfully completed.
sys@ARTDOM>declare
l_job number ;
begin
for i in 1..10
loop dbms_job.submit ( l_job, 'do_insert;');
end loop ;
commit ;
end ;
/
PL/SQL procedure successfully completed.
sys@ARTDOM>host sleep 400
sys@ARTDOM>exec perfstat.statspack.snap
PL/SQL procedure successfully completed.
sys@ARTDOM>@/app/oracle/product/10.1.0/rdbms/admin/spreport.sql
* SEGMENT SPACE MANAGEMENT AUTO VS SEGMENT SPACE MANAGEMENT MANUAL
sys@ARTDOM>create tablespace auto_tbs datafile
size 64M autoextend on next 8m extent management local autoallocate
segment space management auto ;
Tablespace created.
sys@ARTDOM>create tablespace manual_tbs datafile
size 64m autoextend on next 8m extent management local autoallocate
segment space management manual ;
Tablespace created.
* SEGMENT SPACE MANAGEMENT AUTO TBS 에 TABLE 생성 후 INSERT 진행
sys@ARTDOM>create table t ( x date, y char(255) default 'x')
tablespace auto_tbs ;
Table created.
sys@ARTDOM>exec perfstat.statspack.snap ;
PL/SQL procedure successfully completed.
sys@ARTDOM>declare
l_job number ;
begin for i in 1..10
loop dbms_job.submit(l_job,'do_insert;');
end loop ;
commit ;
end ;
/
PL/SQL procedure successfully completed.
sys@ARTDOM>host sleep 400
sys@ARTDOM>exec perfstat.statspack.snap ;
PL/SQL procedure successfully completed.
sys@ARTDOM> @/app/oracle/product/10.1.0/rdbms/admin/spreport.sql
* SEGMENT SPACE MANAGEMENT MANUAL TBS 에 TABLE 생성 후 INSERT 진행
sys@ARTDOM>create table t ( x date, y char(255) default 'x')
tablespace auto_tbs ;
Table created.
sys@ARTDOM>exec perfstat.statspack.snap ;
PL/SQL procedure successfully completed.
sys@ARTDOM>declare
l_job number ;
begin for i in 1..10
loop dbms_job.submit(l_job,'do_insert;');
end loop ;
commit ;
end ;
/
PL/SQL procedure successfully completed.
sys@ARTDOM>host sleep 400
sys@ARTDOM>exec perfstat.statspack.snap ;
PL/SQL procedure successfully completed.
sys@ARTDOM> @/app/oracle/product/10.1.0/rdbms/admin/spreport.sql
이 결과에서 가장 흥미로운 이벤트는 버퍼 사용중 대기이다. 이와 같이 삽입이
비번하게 발생하는 경우에는 사용 가능 목록 경합에 의해 대기가 발생한다.
ASSM을 사용하면 이와 같이 대기가 획기적으로 줄어든다.
Buffer busy wait : 820,283 ==> 18,614
Transaction : 4,638.16 ==> 6,625.10
- 강좌 URL : http://www.gurubee.net/lecture/3544
- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.