AIX下创建ASM磁盘组
Posted renfengjun
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AIX下创建ASM磁盘组相关的知识,希望对你有一定的参考价值。
创建过程
hdisk8 还未被使用,是本次需要添加的磁盘组的磁盘
第一个节点:$ ls -l /dev/erp*
crw-rw---- 1 oracle dba 23, 7 Jun 16 17:48 /dev/erp_asm1
crw-rw---- 1 oracle dba 23, 5 Jun 16 17:48 /dev/erp_asm2
crw-r----- 1 root oinstall 23, 4 Jun 16 15:33 /dev/erp_ocr1
crw-r--r-- 1 oracle oinstall 23, 6 Jun 16 17:48 /dev/erp_vote1
第二个节点:
# ls -l /dev/erp*
crw-rw---- 1 oracle dba 26, 7 Jun 16 17:35 /dev/erp_asm1
crw-rw---- 1 oracle dba 26, 4 Jun 16 14:17 /dev/erp_asm2
crw-r----- 1 root oinstall 26, 5 Jun 22 2015 /dev/erp_ocr1
crw-r--r-- 1 oracle oinstall 26, 6 Jun 16 18:02 /dev/erp_vote1
第一个节点:
$ ls -l /dev/hdisk*
brw------- 1 root system 23, 3 Jun 15 2015 /dev/hdisk0
brw------- 1 root system 23, 0 Jun 15 2015 /dev/hdisk1
brw------- 1 root system 23, 1 Mar 24 2016 /dev/hdisk2
brw------- 1 root system 23, 2 Jun 15 2015 /dev/hdisk3
brw------- 1 root system 23, 4 Jun 17 2015 /dev/hdisk4
brw------- 1 root system 23, 6 Jun 17 2015 /dev/hdisk5
brw------- 1 root system 23, 7 Jun 17 2015 /dev/hdisk6
brw------- 1 root system 23, 5 Jun 17 2015 /dev/hdisk7
brw------- 1 root system 23, 8 Jun 16 11:17 /dev/hdisk8
第二个节点:
# ls -l /dev/hdisk*
brw------- 1 root system 26, 1 Jun 13 2015 /dev/hdisk0
brw------- 1 root system 26, 3 Jun 13 2015 /dev/hdisk1
brw------- 1 root system 26, 0 Jun 13 2015 /dev/hdisk2
brw------- 1 root system 26, 2 Jun 13 2015 /dev/hdisk3
brw------- 1 root system 26, 5 Jun 22 2015 /dev/hdisk4
brw------- 1 root system 26, 6 Jun 22 2015 /dev/hdisk5
brw------- 1 root system 26, 7 Jun 22 2015 /dev/hdisk6
brw------- 1 root system 26, 4 Jun 22 2015 /dev/hdisk7
brw------- 1 root system 26, 8 Jun 16 17:58 /dev/hdisk8
确认磁盘大小(两个节点相同)
$ getconf DISK_SIZE /dev/hdisk8
204800
为200GB
查看磁盘属性(确定设备号)
第一个节点:
$ ls -l /dev/rhdisk8
crw------- 1 root system 23, 8 Jun 16 11:17 /dev/rhdisk8
第二个节点:
# ls -l /dev/rhdisk8
crw------- 1 root system 26, 8 Jun 16 17:58 /dev/rhdisk8
原有的磁盘属性(两节点相同)
$ lsattr -El hdisk7
PCM PCM/friend/hitachifcp N/A True
PR_key_value 0x2f6fea44c Reserve Key True
algorithm round_robin N/A True
clr_q no Device CLEARS its Queue on error True
dvc_support N/A False
location Location Label True
lun_id 0x3000000000000 Logical Unit Number ID False
max_transfer 0x40000 Maximum TRANSFER Size True
node_name 0x50060e8007c59525 FC Node Name False
pvid none Physical Volume ID False
q_err yes Use QERR bit False
q_type simple Queue TYPE True
queue_depth 16 Queue DEPTH True
reassign_to 120 REASSIGN time out True
reserve_policy no_reserve Reserve Policy True
rw_timeout 60 READ/WRITE time out True
scsi_id 0x7c0301 SCSI ID False
start_timeout 60 START UNIT time out True
ww_name 0x50060e8007c59525 FC World Wide Name False
设置磁盘属性(两个节点执行)
chdev -l hdisk8 -a rw_timeout=60
chdev -l hdisk8 -a reserve_policy=no_reserve
chdev -l hdisk8 -a queue_depth=16
# chdev -l hdisk8 -a rw_timeout=60
hdisk8 changed
# chdev -l hdisk8 -a reserve_policy=no_reserve
hdisk8 changed
# chdev -l hdisk8 -a queue_depth=16
hdisk8 changed
# lsattr -El hdisk8
PCM PCM/friend/hitachifcp N/A True
PR_key_value 0x1c3bb254c Reserve Key True
algorithm round_robin N/A True
clr_q no Device CLEARS its Queue on error True
dvc_support N/A False
location Location Label True
lun_id 0x4000000000000 Logical Unit Number ID False
max_transfer 0x40000 Maximum TRANSFER Size True
node_name 0x50060e8007c59535 FC Node Name False
pvid none Physical Volume ID False
q_err yes Use QERR bit False
q_type simple Queue TYPE True
queue_depth 16 Queue DEPTH True
reassign_to 120 REASSIGN time out True
reserve_policy no_reserve Reserve Policy True
rw_timeout 60 READ/WRITE time out True
scsi_id 0x150322 SCSI ID False
start_timeout 60 START UNIT time out True
ww_name 0x50060e8007c59535 FC World Wide Name False
创建别名
第一个节点:
mknod /dev/erp_asm3 c 23 8
第二个节点
mknod /dev/erp_asm3 c 26 8
修改磁盘权限
chown oracle:oinstall /dev/erp_asm3
chmod 660 /dev/erp_asm3
节点1
# ls -l /dev/erp_asm3
crw-rw---- 1 oracle oinstall 23, 8 Jun 16 18:16 /dev/erp_asm3
# ls -l /dev/hdisk8
brw------- 1 root system 23, 8 Jun 16 11:17 /dev/hdisk8
节点2
# ls -l /dev/erp_asm3
crw-rw---- 1 oracle oinstall 26, 8 Jun 16 18:16 /dev/erp_asm3
# ls -l /dev/hdisk8
brw------- 1 root system 26, 8 Jun 16 17:58 /dev/hdisk8
使用create diskgroup 语句
SQL> create diskgroup DATA2 External REDUNDANCY DISK '/dev/erp_asm3';
Diskgroup created.
两个节点一致
SQL> select name , state from v$asm_diskgroup ;
NAME STATE
------------------------------ -----------
DATA MOUNTED
RECO MOUNTED
DATA2 MOUNTED
其他内容
备份磁盘头信息
su - oracle
$cd $ORACLE_HOME/rdbms/lib
$make -f ins_rdbms.mk ikfed
$cd /u01/app/oracle/
$kfed read /dev/tds_asm1 > hdisk4_tdsasm1_header.txt
如果拓容已有的磁盘组可以用如下命令
SQL>alter diskgroup DATA add disk '/dev/erp_asm3' rebalance power 3;
查看视图可以看到rebalance的过程
SQL>select * from v$asm_operation;以上是关于AIX下创建ASM磁盘组的主要内容,如果未能解决你的问题,请参考以下文章
aix下oracle 12.1.0.2 asmca不能打开的故障
案例:Oracle非常规恢复 ASM磁盘组diskgroup被删除使用kfed进行完美恢复
转自官网INS-30508 Invalid ASM Disks on Grid Infrastructure Installation (文档 ID 1999903.1)