votedisk在ASM diskgroup上的存放規律

dbhelper發表於2014-12-03

VotediskASM Diskgroup上的存放滿足以下條件:

External redundancy: A disk group with external redundancy contains only one voting disk

Normal redundancy: A disk group with normal redundancy contains three voting disks 

High redundancy: A disk group with high redundancy contains five voting disks

By default, Oracle ASM puts each voting disk in its own failure group within the disk group and enforces the required number of failure groups and disks in the disk group as listed above

 

每塊votedisk只能獨佔一個failgroup,也就是說對於Normal redundancydiskgroup上面要有三個votedisk就必須要有三塊磁碟,而且每塊磁碟必須是一個獨立的failgroup,以此類推對於High redundancyDiskgroup必須要有五塊磁碟。

 

對於diskgroup中既有regular disk,又有quorum disk的場景做了幾個測試:

1normal redundancydiskgroup包含兩個regular failgroup,一個quorum failgroup(裡面有三塊quorum disk)

create diskgroup datadg2 normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl' quorum failgroup fg1 disk '/dev/asm-diskm','/dev/asm-diskn','/dev/asm-diskp' attribute 'compatible.asm'='11.2.0.0.0';

 

grid@ora12c1:/home/grid>crsctl replace votedisk +datadg2

Successful addition of voting disk c316684dcc224fdabfce2f7c0f07120e.

Successful addition of voting disk 15a5c7e215004f3dbfd46557be4b6515.

Successful addition of voting disk bd1ee9b50ab54f0fbf07dfac8e7a0a1f.

Successful deletion of voting disk a5a3049ff9004f68bf68ba3023b92697.

Successful deletion of voting disk 4c8f0e4d37784f62bf52d613bd6b3d31.

Successful deletion of voting disk 268ca86c8cc14f6fbfe44623a01ad900.

Successfully replaced voting disk group with +datadg2.

CRS-4266: Voting file(s) successfully replaced

grid@ora12c1:/home/grid>crsctl query css votedisk      

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   c316684dcc224fdabfce2f7c0f07120e (/dev/asm-diskm) [DATADG2]

 2. ONLINE   15a5c7e215004f3dbfd46557be4b6515 (/dev/asm-diskk) [DATADG2]

 3. ONLINE   bd1ee9b50ab54f0fbf07dfac8e7a0a1f (/dev/asm-diskl) [DATADG2]

Located 3 voting disk(s).

 

select g.name,d.FAILGROUP_TYPE,d.name,d.failgroup,d.path from v$asm_diskgroup g,v$asm_disk d where d.GROUP_NUMBER=g.group_number and g.name='DATADG2'

 

NAME       FAILGROUP_TYPE    NAME       FAILGROUP      PATH

DATADG2          QUORUM         DATADG2_0002       FG1  /dev/asm-diskm

DATADG2          REGULAR          DATADG2_0000       DATADG2_0000       /dev/asm-diskk

DATADG2          QUORUM         DATADG2_0003       FG1  /dev/asm-diskn

DATADG2          QUORUM         DATADG2_0004       FG1  /dev/asm-diskp

DATADG2          REGULAR          DATADG2_0001       DATADG2_0001       /dev/asm-diskl

結論:嚴格遵循一塊votedisk獨佔一個failgroup的規律,quorum failgroup FG1雖然有三塊盤但也只存放了一個votedisk

 

2normal redundancydiskgroup包含五塊盤,每塊盤都歸於一個單獨的failgroup,後三塊盤分別歸屬於三個quorum failgroup

create diskgroup datadg2 normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl' quorum failgroup fg1 disk '/dev/asm-diskm' quorum failgroup fg2 disk '/dev/asm-diskn' quorum failgroup fg3 disk '/dev/asm-diskp' attribute 'compatible.asm'='11.2.0.0.0';

 

 

grid@ora12c2:/home/grid>crsctl replace votedisk +datadg2

Successful addition of voting disk 34e0460432d44ff3bff804d46c39786c.

Successful addition of voting disk fb9abe518e1b4f69bf57e2e83226531c.

Successful addition of voting disk 3bf5057d7cc84fbdbf9c3d392190ab37.

Successful deletion of voting disk cfaa4be567514fd4bf9f3e67fe1123a3.

Successful deletion of voting disk 3c78c6d2e5514f30bf1e8d458df33117.

Successful deletion of voting disk c925fd2c5fdf4f28bfe94bdd7ae5c8fe.

Successfully replaced voting disk group with +datadg2.

CRS-4266: Voting file(s) successfully replaced

 

grid@ora12c2:/home/grid>crsctl query css votedisk      

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   34e0460432d44ff3bff804d46c39786c (/dev/asm-diskm) [DATADG2]

 2. ONLINE   fb9abe518e1b4f69bf57e2e83226531c (/dev/asm-diskn) [DATADG2]

 3. ONLINE   3bf5057d7cc84fbdbf9c3d392190ab37 (/dev/asm-diskp) [DATADG2]

Located 3 voting disk(s).

 

select g.name,d.FAILGROUP_TYPE,d.name,d.failgroup,d.path from v$asm_diskgroup g,v$asm_disk d where d.GROUP_NUMBER=g.group_number and g.name='DATADG2'

NAME       FAILGROUP_TYPE    NAME       FAILGROUP      PATH

DATADG2          QUORUM         DATADG2_0004       FG3  /dev/asm-diskp

DATADG2          REGULAR          DATADG2_0000       DATADG2_0000       /dev/asm-diskk

DATADG2          QUORUM         DATADG2_0003       FG2  /dev/asm-diskn

DATADG2          REGULAR          DATADG2_0001       DATADG2_0001       /dev/asm-diskl

DATADG2          QUORUM         DATADG2_0002       FG1  /dev/asm-diskm

 

結論:quorum diskgroup數量足夠的情況下,優先存放votediskquorum diskgroup

 

3external redundancydiskgroup包含五塊盤,每塊盤都歸於一個單獨的failgroup,後三

塊盤分別歸屬於三個quorum failgroup

create diskgroup datadg2 external redundancy disk '/dev/asm-diskk','/dev/asm-diskl' quorum disk '/dev/asm-diskm' quorum disk '/dev/asm-diskn' quorum disk '/dev/asm-diskp' attribute 'compatible.asm'='11.2.0.0.0';

 

Diskgroup created.

 

grid@ora12c2:/home/grid>crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   94e8c6b45a344fafbf05359e3ff50e74 (/dev/asm-diskc) [SYSDG]

 2. ONLINE   612b46359d6a4f0fbf9bc7bd5c504336 (/dev/asm-diskd) [SYSDG]

 3. ONLINE   d45d108f1d1c4ff8bfbc0d3226f609df (/dev/asm-diske) [SYSDG]

Located 3 voting disk(s).

grid@ora12c2:/home/grid>crsctl replace votedisk +datadg2

Successful addition of voting disk 9e6caec727204f78bf11af57a3139a12.

Successful deletion of voting disk 94e8c6b45a344fafbf05359e3ff50e74.

Successful deletion of voting disk 612b46359d6a4f0fbf9bc7bd5c504336.

Successful deletion of voting disk d45d108f1d1c4ff8bfbc0d3226f609df.

Successfully replaced voting disk group with +datadg2.

CRS-4266: Voting file(s) successfully replaced

grid@ora12c2:/home/grid>crsctl query css votedisk      

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   9e6caec727204f78bf11af57a3139a12 (/dev/asm-diskm) [DATADG2]

Located 1 voting disk(s).

 

select g.name,d.FAILGROUP_TYPE,d.name,d.failgroup,d.path from v$asm_diskgroup g,v$asm_disk d where d.GROUP_NUMBER=g.group_number and g.name='DATADG2'

NAME       FAILGROUP_TYPE    NAME       FAILGROUP      PATH

DATADG2          QUORUM         DATADG2_0004       DATADG2_0004       /dev/asm-diskp

DATADG2          REGULAR          DATADG2_0000       DATADG2_0000       /dev/asm-diskk

DATADG2          QUORUM         DATADG2_0003       DATADG2_0003       /dev/asm-diskn

DATADG2          REGULAR          DATADG2_0001       DATADG2_0001       /dev/asm-diskl

DATADG2          QUORUM         DATADG2_0002       DATADG2_0002       /dev/asm-diskm

 

結論:external redundancy diskgroup裡只能放一塊votedisk,而且優先存放在quorum failgroup

 

4normal redundancydiskgroup起初只有兩個failgroup,新增votedisk失敗,加入一個Failgroup後成功

create diskgroup datadg2 normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl' attribute 'compatible.asm'='11.2.0.0.0';

 

Diskgroup created.

 

select g.name,d.FAILGROUP_TYPE,d.name,d.failgroup,d.path from v$asm_diskgroup g,v$asm_disk d where d.GROUP_NUMBER=g.group_number and g.name='DATADG2' and header_status='MEMBER'

 

NAME       FAILGROUP_TYPE    NAME       FAILGROUP      PATH

DATADG2          REGULAR          DATADG2_0001       DATADG2_0001       /dev/asm-diskl

DATADG2          REGULAR          DATADG2_0000       DATADG2_0000       /dev/asm-diskk

 

grid@ora12c2:/home/grid>crsctl replace votedisk +datadg2

Failed to create voting files on disk group datadg2.

Change to configuration failed, but was successfully rolled back.

CRS-4000: Command Replace failed, or completed with errors.

 

加一塊盤進去:

alter diskgroup datadg2 add disk '/dev/asm-diskm';

 

select g.name,d.FAILGROUP_TYPE,d.name,d.failgroup,d.path from v$asm_diskgroup g,v$asm_disk d where d.GROUP_NUMBER=g.group_number and g.name='DATADG2' and header_status='MEMBER'

 

NAME       FAILGROUP_TYPE    NAME       FAILGROUP      PATH

DATADG2          REGULAR          DATADG2_0001       DATADG2_0001       /dev/asm-diskl

DATADG2          REGULAR          DATADG2_0000       DATADG2_0000       /dev/asm-diskk

DATADG2          REGULAR          DATADG2_0002       DATADG2_0002       /dev/asm-diskm

 

grid@ora12c2:/home/grid>crsctl replace votedisk +datadg2

Successful addition of voting disk 9e559487d7ad4f33bf6deb330d1b9bef.

Successful addition of voting disk 3f76c2dd8b044f8abf91c598c095f052.

Successful addition of voting disk b2a0b6c8499f4fecbfa967a8131831ff.

Successful deletion of voting disk c7c77baba41d4f80bf2c470ee46e78d3.

Successful deletion of voting disk 7fbbf3ca3a404f30bf49e61bfc9bd128.

Successful deletion of voting disk 34b64b122d304f7bbfafde700a26b3bf.

Successfully replaced voting disk group with +datadg2.

CRS-4266: Voting file(s) successfully replaced

grid@ora12c2:/home/grid>crsctl query css votedisk       

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   9e559487d7ad4f33bf6deb330d1b9bef (/dev/asm-diskk) [DATADG2]

 2. ONLINE   3f76c2dd8b044f8abf91c598c095f052 (/dev/asm-diskl) [DATADG2]

 3. ONLINE   b2a0b6c8499f4fecbfa967a8131831ff (/dev/asm-diskm) [DATADG2]

Located 3 voting disk(s).

 

結論:normal redundancy diskgroup要存放votedisk必須至少有三塊盤

 

5 diskgroup建立後,其中的Quorum disk成員發生了刪除和新增操作,votedisk就不一定存在於quorum disk

create diskgroup datadg2 normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl' quorum failgroup fg1 disk '/dev/asm-diskm' quorum failgroup fg2 disk '/dev/asm-diskn' quorum failgroup fg3 disk '/votefs/votefile' attribute 'compatible.asm'='11.2.0.0.0';

 

grid@ora12c2:/home/grid>crsctl replace votedisk +datadg2

Successful addition of voting disk 0d912cf67c9a4f0fbf9a3ee6386cdcc3.

Successful addition of voting disk 3adddd94d51d4f93bfdac7f165324fe1.

Successful addition of voting disk afc8bf2bb7dc4f79bfecb3131b3eaa4b.

Successful deletion of voting disk 59cc8fe06b914fc3bf7c02b6e50c0e8b.

Successful deletion of voting disk 1db7404f909d4f93bfe06323c0eb4b52.

Successful deletion of voting disk 849b2fee61914f45bf3857cf91c43406.

Successfully replaced voting disk group with +datadg2.

CRS-4266: Voting file(s) successfully replaced

grid@ora12c2:/home/grid>crsctl query css votedisk      

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   0d912cf67c9a4f0fbf9a3ee6386cdcc3 (/dev/asm-diskm) [DATADG2]

 2. ONLINE   3adddd94d51d4f93bfdac7f165324fe1 (/dev/asm-diskn) [DATADG2]

 3. ONLINE   afc8bf2bb7dc4f79bfecb3131b3eaa4b (/votefs/votefile) [DATADG2]

Located 3 voting disk(s).

 

SQL> alter diskgroup datadg2 drop quorum disk DATADG2_0004; --刪除/votefs/votefile所在的disk

 

Diskgroup altered.

 

SQL> alter diskgroup datadg2 add quorum disk '/dev/asm-diskp'; --加入一塊新的quorum disk

 

Diskgroup altered.

grid@ora12c2:/home/grid>crsctl replace votedisk +datadg2

Successful addition of voting disk 59746012d6494f46bfe9aaa26529a256.

Successful addition of voting disk f6c18e0ea9024fa7bff12d4c593fbd15.

Successful addition of voting disk a636272fc5934f27bf29ce43f9cb7e65.

Successful deletion of voting disk e217f3cb7b2a4fbbbf5721024271c055.

Successful deletion of voting disk fb8f961107a14fbcbf2422e48d8897b5.

Successful deletion of voting disk 005d842a1a854fd8bfc8e615284e6347.

Successfully replaced voting disk group with +datadg2.

CRS-4266: Voting file(s) successfully replaced

grid@ora12c2:/home/grid>crsctl query css votedisk      

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   59746012d6494f46bfe9aaa26529a256 (/dev/asm-diskm) [DATADG2]

 2. ONLINE   f6c18e0ea9024fa7bff12d4c593fbd15 (/dev/asm-diskn) [DATADG2]

 3. ONLINE   a636272fc5934f27bf29ce43f9cb7e65 (/dev/asm-diskk) [DATADG2]

Located 3 voting disk(s).

 

結論:diskgroup首次建立的時候滿足Votedisk優先存放quorum disk的規律,但之後若diskgroup中的quorum磁碟發生刪除及新增操作後,此規律有可能不滿足

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8494287/viewspace-1354979/,如需轉載,請註明出處,否則將追究法律責任。

相關文章