asm實驗

不一樣的天空w發表於2017-10-09



1.加盤
加了7塊盤:

test_add_disk1   :5g
test_add_disk2   :5g
test_add_disk3   :3g
test_add_disk4   :3g
test_add_disk5   :4g


在節點一二上的加盤順序也如上所述(注意節點加盤順序要一致)
                
2.檢視新加盤
fdisk -l
..........................
Disk /dev/sdi: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdj: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdk: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdl: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdm: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


3.檢視共享磁碟對應的uuid:(命令:scsi_id -g -u )

scsi_id -g -u /dev/sdi
scsi_id -g -u /dev/sdj
scsi_id -g -u /dev/sdk
scsi_id -g -u /dev/sdl
scsi_id -g -u /dev/sdm

[root@dbrac1 ~]# scsi_id -g -u /dev/sdi
1ATA_VBOX_HARDDISK_VB890834d8-80354f38
[root@dbrac1 ~]# scsi_id -g -u /dev/sdj
1ATA_VBOX_HARDDISK_VB4a451252-0fe77623
[root@dbrac1 ~]# scsi_id -g -u /dev/sdk
1ATA_VBOX_HARDDISK_VBc1e958f0-2da6ca6e
[root@dbrac1 ~]# scsi_id -g -u /dev/sdl
1ATA_VBOX_HARDDISK_VBd5447707-579d66c5
[root@dbrac1 ~]# scsi_id -g -u /dev/sdm
1ATA_VBOX_HARDDISK_VB41e29546-c7f56785
[root@dbrac1 ~]#

--注意在接單一二都檢查uuid,確保一致

4.--配置規則檔案
——在各節點下/etc/udev/rules.d/99-oracle-asmdevices.rules檔案新增如下資訊:
vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="sd*", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB890834d8-80354f38", NAME="test_add_disk1", OWNER="grid", GROUP="asmdba", MODE="0660"
KERNEL=="sd*", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB4a451252-0fe77623", NAME="test_add_disk2", OWNER="grid", GROUP="asmdba", MODE="0660"
KERNEL=="sd*", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBc1e958f0-2da6ca6e", NAME="test_add_disk3", OWNER="grid", GROUP="asmdba", MODE="0660"
KERNEL=="sd*", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBd5447707-579d66c5", NAME="test_add_disk4", OWNER="grid", GROUP="asmdba", MODE="0660"
KERNEL=="sd*", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB41e29546-c7f56785", NAME="test_add_disk5", OWNER="grid", GROUP="asmdba", MODE="0660"


5.--重啟服務
[root@dbrac1 rules.d]# start_udev
Starting udev: [  OK  ]

--驗證:
[root@dbrac1 ~]#  ll /dev/test*
brw-rw---- 1 grid asmdba 8, 128 Oct  9 09:59 /dev/test_add_disk1
brw-rw---- 1 grid asmdba 8, 144 Oct  9 09:59 /dev/test_add_disk2
brw-rw---- 1 grid asmdba 8, 160 Oct  9 09:59 /dev/test_add_disk3
brw-rw---- 1 grid asmdba 8, 176 Oct  9 09:59 /dev/test_add_disk4
brw-rw---- 1 grid asmdba 8, 192 Oct  9 09:59 /dev/test_add_disk5
[root@dbrac1 ~]#

節點2重複步驟4和步驟5;

至此加盤完成!!!!!


實驗
查詢:
set lines 200
col PATH for a30
col FAILGROUP for a15
col name for a15
col HEADER_STATUS for a10
select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                 FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- -------------------- ---------------
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2       DATA_0001
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1       DATA_0000
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2        FRA_0001
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1        FRA_0000
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3    OCRVOTE_0002
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2    OCRVOTE_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1    OCRVOTE_0000

7 rows selected.

select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB,OFFLINE_DISKS,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME            STATE                  TYPE           TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB OFFLINE_DISKS VO
------------ --------------- ---------------------- ------------ ---------- ---------- ----------------------- -------------- ------------- --
           1 DATA            MOUNTED                NORMAL            30720      22704                       0          11352             0 N
           2 FRA             MOUNTED                NORMAL            10240       4684                       0           2342             0 N
           3 OCRVOTE         MOUNTED                NORMAL             6144       5218                    2048           1585             0 Y

--備份spfile:
SQL>  create pfile='/home/grid/init.ora' from spfile;

File created.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[grid@dbrac1 ~]$
[grid@dbrac1 ~]$ vi init.ora
+ASM2.asm_diskgroups='DATA','FRA'#Manual Mount
+ASM1.asm_diskgroups='DATA','FRA'#Manual Mount
*.asm_diskstring='/dev/asm*','/dev/test*'
*.asm_power_limit=1
*.diagnostic_dest='/oracle/app/grid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'
[grid@dbrac1 ~]$
[grid@dbrac1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Mon Oct 9 11:55:12 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> select status from v$instance;

STATUS
------------------------
STARTED

---新增引數asm_diskstring='/dev/asm*','/dev/test*'使asm能夠發現磁碟路徑。

SQL> alter system set asm_diskstring='/dev/asm*','/dev/test*' sid='*';

System altered.

--增加磁碟組test
create diskgroup test normal redundancy failgroup test_a disk '/dev/test_add_disk1' name test_a1 failgroup test_b disk '/dev/test_add_disk2' name test_b2;

Diskgroup created.

SQL> set lines 200
SQL> col PATH for a30
SQL> col FAILGROUP for a15
SQL> col name for a15
SQL> col HEADER_STATUS for a10
SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           0           0 CLOSED         CANDIDATE  ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk3
           0           3 CLOSED         CANDIDATE  ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk5
           0           4 CLOSED         CANDIDATE  ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk4
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           4           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_A1         /dev/test_add_disk1            TEST_A

12 rows selected.

SQL> select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB,OFFLINE_DISKS,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME            STATE                  TYPE           TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB OFFLINE_DISKS VO
------------ --------------- ---------------------- ------------ ---------- ---------- ----------------------- -------------- ------------- --
           1 DATA            MOUNTED                NORMAL            30720      22680                       0          11340             0 N
           2 FRA             MOUNTED                NORMAL            10240       4434                       0           2217             0 N
           3 OCRVOTE         MOUNTED                NORMAL             6144       5218                    2048           1585             0 Y
           4 TEST            MOUNTED                NORMAL            10240      10138                       0           5069             0 N

SQL>


--給磁碟組test增加磁碟test_c
alter diskgroup test add failgroup TEST_C disk '/dev/test_add_disk5' name  test_c1;

SQL> alter diskgroup test add failgroup TEST_C disk '/dev/test_add_disk5' name  test_c1;

Diskgroup altered.

SQL> select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB,OFFLINE_DISKS,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME            STATE                  TYPE           TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB OFFLINE_DISKS VO
------------ --------------- ---------------------- ------------ ---------- ---------- ----------------------- -------------- ------------- --
           1 DATA            MOUNTED                NORMAL            30720      22680                       0          11340             0 N
           2 FRA             MOUNTED                NORMAL            10240       4434                       0           2217             0 N
           3 OCRVOTE         MOUNTED                NORMAL             6144       5218                    2048           1585             0 Y
           4 TEST            MOUNTED                NORMAL            14336      14230                    5120           4555             0 N

SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           0           4 CLOSED         CANDIDATE  ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk4
           0           0 CLOSED         CANDIDATE  ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk3
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B
           4           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_A1         /dev/test_add_disk1            TEST_A

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           4           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_C1         /dev/test_add_disk5            TEST_C

12 rows selected.

--將磁碟組test中的磁碟test_c1從其中刪除

alter diskgroup test drop disk TEST_C1;

SQL> alter diskgroup test drop disk TEST_C1;

Diskgroup altered.

SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           0           0 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk5
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B
           4           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_A1         /dev/test_add_disk1            TEST_A
           5           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_A_1           /dev/test_add_disk3            G_A

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           5           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_B_1           /dev/test_add_disk4            G_B

12 rows selected.

--再次新增failgroup test_c:
SQL>   alter diskgroup test add failgroup TEST_C disk '/dev/test_add_disk5' name  test_c1;

Diskgroup altered.

SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B
           4           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_A1         /dev/test_add_disk1            TEST_A
           4           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_C1         /dev/test_add_disk5            TEST_C
           5           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_B_1           /dev/test_add_disk4            G_B

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           5           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_A_1           /dev/test_add_disk3            G_A

12 rows selected.

--再次刪除failgroup TEST_C;

alter diskgroup test drop disks in failgroup TEST_C;
SQL> alter diskgroup test drop disks in failgroup TEST_C;

Diskgroup altered.

SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B
           4           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_A1         /dev/test_add_disk1            TEST_A
           4           2 CACHED         MEMBER     ONLINE         DROPPING         UNKNOWN        TEST_C1         /dev/test_add_disk5            TEST_C
           5           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_B_1           /dev/test_add_disk4            G_B

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           5           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_A_1           /dev/test_add_disk3            G_A

12 rows selected.

SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           0           0 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk5
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B
           4           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_A1         /dev/test_add_disk1            TEST_A
           5           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_A_1           /dev/test_add_disk3            G_A

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           5           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_B_1           /dev/test_add_disk4            G_B

12 rows selected.

--增加磁碟組gab;
 create diskgroup gab normal redundancy failgroup g_a disk '/dev/test_add_disk3' name g_a_1 failgroup g_b disk '/dev/test_add_disk4' name g_b_1;
 
SQL> select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB,OFFLINE_DISKS,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME            STATE                  TYPE           TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB OFFLINE_DISKS VO
------------ --------------- ---------------------- ------------ ---------- ---------- ----------------------- -------------- ------------- --
           1 DATA            MOUNTED                NORMAL            30720      22680                       0          11340             0 N
           2 FRA             MOUNTED                NORMAL            10240       4434                       0           2217             0 N
           3 OCRVOTE         MOUNTED                NORMAL             6144       5218                    2048           1585             0 Y
           4 TEST            MOUNTED                NORMAL            14336      14183                    5120           4531             0 N
           5 GAB             MOUNTED                NORMAL             6144       6042                       0           3021             0 N

SQL>  select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B
           4           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_A1         /dev/test_add_disk1            TEST_A
           4           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_C1         /dev/test_add_disk5            TEST_C
           5           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_B_1           /dev/test_add_disk4            G_B

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           5           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_A_1           /dev/test_add_disk3            G_A

12 rows selected.

--刪除磁碟組gab:
SQL>  drop diskgroup gab;

Diskgroup dropped.

SQL> select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB,OFFLINE_DISKS,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME            STATE                  TYPE           TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB OFFLINE_DISKS VO
------------ --------------- ---------------------- ------------ ---------- ---------- ----------------------- -------------- ------------- --
           1 DATA            MOUNTED                NORMAL            30720      22680                       0          11340             0 N
           2 FRA             MOUNTED                NORMAL            10240       4434                       0           2217             0 N
           3 OCRVOTE         MOUNTED                NORMAL             6144       5218                    2048           1585             0 Y
           4 TEST            MOUNTED                NORMAL            10240      10138                       0           5069             0 N

SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           0           0 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk5
           0           1 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk3
           0           2 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk4
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           4           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_A1         /dev/test_add_disk1            TEST_A

12 rows selected.

--修改引數asm_diskgroups
SQL> alter system set asm_diskgroups='DATA','FRA','OCRVOTE','TEST';

System altered.

驗證:
SQL> create pfile='/home/grid/init02_ora' from spfile;

File created.

[grid@dbrac1 ~]$ cat init02_ora
+ASM2.asm_diskgroups='DATA','FRA'#Manual Mount
+ASM1.asm_diskgroups='DATA','FRA','TEST'#Manual Dismount
*.asm_diskgroups='DATA','FRA','OCRVOTE','TEST'
*.asm_diskstring='/dev/asm*','/dev/test*'
*.asm_power_limit=1
*.diagnostic_dest='/oracle/app/grid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'
[grid@dbrac1 ~]$  


--在節點2檢查新增的磁碟組狀態:
[grid@dbrac2 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Mon Oct 9 15:37:14 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> set lines 200
SQL> col PATH for a30
SQL> col FAILGROUP for a15
SQL> col name for a15
SQL> col HEADER_STATUS for a10
SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           0           0 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk5
           0           1 CLOSED         MEMBER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk1
           0           2 CLOSED         MEMBER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk2
           0           3 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk3
           0           4 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk4
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002

12 rows selected.

SQL> select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB,OFFLINE_DISKS,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME            STATE                  TYPE           TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB OFFLINE_DISKS VO
------------ --------------- ---------------------- ------------ ---------- ---------- ----------------------- -------------- ------------- --
           1 DATA            MOUNTED                NORMAL            30720      22680                       0          11340             0 N
           2 FRA             MOUNTED                NORMAL            10240       4434                       0           2217             0 N
           3 OCRVOTE         MOUNTED                NORMAL             6144       5218                    2048           1585             0 Y
           0 TEST            DISMOUNTED                                   0          0                       0              0             0 N

發現磁碟組test狀態為dismount,手動mount;
alter diskgroup test mount;

SQL>   alter diskgroup test mount;

Diskgroup altered.

SQL> select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB,OFFLINE_DISKS,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME            STATE                  TYPE           TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB OFFLINE_DISKS VO
------------ --------------- ---------------------- ------------ ---------- ---------- ----------------------- -------------- ------------- --
           1 DATA            MOUNTED                NORMAL            30720      22680                       0          11340             0 N
           2 FRA             MOUNTED                NORMAL            10240       4434                       0           2217             0 N
           3 OCRVOTE         MOUNTED                NORMAL             6144       5218                    2048           1585             0 Y
           4 TEST            MOUNTED                NORMAL            10240      10054                       0           5027             0 N

---將磁碟組test中的磁碟test_a1offline
SQL> alter diskgroup test offline disk TEST_A1;
alter diskgroup test offline disk TEST_A1
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15283: ASM operation requires compatible.rdbms of 11.1.0.0.0 or higher

解決:先設定compatible.asm引數,再設定compatible.rdbms引數:
SQL> alter diskgroup test set attribute 'compatible.asm'='11.2.0.0.0';

Diskgroup altered.

SQL> alter diskgroup test set attribute 'compatible.rdbms'='11.2.0.0.0';

Diskgroup altered.


--再次offline 磁碟test_a1
SQL> alter diskgroup test offline disk TEST_A1;

Diskgroup altered.

SQL>  select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           0           1 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk3
           0           0 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk5
           0           2 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk4
           0           3 CLOSED         MEMBER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk1
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           4           0 MISSING        UNKNOWN    OFFLINE        NORMAL           UNKNOWN        TEST_A1                                        TEST_A
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B

13 rows selected.

--online 磁碟TEST_A1
SQL> alter diskgroup test online  disk TEST_A1;

Diskgroup altered.

SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           0           0 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk5
           0           1 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk3
           0           2 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk4
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           4           0 CACHED         MEMBER     SYNCING        NORMAL           UNKNOWN        TEST_A1         /dev/test_add_disk1            TEST_A

12 rows selected.

SQL> alter diskgroup test offline disks in failgroup  TEST_A;

Diskgroup altered.

SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           0           1 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk3
           0           0 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk5
           0           2 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk4
           0           3 CLOSED         MEMBER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk1
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           4           0 MISSING        UNKNOWN    OFFLINE        NORMAL           UNKNOWN        TEST_A1                                        TEST_A
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B

13 rows selected.

SQL> alter diskgroup test offline disks in failgroup  TEST_b;
alter diskgroup test offline disks in failgroup  TEST_b
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15066: offlining disk "TEST_B2" in group "TEST" may result in a data loss


---修改引數DISK_REPAIR_TIME
先增加磁碟組:
SQL>  create diskgroup gab normal redundancy failgroup g_a disk '/dev/test_add_disk3' name g_a_1 failgroup g_b disk '/dev/test_add_disk4' name g_b_1;

Diskgroup created.

SQL> select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB,OFFLINE_DISKS,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME            STATE                  TYPE           TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB OFFLINE_DISKS VO
------------ --------------- ---------------------- ------------ ---------- ---------- ----------------------- -------------- ------------- --
           1 DATA            MOUNTED                NORMAL            30720      22680                       0          11340             0 N
           2 FRA             MOUNTED                NORMAL            10240       4434                       0           2217             0 N
           3 OCRVOTE         MOUNTED                NORMAL             6144       5218                    2048           1585             0 Y
           4 TEST            MOUNTED                NORMAL            10240      10050                       0           5025             0 N
           5 GAB             MOUNTED                NORMAL             6144       6042                       0           3021             0 N

SQL> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,REDUNDANCY,NAME,PATH,FAILGROUP from v$asm_disk order by 1;

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           0           0 CLOSED         FORMER     ONLINE         NORMAL           UNKNOWN                        /dev/test_add_disk5
           1           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0000       /dev/asm_data1                 DATA_0000
           1           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        DATA_0001       /dev/asm_data2                 DATA_0001
           2           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0001        /dev/asm_fra2                  FRA_0001
           2           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        FRA_0000        /dev/asm_fra1                  FRA_0000
           3           2 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0002    /dev/asm_ocrvote3              OCRVOTE_0002
           3           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0001    /dev/asm_ocrvote2              OCRVOTE_0001
           3           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        OCRVOTE_0000    /dev/asm_ocrvote1              OCRVOTE_0000
           4           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_B2         /dev/test_add_disk2            TEST_B
           4           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        TEST_A1         /dev/test_add_disk1            TEST_A
           5           0 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_A_1           /dev/test_add_disk3            G_A

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS   HEADER_STA MODE_STATUS    STATE            REDUNDANCY     NAME            PATH                           FAILGROUP
------------ ----------- -------------- ---------- -------------- ---------------- -------------- --------------- ------------------------------ ---------------
           5           1 CACHED         MEMBER     ONLINE         NORMAL           UNKNOWN        G_B_1           /dev/test_add_disk4            G_B

12 rows selected.

SQL>   alter diskgroup GAB set attribute 'DISK_REPAIR_TIME'='5h';
  alter diskgroup GAB set attribute 'DISK_REPAIR_TIME'='5h'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15242: could not set attribute DISK_REPAIR_TIME
ORA-15221: ASM operation requires compatible.asm of 11.1.0.0.0 or higher

報錯,解決:
SQL> alter diskgroup GAB set attribute 'compatible.asm'='11.2.0.0.0';

Diskgroup altered.

SQL> alter diskgroup GAB set attribute 'compatible.rdbms'='11.2.0.0.0';

Diskgroup altered.

再次修改DISK_REPAIR_TIME
SQL> alter diskgroup GAB set attribute 'DISK_REPAIR_TIME'='10h';

Diskgroup altered.

驗證:
ASMCMD> lsattr -l -G gab
Name                     Value       
access_control.enabled   FALSE       
access_control.umask     066         
au_size                  1048576     
cell.smart_scan_capable  FALSE       
compatible.asm           11.2.0.0.0  
compatible.rdbms         11.2.0.0.0  
disk_repair_time         10h         
sector_size              512         
ASMCMD>






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

相關文章