查当前使用情况
select STATE,NAME,PATH from v$asm_disk;
STATE NAME PATH
-------- ------------------------------ --------------------
NORMAL VDKBACK ORCL:VDKBACK
NORMAL VDKDATA ORCL:VDKDATA
NORMAL VDKOCR1 ORCL:VDKOCR1
SQL> select name from v$asm_diskgroup;
NAME
------------------------------
BACKUP
DATA
OCR
增加设备、分区
fdisk -l
fdisk /dev/sde
fdisk /dev/sdf
使用asmlib方式创建oracle asm磁盘
service oracleasm listdisks
VDKBACK
VDKDATA
VDKOCR1
service oracleasm createdisk VDKARCH /dev/sde1
service oracleasm createdisk VDKDATA1 /dev/sdf1
在两个节点,对新添加的磁盘进行扫描
[root@gzxkdb1 ~]# service oracleasm scandisks //节点1上完成扫描磁盘
[root@gzxkdb1 ~]# service oracleasm listdisks
[root@gzxkdb2 ~]# service oracleasm scandisks //节点2上完成扫描磁盘
[root@gzxkdb2 ~]# service oracleasm listdisks
在节点1,用sysasm用户进行登录实例
[grid@gzxkdb1 ~]$ sqlplus '/as sysasm'
SQL> select STATE,NAME,PATH from v$asm_disk;
STATE NAME PATH
-------- ------------------------------ --------------------
NORMAL ORCL:VDKARCH
NORMAL ORCL:VDKDATA1
NORMAL VDKBACK ORCL:VDKBACK
NORMAL VDKDATA ORCL:VDKDATA
NORMAL VDKOCR1 ORCL:VDKOCR1
扩容ASM磁盘组
POWER子句中指定一个从0到11的值,其中0停止再平衡操作,11允许自动存储管理尽可能快地执行再平衡。在POWER子句中指定的值默认为ASM_POWER_LIMIT初始化参数的值。
备注:此处必须以sysasm身份操作,否则会提示ORA-15032和ORA-15260错误
有些文档使用/dev/oracleasm/disks/DATA6这种方式,具体查看v$asm_disk中的path即可,都是asmlib方式的path表达
SQL> alter diskgroup DATA add disk 'ORCL:VDKDATA1' rebalance 10;
Diskgroup altered.
SQL> select * from v$asm_operation;
SQL> select * from v$asm_operation;
GROUP_NUMBER OPERA STAT POWER ACTUAL SOFAR EST_WORK EST_RATE
------------ ----- ---- ---------- ---------- ---------- ---------- ----------
EST_MINUTES ERROR_CODE
----------- --------------------------------------------
1 REBAL WAIT 2
查询rebalance进度,没有记录说明完毕
SQL> select * from v$asm_operation;
no rows selected
改回默认power值
SQL> alter diskgroup BACKUP rebalance power 1;
Diskgroup altered.
新建一个diskgroup用于存放archivelog
create diskgroup arch external redundancy disk 'ORCL:VDKARCH' ;
查询结果
SQL> select name from v$asm_diskgroup;
NAME
------------------------------
BACKUP
DATA
OCR
ARCH
SQL> select STATE,NAME,PATH from v$asm_disk;
STATE NAME PATH
-------- ------------------------------ --------------------
NORMAL VDKBACK ORCL:VDKBACK
NORMAL VDKDATA ORCL:VDKDATA
NORMAL VDKOCR1 ORCL:VDKOCR1
NORMAL VDKDATA1 ORCL:VDKDATA1
NORMAL VDKARCH ORCL:VDKARCH