先通过lsblk来查看集群两端磁盘是否扩容成功
lsblk -a
查看自己两边磁盘UUID是否相同(for i in 后面为磁盘sd后字母名)
for i in x y z aa ab ac ad ae
do
echo "KERNEL==\"sd*\", SUBSYSTEM==\"block\", PROGRAM==\"/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", SYMLINK=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done
mpath查看自己两边磁盘UUID是否相同
for i in f
do
echo "KERNEL==\"dm-*\", SUBSYSTEM==\"block\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/mapper/mpath$i`\""
done
两边添加绑定文件
vi /etc/udev/rules.d/99-oracle-asmdevices.rulesKERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604338910032ebd46348494100000350", SYMLINK="asmdat2", OWNER="grid", GROUP="asmadmin", MODE="0660"KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604338910032ebd4109017e200000209", SYMLINK="asm-diski", OWNER="grid", GROUP="asmadmin", MODE="0660"
两边编辑绑定文件后,依次执行以下命令
/sbin/udevadm control --reload
/sbin/udevadm trigger --type=devices --action=change
执行后检查两边的磁盘权限属组情况
su - grid
crsctl stat res -t ll /dev/sd*
ll /dev/asm* --注意权限&属组ll /dev/sd*
[grid@DCSHDYDB01 ~]$ kfod
--------------------------------------------------------------------------------Disk Size Path User Group
================================================================================1: 102400 MB /dev/sds grid asmadmin2: 102400 MB /dev/sdt grid asmadmin3: 102400 MB /dev/sdu grid asmadmin4: 102400 MB /dev/sdv grid asmadmin5: 102400 MB /dev/sdw grid asmadmin
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME
================================================================
检查所加diskgroup名称,diskstring形式
sqlplus / as sysasm
SQL> show parameter asm NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string DATA, FRA --注意diskgroup名称
asm_diskstring string /dev/asm* --注意磁盘格式
asm_power_limit integer 1
asm_preferred_read_failure_groups string
添加磁盘到DATA磁盘组中
alter diskgroup DATA add disk '/dev/asmdat3','/dev/asmdat4' rebalance power 4;
查看ASM磁盘rebalance情况
[grid@DCSHDYDB01 ~]$ sqlplus / as sysasmSQL> select * from v$asm_operation;GROUP_NUMBER OPERATION PASS STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE CON_ID
------------ ---------- ------------------ -------- ---------- ---------- ---------- ---------- ---------- ----------- -------------------- ----------1 REBAL COMPACT WAIT 8 8 0 0 0 0 01 REBAL REBALANCE RUN 8 8 76689 87959 27132 0 01 REBAL REBUILD DONE 8 8 0 0 0 0 0SQL> /GROUP_NUMBER OPERATION PASS STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE CON_ID
------------ ---------- ------------------ -------- ---------- ---------- ---------- ---------- ---------- ----------- -------------------- ----------1 REBAL COMPACT RUN 8 8 61484 0 25354 0 01 REBAL REBALANCE DONE 8 8 87959 87959 0 0 01 REBAL REBUILD DONE 8 8 0 0 0 0 0
SQL> col path for a30
SQL> l1* select GROUP_NUMBER,DISK_NUMBER,STATE,OS_MB,NAME,PATH from v$asm_disk
SQL> /GROUP_NUMBER DISK_NUMBER STATE OS_MB NAME PATH
------------ ----------- ---------------- ---------- ------------------------------------------------------------ ------------------------------2 0 NORMAL 107137 FRA_0000 /dev/asm-diske1 0 NORMAL 107137 DATA_0000 /dev/asm-diskd3 2 NORMAL 10713 OCR_0002 /dev/asm-diskc3 1 NORMAL 10713 OCR_0001 /dev/asm-diskb3 0 NORMAL 10713 OCR_0000 /dev/asm-diska1 1 NORMAL 107137 DATA_0001 /dev/asm-diskf1 3 NORMAL 107137 DATA_0003 /dev/asm-diskh1 2 NORMAL 107137 DATA_0002 /dev/asm-diskg1 5 NORMAL 107137 DATA_0005 /dev/asm-diskj1 4 NORMAL 107137 DATA_0004 /dev/asm-diski10 rows selected.
ASM磁盘rebalance后检看ASM磁盘空间情况
[grid@DCSHP2BDB01 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN Y 512 4096 4194304 428544 254540 0 254540 0 N DATA/
MOUNTED NORMAL N 512 4096 1048576 32139 31213 10713 10250 0 Y DGOCR/
MOUNTED EXTERN N 512 4096 1048576 107137 102995 0 102995 0 N FRA/
ASM磁盘rebalance后检查数据库集群状态
[grid@DCSHP2BDB01 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dgONLINE ONLINE dcshp2bdb01 ONLINE ONLINE dcshp2bdb02
ora.DGOCR.dgONLINE ONLINE dcshp2bdb01 ONLINE ONLINE dcshp2bdb02
ora.FRA.dgONLINE ONLINE dcshp2bdb01 ONLINE ONLINE dcshp2bdb02
ora.LISTENER.lsnrONLINE ONLINE dcshp2bdb01 ONLINE ONLINE dcshp2bdb02
ora.asmONLINE ONLINE dcshp2bdb01 Started ONLINE ONLINE dcshp2bdb02 Started
ora.gsdOFFLINE OFFLINE dcshp2bdb01 OFFLINE OFFLINE dcshp2bdb02
ora.net1.networkONLINE ONLINE dcshp2bdb01 ONLINE ONLINE dcshp2bdb02
ora.onsONLINE ONLINE dcshp2bdb01 ONLINE ONLINE dcshp2bdb02
ora.registry.acfsONLINE ONLINE dcshp2bdb01 ONLINE ONLINE dcshp2bdb02
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr1 ONLINE ONLINE dcshp2bdb02
ora.cvu1 ONLINE ONLINE dcshp2bdb02
ora.dcshp2bdb01.vip1 ONLINE ONLINE dcshp2bdb01
ora.dcshp2bdb02.vip1 ONLINE ONLINE dcshp2bdb02
ora.klborcl.db1 ONLINE ONLINE dcshp2bdb01 Open 2 ONLINE ONLINE dcshp2bdb02 Open
ora.oc4j1 ONLINE ONLINE dcshp2bdb02
ora.scan1.vip1 ONLINE ONLINE dcshp2bdb02