共计 6063 个字符,预计需要花费 16 分钟才能阅读完成。
新增磁盘多连路磁盘并为 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.
更多 Oracle 相关信息见 Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-10/136564.htm