1、AIX系統(tǒng)添加兩塊硬盤hdisk17,hdisk18,并進(jìn)行配置。
成都創(chuàng)新互聯(lián)是一家專注于成都做網(wǎng)站、成都網(wǎng)站設(shè)計(jì)與策劃設(shè)計(jì),平羅網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)十多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:平羅等地區(qū)。平羅做網(wǎng)站價(jià)格咨詢:13518219792
1)給磁盤分配pvid
外部存儲(chǔ)設(shè)備中的同一塊硬盤在不同節(jié)點(diǎn)上的名稱可能會(huì)不同。同一個(gè)硬盤在節(jié)點(diǎn)一中的名稱可能是hdisk4,在節(jié)點(diǎn)二中的名稱可能是hdisk5.雖然ASM實(shí)例能正確識(shí)別這樣的硬盤,但對(duì)于管理員來說可能會(huì)產(chǎn)生歧義。不管怎樣,這塊硬盤有一個(gè)不變的屬性是PVID,無論在節(jié)點(diǎn)一還是節(jié)點(diǎn)二下都是一樣的。通過下面的命令可以產(chǎn)生硬盤的PVID
chdev -l hdisk17 -a pv=yes
chdev -l hdisk18 -a pv=yes
2)修改磁盤權(quán)限
本項(xiàng)目使用ASM,需要指定ASM磁盤中所要包含的磁盤,并保證grid用戶有對(duì)這些磁盤的寫權(quán)限
修改磁盤屬組
chown grid:asmadmin /dev/rhdisk17
chown grid:asmadmin /dev/rhdisk18
修改磁盤權(quán)限
chmod 660 /dev/rhdisk17
chmod 660 /dev/rhdisk18
3)檢查磁盤屬性
有些型號(hào)的存儲(chǔ)設(shè)別具有reserve_lock或者reserve_policy屬性,這兩個(gè)屬性的存在會(huì)阻止多個(gè)節(jié)點(diǎn)對(duì)存儲(chǔ)設(shè)備進(jìn)行并行讀寫,所以在安裝集群軟件之前應(yīng)該對(duì)其屬性進(jìn)行修改。
lsattr -E -l hdisk17|grep reserve_
lsattr -E -l hdisk18|grep reserve_
4)設(shè)置磁盤屬性為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可以在不同節(jié)點(diǎn)中對(duì)比、確認(rèn)同一塊硬盤,但是在安裝集群軟件之前應(yīng)該在每個(gè)節(jié)點(diǎn)上將PVID清除掉,否則在安裝過程中可能會(huì)出現(xiàn)錯(cuò)誤。
chdev -l hdisk17 -a pv=clear
chdev -l hdisk18 -a pv=clear
2、現(xiàn)有磁盤組添加磁盤。
#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會(huì)自動(dòng)做重平衡rebalance操作,可以通過視圖查看(數(shù)據(jù)量很大時(shí),可通過師視圖查出信息)。SQL> select * from v$asm_operation;
no nows selected
SQL>