1、AIX系统添加两块硬盘hdisk17,hdisk18,并进行配置。
1)给磁盘分配pvid
外部存储设备中的同一块硬盘在不同节点上的名称可能会不同。同一个硬盘在节点一中的名称可能是hdisk4,在节点二中的名称可能是hdisk5.虽然ASM实例能正确识别这样的硬盘,但对于管理员来说可能会产生歧义。不管怎样,这块硬盘有一个不变的属性是PVID,无论在节点一还是节点二下都是一样的。通过下面的命令可以产生硬盘的PVID
chdev -l hdisk17 -a pv=yes
chdev -l hdisk18 -a pv=yes
2)修改磁盘权限
本项目使用ASM,需要指定ASM磁盘中所要包含的磁盘,并保证grid用户有对这些磁盘的写权限
修改磁盘属组
chown grid:asmadmin /dev/rhdisk17
chown grid:asmadmin /dev/rhdisk18
修改磁盘权限
chmod 660 /dev/rhdisk17
chmod 660 /dev/rhdisk18
3)检查磁盘属性
有些型号的存储设别具有reserve_lock或者reserve_policy属性,这两个属性的存在会阻止多个节点对存储设备进行并行读写,所以在安装集群软件之前应该对其属性进行修改。
lsattr -E -l hdisk17|grep reserve_
lsattr -E -l hdisk18|grep reserve_
4)设置磁盘属性为reserve_lock=no或reserve_policy=no_reserve
chdev -l hdisk17 -a reserve_policy=no_reserve
chdev -l hdisk18 -a reserve_policy=no_reserve
5)清除磁盘pvid
通过PVID可以在不同节点中对比、确认同一块硬盘,但是在安装集群软件之前应该在每个节点上将PVID清除掉,否则在安装过程中可能会出现错误。
chdev -l hdisk17 -a pv=clear
chdev -l hdisk18 -a pv=clear
2、现有磁盘组添加磁盘。
#su - grid
$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Fri May 5 10:44:30 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> select GROUP_NUMBER,NAME,TYPE,TOTAL_MB,FREE_MB from v$asm_diskgroup;
GROUP_NUMBER NAME TYPE TOTAL_MB FREE_MB
------------ ------------------------------ ------ ---------- ----------
1 CRS NORMAL 6144 5218
2 DATA EXTERN 6144000 6141937
SQL> select GROUP_NUMBER,DISK_NUMBER,NAME,FAILGROUP,FAILGROUP,PATH,STATE from v$asm_disk;
GROUP_NUMBER DISK_NUMBER NAME FAILGROUP FAILGROUP PATH STATE
------------ ----------- ------------------------------ ------------------------------ --------------------
2 0 DATA_0000 DATA_0000 DATA_0000 /dev/rhdisk10 NORMAL
2 1 DATA_0001 DATA_0001 DATA_0001 /dev/rhdisk11 NORMAL
2 2 DATA_0002 DATA_0002 DATA_0002 /dev/rhdisk12 NORMAL
2 3 DATA_0003 DATA_0003 DATA_0003 /dev/rhdisk13 NORMAL
2 4 DATA_0004 DATA_0004 DATA_0004 /dev/rhdisk14 NORMAL
2 5 DATA_0005 DATA_0005 DATA_0005 /dev/rhdisk15 NORMAL
2 6 DATA_0006 DATA_0006 DATA_0006 /dev/rhdisk16 NORMAL
1 0 CRS_0000 CRS_0000 CRS_0000 /dev/rhdisk2 NORMAL
1 1 CRS_0001 CRS_0001 CRS_0001 /dev/rhdisk3 NORMAL
1 2 CRS_0002 CRS_0002 CRS_0002 /dev/rhdisk4 NORMAL
2 7 DATA_0007 DATA_0007 DATA_0007 /dev/rhdisk5 NORMAL
GROUP_NUMBER DISK_NUMBER NAME FAILGROUP FAILGROUP PATH STATE
------------ ----------- ------------------------------ ------------------------------ --------------------
2 8 DATA_0008 DATA_0008 DATA_0008 /dev/rhdisk6 NORMAL
2 9 DATA_0009 DATA_0009 DATA_0009 /dev/rhdisk7 NORMAL
2 10 DATA_0010 DATA_0010 DATA_0010 /dev/rhdisk8 NORMAL
2 11 DATA_0011 DATA_0011 DATA_0011 /dev/rhdisk9 NORMAL NORMAL
17 rows selected.
SQL> alter diskgroup DATA add disk '/dev/rhdisk17';
Diskgroup altered.
SQL> alter diskgroup DATA add disk '/dev/rhdisk18';
Diskgroup altered.
SQL> select GROUP_NUMBER,NAME,TYPE,TOTAL_MB,FREE_MB from v$asm_diskgroup;
GROUP_NUMBER NAME TYPE TOTAL_MB FREE_MB
------------ ------------------------------ ------ ---------- ----------
1 CRS NORMAL 6144 5218
2 DATA EXTERN 7168000 7165915
SQL> select GROUP_NUMBER,DISK_NUMBER,NAME,FAILGROUP,FAILGROUP,PATH,STATE from v$asm_disk;
GROUP_NUMBER DISK_NUMBER NAME FAILGROUP FAILGROUP PATH STATE
------------ ----------- ------------------------------ ------------------------------ --------------------
2 0 DATA_0000 DATA_0000 DATA_0000 /dev/rhdisk10 NORMAL
2 1 DATA_0001 DATA_0001 DATA_0001 /dev/rhdisk11 NORMAL
2 2 DATA_0002 DATA_0002 DATA_0002 /dev/rhdisk12 NORMAL
2 3 DATA_0003 DATA_0003 DATA_0003 /dev/rhdisk13 NORMAL
2 4 DATA_0004 DATA_0004 DATA_0004 /dev/rhdisk14 NORMAL
2 5 DATA_0005 DATA_0005 DATA_0005 /dev/rhdisk15 NORMAL
2 6 DATA_0006 DATA_0006 DATA_0006 /dev/rhdisk16 NORMAL
1 0 CRS_0000 CRS_0000 CRS_0000 /dev/rhdisk2 NORMAL
1 1 CRS_0001 CRS_0001 CRS_0001 /dev/rhdisk3 NORMAL
1 2 CRS_0002 CRS_0002 CRS_0002 /dev/rhdisk4 NORMAL
2 7 DATA_0007 DATA_0007 DATA_0007 /dev/rhdisk5 NORMAL
GROUP_NUMBER DISK_NUMBER NAME FAILGROUP FAILGROUP PATH STATE
------------ ----------- ------------------------------ ------------------------------ --------------------
2 8 DATA_0008 DATA_0008 DATA_0008 /dev/rhdisk6 NORMAL
2 9 DATA_0009 DATA_0009 DATA_0009 /dev/rhdisk7 NORMAL
2 10 DATA_0010 DATA_0010 DATA_0010 /dev/rhdisk8 NORMAL
2 11 DATA_0011 DATA_0011 DATA_0011 /dev/rhdisk9 NORMAL
2 12 DATA_0012 DATA_0012 DATA_0012 /dev/rhdisk17 NORMAL
2 13 DATA_0013 DATA_0013 DATA_0013 /dev/rhdisk18 NORMAL
17 rows selected.
添加完磁盘之后,oracle会自动做重平衡rebalance操作,可以通过视图查看(数据量很大时,可通过师视图查出信息)。SQL> select * from v$asm_operation;
no nows selected
SQL>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。