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

新增磁盘多连路磁盘并为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;

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/a44ee625d4add8e45681a9401fd6dda9.html