LINUX 11G RAC ASM磁盘组在线增加磁盘扩容(转)
原文:https://blog.csdn.net/evils798/article/details/8204022
https://www.cnblogs.com/andy6/p/6013463.html
为防失效,内容也转过来了
LINUX 11G RAC ASM磁盘组在线增加磁盘扩容 1.操作系统版本 OEL 6.1 [root@cqltjcpt1 ~]# more /etc/redhat-release Red Hat Enterprise Linux Server release 6.1 (Santiago) 2.数据库版本 oracle 11g rac SQL> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.2.0.3.0 - Production CORE 11.2.0.3.0 Production TNS for Linux: Version 11.2.0.3.0 - Production NLSRTL Version 11.2.0.3.0 - Production 3.存储环境VMWARE exsi5.0虚拟EMC存储 4.在节点1,2上查看所有系统磁盘 [root@cqltjcpt1 ~]# fdisk -l | grep sd* Disk /dev/sda: 128.8 GB, 128849018880 bytes /dev/sda1 * 1 14 103424 83 Linux /dev/sda2 14 4191 33554432 82 Linux swap / Solaris /dev/sda3 4191 15666 92170240 8e Linux LVM Disk /dev/sdb: 2147 MB, 2147483648 bytes /dev/sdb1 1 261 2096451 83 Linux Disk /dev/sdc: 2147 MB, 2147483648 bytes /dev/sdc1 1 261 2096451 83 Linux Disk /dev/sdd: 2147 MB, 2147483648 bytes /dev/sdd1 1 261 2096451 83 Linux Disk /dev/sde: 536.9 GB, 536870912000 bytes /dev/sde1 1 65270 524281243+ 83 Linux Disk /dev/sdf: 536.9 GB, 536870912000 bytes /dev/sdf1 1 65270 524281243+ 83 Linux Disk /dev/sdg: 536.9 GB, 536870912000 bytes /dev/sdg1 1 65270 524281243+ 83 Linux Disk /dev/sdh: 214.7 GB, 214748364800 bytes Disk /dev/sdi: 107.4 GB, 107374182400 bytes 5.当前系统硬盘为sda到sdi,现在需要增加一块500G的共享硬盘,来扩容ASM磁盘组,增加新硬盘后系统识别应为sdj 查看伪文件系统下的/proc/scsi/scsi文件有scsi1,scsi2,scsi3 三个通道 [root@cqltjcpt1 ~]# more /proc/scsi/scsi Attached devices: Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00 Type: CD-ROM ANSI SCSI revision: 05 Host: scsi2 Channel: 00 Id: 00 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi3 Channel: 00 Id: 00 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi3 Channel: 00 Id: 01 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi3 Channel: 00 Id: 02 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi3 Channel: 00 Id: 03 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi3 Channel: 00 Id: 04 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi3 Channel: 00 Id: 05 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi3 Channel: 00 Id: 06 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi3 Channel: 00 Id: 08 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 6.在节点1,2执行echo 命令, [root@cqltjcpt1 ~]# echo "- - -" > /sys/class/scsi_host/host3/scan 当前的最大ID号为08,执行完echo命令后,系统的/proc/scsi/scsi文件下会出现ID为09的标识号 如下: Host: scsi3 Channel: 00 Id: 09 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 7.分别在节点1,2查看/proc/scsi/scsi文件,此时节点1,2已识别到 Host: scsi3 Channel: 00 Id: 09 Lun: 00 [root@cqltjcpt1 ~]# more /proc/scsi/scsi | grep 09 Host: scsi3 Channel: 00 Id: 09 Lun: 00 [root@cqltjcpt2 ~]# more /proc/scsi/scsi | grep 09 Host: scsi3 Channel: 00 Id: 09 Lun: 00 8.在节点1上对sdj分区 [root@cqltjcpt1 ~]#fdisk /dev/sdj [root@cqltjcpt1 ~]#partprobe 9.节点1,2查看sdj1分区,以后成功识别 [root@cqltjcpt1 ~]# fdisk -l | grep sdj Disk /dev/sdj: 536.9 GB, 536870912000 bytes /dev/sdj1 1 65270 524281243+ 83 Linux [root@cqltjcpt2 ~]# fdisk -l | grep sdj Disk /dev/sdj: 536.9 GB, 536870912000 bytes /dev/sdj1 10.节点1上用grid用户登录,查看当前ASM磁盘组 [root@cqltjcpt1 ~]#su - grid 查看asm磁盘组 [grid@cqltjcpt1 ~]$sqlplus / as sysasm SQL> select group_number,name,TOTAL_MB, FREE_MB from v$asm_diskgroup GROUP_NUMBER NAME TOTAL_MB FREE_MB ------------ ----------------- ---------- ---------- 1 CQDATA 1547972 525323 2 FRA 511993 477058 3 OCR 6141 5741 11.查看asm磁盘 [root@cqltjcpt1 ~]# oracleasm listdisks DATA1 DATA2 FRA OCR_VOT1 OCR_VOT2 OCR_VOT3 12.现在是要将500G的磁盘扩容到CQDATA的ASM的磁盘组中去 首先需要创建新的ASM磁盘 节点1上执行 [root@cqltjcpt1 ~]#oracleasm createdisk DATA3 /dev/sdj1 [root@cqltjcpt1 ~]#oracleasm scandisks [root@cqltjcpt1 ~]#oracleasm listdisks DATA1 DATA2 DATA3 FRA OCR_VOT1 OCR_VOT2 OCR_VOT3 节点2上执行 [root@cqltjcpt2 ~]# oracleasm scandisks Reloading disk partitions: done Cleaning any stale ASM disks... Scanning system for ASM disks... [root@cqltjcpt2 ~]#oracleasm listdisks DATA1 DATA2 DATA3 FRA OCR_VOT1 OCR_VOT2 OCR_VOT3 此时,节点1,2都已经识别到新的ASM磁盘DATA3 13.节点1执行,查看ASM磁盘,确定PATH [root@cqltjcpt1 ~]# su - grid [grid@cqltjcpt1 ~]$ sqlplus / as sysasm SQL> select name, path, mode_status, state, disk_number,failgroup from v$asm_disk; NAME PATH MODE_STATUS STATE DISK_NUMBER FAILGROUP -------- ------------------ -------------- ----------- ----------- ---------- DATA1 ORCL:DATA1 ONLINE NORMAL 0 DATA1 DATA2 ORCL:DATA2 ONLINE NORMAL 1 DATA2 DATA3 ORCL:DATA3 ONLINE NORMAL 2 DATA3 FRA ORCL:FRA ONLINE NORMAL 0 FRA OCR_VOT1 ORCL:OCR_VOT1 ONLINE NORMAL 0 OCR_VOT1 OCR_VOT2 ORCL:OCR_VOT2 ONLINE NORMAL 1 OCR_VOT2 14.在节点1上,grid用户已sysasm登录ASM实例,给CQDATA磁盘组增加新的ASM磁盘DATA3 SQL> alter diskgroup CQDATA add disk 'ORCL:DATA3' rebalance power 10; GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE ------------ ---------- -------- ---------- ---------- ---------- ---------- ---------- ----------- ---------- 1 REBAL RUN 1 1 130396 340324 1224 171 查看当前reblance 时间,500G 需要1小时左右 SQL>select * from v$asm_opration; GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE ------------ ---------- -------- ---------- ---------- ---------- ---------- ---------- ----------- ------------------------------ 1 REBAL RUN 1 1 13327 332978 1242 57 15.当查询v$asm_operation时无数据输出时,意味着ASM的reblance动作结束 SQL> select * from v$asm_operation; no rows selected 修改reblance 参数为默认 SQL> ALTER DISKGROUP DATA1 REBALANCE POWER 1; 16.在节点1,2上分别查询,以下结果 SQL> SELECT,NAME,FREE_MB,TOTAL_MB FROM V$ASM_DISKGROUP NAME FREE_MB TOTAL_MB -------------------- ---------- ---------- CQDATA 1025323 2047972 FRA 477058 511993 OCR 5741 6141 CQDATA磁盘组已经成功完成扩容 本文基于VMware下测试,存储多路径问题在本实验已被vmware忽略,若有遗漏或不明处欢迎拍砖