Add a ASM disk to ASM diskgroup

DB: 11g RAC 11.2.0.4.3

OS:  RHEL5.4

 

1.给新增的共享磁盘分区,本例只添加了一个1G的磁盘,这里直接划一个分区/dev/sdf1,格式ext3

划完后,在所有节点执行partprobe/dev/sdf1来是所有节点的系统识别该分区

[root@rac1~]# partprobe /dev/sdf1

[root@rac2grid]# partprobe /dev/sdf1

2.在主节点创建ASM磁盘,在其他节点扫描新的ASM磁盘

[root@rac1~]# oracleasm listdisks

DATA

FRA

OCRVOTE

[root@rac1~]# oracleasm createdisk DATA1 /dev/sdf1

Writing disk header:done

Instantiating disk:done

[root@rac1~]# oracleasm listdisks

DATA

DATA1

FRA

OCRVOTE

[root@rac2grid]# oracleasm listdisks

DATA

FRA

OCRVOTE

[root@rac2grid]# oracleasm scandisks

Reloading diskpartitions: done

Cleaning any stale ASMdisks...

Scanning system for ASMdisks...

Instantiating disk"DATA1"

[root@rac2grid]# oracleasm listdisks

DATA

DATA1

FRA

OCRVOTE

3.将新增的盘使用udev持久化

[root@rac1 ~]#/sbin/scsi_id -g -u -s /block/sdf

36000c29f6031e2dfff55a25cd173e335

[root@rac1 ~]# vi/etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="sd*",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p",RESULT=="36000c29e2c8f3ffaead91b96d74d1895", NAME="crs",OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p",RESULT=="36000c29836b1c4cc21178424b5d7c892", NAME="data",OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p",RESULT=="36000c29404d2c7087abdde0835f52c48", NAME="fra",OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p",RESULT=="36000c29c93582249e3015b1aa82b3773",NAME="ocrvote", OWNER="grid", GROUP="asmadmin",MODE="0660"

KERNEL=="sd*",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p",RESULT=="36000c29f6031e2dfff55a25cd173e335",NAME="data1", OWNER="grid", GROUP="asmadmin",MODE="0660"

[root@rac1 ~]# scp /etc/udev/rules.d/99-oracle-asmdevices.rulesrac2:/etc/udev/rules.d/99-oracle-asmdevices.rules

Warning: Permanentlyadded the RSA host key for IP address '172.18.130.202' to the list of knownhosts.

root@rac2's password:

99-oracle-asmdevices.rules                                                                                                                    100%  842     0.8KB/s  00:00   

所有节点重启udev

[root@rac1 ~]# start_udev

Starting udev: [  OK  ]

[root@rac2 grid]# start_udev

Starting udev: [  OK  ]

[root@rac2 grid]#

 4.将新的磁盘添加的已有磁盘组中

SQL>select group_number,disk_number,name,path,failgroup from v$asm_disk;

GROUP_NUMBERDISK_NUMBER NAME                          PATH                          FAILGROUP

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

           0          0                                                                            ORCL:DATA1                                              

           1           0                                      DATA                           ORCL:DATA                      DATA

           2           0                                      FRA                              ORCL:FRA                          FRA

           3           0                                      OCRVOTE                     ORCL:OCRVOTE                OCRVOTE

 

注意到新增加的磁盘的磁盘组号和磁盘号都是0,且磁盘名为空。

SQL>select group_number,name,state,type,total_mb,free_mb from v$asm_diskgroup;

GROUP_NUMBER NAME                           STATE                  TYPE                 TOTAL_MB    FREE_MB

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

           1 DATA                           MOUNTED                           EXTERN                  20473       16981

           2 FRA                               MOUNTED                           EXTERN                  20473       2399

           3 OCRVOTE                     MOUNTED                           EXTERN                   1019        623

SQL>show parameter power

NAME                                 TYPE                              VALUE

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

asm_power_limit                      integer                           1

SQL>alter system set asm_power_limit=0;

SQL>alter diskgroup DATA add disk 'ORCL:DATA1';

Diskgroup altered.

SQL>alter diskgroup DATA rebalance power 11;

Diskgroup altered.

SQL>select * from v$asm_operation;

GROUP_NUMBEROPERATION       STATE             POWER     ACTUAL     SOFAR   EST_WORK   EST_RATE EST_MINUTES

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

ERROR_CODE

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

           1 REBAL           WAIT                 11

 

SQL>select group_number,disk_number,name,path,failgroup from v$asm_disk;

GROUP_NUMBERDISK_NUMBER NAME                          PATH                          FAILGROUP

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

           1           0                                    DATA                           ORCL:DATA                      DATA

           2           0                                    FRA                               ORCL:FRA                          FRA

           3           0                                    OCRVOTE                     ORCL:OCRVOTE                 OCRVOTE

           1           1                                    DATA1                          ORCL:DATA1                    DATA1

SQL>select group_number,name,state,type,total_mb,free_mb from v$asm_diskgroup;

GROUP_NUMBER NAME                           STATE                             TYPE                 TOTAL_MB    FREE_MB

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

           1                     DATA                           MOUNTED                      EXTERN                  21492     17998

           2                     FRA                              MOUNTED                       EXTERN                  20473       2399

           3                     OCRVOTE                    MOUNTED                      EXTERN                   1019        623

 

可以看到DATA磁盘组总容量和空闲容量由(20473,16981)变成了(21492,17998)

 1GDATA1磁盘已经加到DATA磁盘组中了。

 

 

 

 


你可能感兴趣的:(ASM,disk,diskgroup)