新增磁盘多连路磁盘并为ASM磁盘组扩容

1、先保留现有的多路径配置

#/sbin/multipath -ll | grep 3PARdata>/tmp/out

2、安装磁盘扫描插件(如果不存在的话)

#yum install sg3_utils

3、执行磁盘重新扫描,获取wwid(需要提前获取新增加的磁盘连路条数是否符合)

#rescan-scsi-bus.sh -l -w -c

4、逐一扫描磁盘

#for i in `cat /proc/partitions | awk '{print $4}' | grep sd`; do echo "### $i: `scsi_id -g -u  /dev/$i `"; done | sort -k 3 | awk '{print $NF}' | sort | uniq

5、对比两个文件差异即是新增的磁盘wwid

将新增的磁盘wwid添加到配置文件multipath.conf中

#diff /etc/multipath.conf multipath.conf

6、创建ASM需要的裸盘


[root@cnhkpgs10 mapper]# oracleasm createdisk DATA_DISK07 /dev/mapper/data_lun07

Writing disk header: done

Instantiating disk: done


[root@cnhkpgs10 mapper]# oracleasm createdisk DATA_DISK08 /dev/mapper/data_lun08

Writing disk header: done

Instantiating disk: done

[root@cnhkpgs10 mapper]# oracleasm createdisk DATA_DISK09 /dev/mapper/data_lun09

Writing disk header: done

Instantiating disk: done

7、扫描新增磁盘


[root@cnhkpgs11 disks]# oracleasm scandisks

Reloading disk partitions: done

Cleaning any stale ASM disks...

Scanning system for ASM disks...

Instantiating disk "DATA_DISK09"

Instantiating disk "DATA_DISK08"

Instantiating disk "DATA_DISK07"



[root@cnhkpgs10 mapper]# oracleasm listdisks

DATA_DISK01

DATA_DISK02

DATA_DISK03

DATA_DISK04

DATA_DISK05

DATA_DISK06

DATA_DISK07

DATA_DISK08

DATA_DISK09

OCRVD_DISK01

OCRVD_DISK02

OCRVD_DISK03


8、检查新增磁盘及权限


[root@cnhkpgs11 disks]# ls -lrt /dev/oracleasm/disks/

total 0

brw-rw---- 1 grid asmadmin 252, 11 Oct 25 17:03 DATA_DISK07

brw-rw---- 1 grid asmadmin 252,  9 Oct 25 17:04 DATA_DISK09

brw-rw---- 1 grid asmadmin 252, 10 Oct 25 17:04 DATA_DISK08

brw-rw---- 1 grid asmadmin 252,  7 Oct 25 17:06 DATA_DISK02

brw-rw---- 1 grid asmadmin 252,  0 Oct 25 17:06 OCRVD_DISK03

brw-rw---- 1 grid asmadmin 252,  1 Oct 25 17:06 OCRVD_DISK02

brw-rw---- 1 grid asmadmin 252,  2 Oct 25 17:06 OCRVD_DISK01

brw-rw---- 1 grid asmadmin 252,  5 Oct 25 17:06 DATA_DISK06

brw-rw---- 1 grid asmadmin 252,  4 Oct 25 17:06 DATA_DISK05

brw-rw---- 1 grid asmadmin 252,  3 Oct 25 17:06 DATA_DISK04

brw-rw---- 1 grid asmadmin 252,  8 Oct 25 17:06 DATA_DISK03

brw-rw---- 1 grid asmadmin 252,  6 Oct 25 17:06 DATA_DISK01


9、查询Oracle数据库中是否识别出新增的磁盘

SQL> select name,path,total_mb,free_mb,os_mb from v$asm_disk;


NAME                 PATH                                       TOTAL_MB    FREE_MB      OS_MB

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

DATADG_0002          /dev/oracleasm/disks/DATA_DISK03             102400      14927     102400

DATADG_0001          /dev/oracleasm/disks/DATA_DISK02             102400      14923     102400

DATADG_0000          /dev/oracleasm/disks/DATA_DISK01             102400      14919     102400

DATADG_0005          /dev/oracleasm/disks/DATA_DISK06             102400      14927     102400

DATADG_0004          /dev/oracleasm/disks/DATA_DISK05             102400      14917     102400

DATADG_0003          /dev/oracleasm/disks/DATA_DISK04             102400      14924     102400

OCRDG_0000           /dev/oracleasm/disks/OCRVD_DISK01              5120       4811       5120

OCRDG_0001           /dev/oracleasm/disks/OCRVD_DISK02              5120       4812       5120

OCRDG_0002           /dev/oracleasm/disks/OCRVD_DISK03              5120       4811       5120

                     /dev/oracleasm/disks/DATA_DISK08                  0          0     102400

                     /dev/oracleasm/disks/DATA_DISK09                  0          0     102400

                     /dev/oracleasm/disks/DATA_DISK07                  0          0     102400


12 rows selected.



10、将新增磁盘添加到ASM磁盘组中

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


NAME                              FREE_MB   TOTAL_MB

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

OCRDG                               14434      15360

DATADG                              89537     614400


SQL> select name,free_mb,total_mb^C


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


NAME                           PATH                                     FAILGROUP

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

                               /dev/oracleasm/disks/DATA_DISK07

                               /dev/oracleasm/disks/DATA_DISK09

                               /dev/oracleasm/disks/DATA_DISK08

DATADG_0002                    /dev/oracleasm/disks/DATA_DISK03         DATADG_0002

DATADG_0001                    /dev/oracleasm/disks/DATA_DISK02         DATADG_0001

DATADG_0000                    /dev/oracleasm/disks/DATA_DISK01         DATADG_0000

DATADG_0005                    /dev/oracleasm/disks/DATA_DISK06         DATADG_0005

DATADG_0004                    /dev/oracleasm/disks/DATA_DISK05         DATADG_0004

DATADG_0003                    /dev/oracleasm/disks/DATA_DISK04         DATADG_0003

OCRDG_0000                     /dev/oracleasm/disks/OCRVD_DISK01        OCRDG_0000

OCRDG_0001                     /dev/oracleasm/disks/OCRVD_DISK02        OCRDG_0001

OCRDG_0002                     /dev/oracleasm/disks/OCRVD_DISK03        OCRDG_0002


12 rows selected.


SQL> alter diskgroup DATADG add disk '/dev/oracleasm/disks/DATA_DISK07';


Diskgroup altered.

SQL> alter diskgroup DATADG add disk '/dev/oracleasm/disks/DATA_DISK08';    


Diskgroup altered.

SQL> alter diskgroup DATADG add disk '/dev/oracleasm/disks/DATA_DISK09';


Diskgroup altered.

SQL> select * from v$asm_operation;


GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE

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

           2 REBAL RUN           1          1       2238     170005       2999          55


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


NAME                              FREE_MB   TOTAL_MB

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

OCRDG                               14434      15360

DATADG                             396731     921600


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


NAME                           PATH                                     FAILGROUP

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

DATADG_0002                    /dev/oracleasm/disks/DATA_DISK03         DATADG_0002

DATADG_0001                    /dev/oracleasm/disks/DATA_DISK02         DATADG_0001

DATADG_0000                    /dev/oracleasm/disks/DATA_DISK01         DATADG_0000

DATADG_0005                    /dev/oracleasm/disks/DATA_DISK06         DATADG_0005

DATADG_0004                    /dev/oracleasm/disks/DATA_DISK05         DATADG_0004

DATADG_0003                    /dev/oracleasm/disks/DATA_DISK04         DATADG_0003

OCRDG_0000                     /dev/oracleasm/disks/OCRVD_DISK01        OCRDG_0000

OCRDG_0001                     /dev/oracleasm/disks/OCRVD_DISK02        OCRDG_0001

OCRDG_0002                     /dev/oracleasm/disks/OCRVD_DISK03        OCRDG_0002

DATADG_0007                    /dev/oracleasm/disks/DATA_DISK08         DATADG_0007

DATADG_0008                    /dev/oracleasm/disks/DATA_DISK09         DATADG_0008

DATADG_0006                    /dev/oracleasm/disks/DATA_DISK07         DATADG_0006


12 rows selected.


------------------------End TangYun[Tony.Tang]2016.10.26------------------------------------------------------

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29266954/viewspace-2127346/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29266954/viewspace-2127346/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值