You are on page 1of 19

Advanced Oracle Document

11gR2 Oracle Database


ASM IDP

Author:

Hyun-Ho, Jung

Site:

http://www.commit.co.kr

Email:

admin@commit.co.kr
cleanto@naver.com

Creation Date:

Advanced Oracle Document

2011 - 08 - 12

ASM IDP Document

Server Information
Items

Description

Test Date

2011 / 08 / 12

Machine

DELL R910

CPU

Intel(R) Xeon(R) CPU

Main Memory

32GB

O/S version

OEL 5.4

Host Name

test

ORACLE_SID

orcl

Oracle version

11.2.0.2

X7550 @ 2.00GHzX 8

Scenario&Environment

1) 11gR2 NF ASM IDP .


2) Grid S/W 11gR2(11.2.0.2) .
3) ASM IDP HOT Cold .

Advanced Oracle Document

ASM IDP

Oracle 11gR2 NF IDP .


ASM IDP(Intelligent Data Placement) , .
ASM ASM (Disk Group) Stripe
ASM ASM (AU) ( ) .
Disk Spin( ) Track Track
, ASM IDP DISK ASM Stripe
ASM (

(ASM with IDP) ASM witout IDP


, .

11gR2 ASM (HOT COLD) .


IDP (spanning)
, (Storage Array) .

Advanced Oracle Document

HOT COLD
,

, Access/Seek Time .

Disk Track , Track Track


Track . Sector .

Advanced Oracle Document

ASM IDP

1. TEST Disk Group


11gR2(11.2.0.2) ,

11gR2 ASM

Grid Infrastructure Oracle Restart

,
11gR2(11.2.0.2) Grid Infrastructure
11gR2(11.2.02) Oracle Database

system ,sysaux, redo, control file


SYSTEM_DG DISK GROUP .

DISK SAS 4 DISK

Advanced Oracle Document

0 ( ) Disk /dev/sda .

/dev/sdb 2 , /dev/sdc 3
/dev/sdd 4 .

/dev/sdb1 SYSTEM_DG DISK GROUP


orcl SID , 3 4
TEST DISK GROUP .

grid Grid Infrastructure grid


oracle , oracle asmca .

Advanced Oracle Document

Create DISKGROUP .

TEST DISKGROUP rawdevice /dev/raw/raw2,3


.

Redundancy Normal .

External template .

ORA-15067: command or option incompatible with diskgroup redundancy


Advanced Oracle Document

Show Advanced Options .

Chapter COMPATIBLE.ASM / COMPATIBLE.RDBMS


.

2. Template & Tablespace


IDP DISKGROUP COMPATIBLE.ASM
COMPATIBLE.RDBMS 11.2 .
default .
set lines 300
col name for a20
col ASM_COMPATIBILITY

for a20

col DATABASE_COMPATIBILITY for a20


select name, COMPATIBILITY "ASM_COMPATIBILITY",DATABASE_COMPATIBILITY
from v$asm_diskgroup;

Advanced Oracle Document

COMPATIBLE.RDBMS 11.2 COMPATIBLE


.
export $ORACLE_SID=+ASM

asm .

sysasm .
$ sqlplus / as sysasm

TEST .

Alter diskgroup TEST set attribute 'compatible.asm'='11.2';


Alter diskgroup TEST set attribute 'compatible.rdbms'='11.2';

test_hot HOT/HOTMIRROR template .


alter diskgroup TEST add template test_hot
attributes (hot mirrorhot);

HOT / COLD

MIRRORHOT

/ MIRRORCOLD

HOT COLD extent DISK


,
MIRRORHOT MIRRORCOLD Redundancy Normal
mirror( ) extent .

Advanced Oracle Document

test_cold COLD/MIIRORCOLD template .


alter diskgroup TEST add template test_cold
attributes (cold mirrorcold);

hot HOT .
create tablespace hot datafile '+TEST(test_hot)' size 30G;

cold COLD .
create tablespace cold datafile '+TEST(test_cold)' size 30G;

3. TEST TABLE & INDEX CREATION


,
clustering factor 2 .

HOT IDP_HOT_TEST1, IDP_HOT_TEST2 2

IDP_HOT_TEST1
create table idp_hot_test1

Advanced Oracle Document

pctfree 95 pctused 5
tablespace hot
as select object_id, object_name, status from dba_objects
order by dbms_random.value;

1 insert .

insert into idp_hot_test1


select * from idp_hot_test1
order by dbms_random.value;

IDP_HOT_TEST2
create table idp_hot_test2
pctfree 95 pctused 5
tablespace hot
as select object_id, object_type,timestamp from dba_objects
order by dbms_random.value;

COLD CTAS IDP_COLD_TEST1, IDP_COLD_TEST2


2

IDP_COLD_TEST1
create table idp_cold_test1
pctfree 95 pctused 5
Advanced Oracle Document

tablespace cold
as select * from idp_hot_test1;

IDP_COLD_TEST2
create table idp_cold_test2
pctfree 95 pctused 5
tablespace cold
as select * from idp_hot_test2;

dba_tables
select table_name,pct_free, pct_used from dba_tables
where table_name like 'IDP%';

ASSM PCT_USED
PCT_FREE 95 , row
.

IDP_HOT_TEST1 IDP_COLD_TEST1 .
create index idp_hot_test1_id_idx on idp_hot_test1(object_id)
tablespace hot;

Advanced Oracle Document

create index idp_cold_test1_id_idx on idp_cold_test1(object_id)


tablespace cold;

index clustering factor


.

object_id ,

select index_name, table_owner, table_name, clustering_factor


from dba_indexes
where index_name like 'IDP%';

.
EXEC DBMS_STATS.GATHER_TABLE_STATS(ownname=>'SYS',tabname=>'idp_hot_test1');
EXEC DBMS_STATS.GATHER_TABLE_STATS(ownname=>'SYS',tabname=>'idp_hot_test2');
EXEC DBMS_STATS.GATHER_TABLE_STATS(ownname=>'SYS',tabname=>'idp_cold_test1');
EXEC DBMS_STATS.GATHER_TABLE_STATS(ownname=>'SYS',tabname=>'idp_cold_test2');

4. Query Test
10 , set timing on
, shared_pool buffer_cache flush .
.

Advanced Oracle Document

HOT TEST
select /*+ use_nl(a b) reading(a b) */ * from
idp_hot_test1 a, idp_hot_test2 b
where a.object_id = b.object_id ;

COLD TEST
select /*+ use_nl(a b) reading(a b) */ * from
idp_cold_test1 a, idp_cold_test2 b
where a.object_id = b.object_id ;

HINT HASH nested loop


use_nl .

.
<HOT >

Advanced Oracle Document

<COLD >

2 Operation Rows .
set timing on .
HOT , COLD .

HOT

COLD

26.37

26.43

18.14

21.17

29.54

28.11

21.45

26.68

26.33

28.64

24.01

27.82

27.99

34.66

21.42

24.91

26.08

24.21

10

24.25

25.47

245.58

268.1

24.558

26.81

Advanced Oracle Document

2.252

IDP ,
2 ,
, , HOT
Access , COLD Access
.

5. ASM IDP
HOT COLD ,
IDP .

V$ASM_DISKGROUP
HOT_USED_MB : HOT MB
COLD_USED_MB : COLD MB

V$ASM_FILE
PRIMARY_REGION : EXTENT
MIRROR_REGION : (MIRROR) EXTENT

V$ASM_TEMPLATE
PRIMARY_REGION : EXTENT
MIRROR_REGION : EXTENT

V$ASM_DISK_IOSTAT HOT COLD I/O .

Advanced Oracle Document

TEST DISKGROUP HOT COLD

SELECT TOTAL_MB, FREE_MB, HOT_USED_MB, COLD_USED_MB


FROM V$ASM_DISKGROUP
where name='TEST';

TEST DISKGROUP TEMPLATE


(HOT or COLD) .
set lines 300
col DISKGROUP for a30
col "TEMPLAE NAME" for a30
select dg.name as diskgroup, t.name as "TEMPLATE NAME", t.stripe, t.redundancy,
t.primary_region, t.mirror_region
from v$asm_diskgroup dg, v$asm_template t
where dg.group_number = t.group_number and dg.name='TEST'
order by t.name;

Advanced Oracle Document

6. ASM IDP
ASM DISK (HOT,COLD) .
DBA ,
, .

RMAN ASM
HOT
.

HOT
COLD .

HOT ,

TEST.258.758975835 cold HOT


alter diskgroup TEST modify file '+test/orcl/datafile/TEST.258.758975835'


attributes (hot mirrorhot);

EXTENT COLD HOT


, EXTENT HOT .

Advanced Oracle Document

REBALANCE EXTENT HOT


.

ASM SYSASM rebalance .


alter diskgroup test rebalance power 9;

power rebalance CPU


rebalance ,
1 9 Rebalance
.

7. Epilogue
ASM
. , join HOT COLD
.

Redundancy Normal(Mirror)
1/2 .
Storage Raid 1 5 LUN
ASM Redundancy Normal
.

Advanced Oracle Document

You might also like