本文主要是介绍AIX小机环境如何给ASM添加磁盘,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
前面几篇介绍了HPUX,Solaris平台上RAC集群ASM如何添加磁盘的 ,三大UNIX平台只差AIX,本文介绍AIX平台RAC 添加ASM磁盘
environment:
AIX 6.1 + oracle 10.0.2.4
2 nodes RAC (storage HP-6100 FC disk)
1. 存储划盘,并将盘赋予集群两个节点主机
2. 主机上发现新建磁盘
sfc3rac2:/# lspv --show physical volume
hdisk0 00c8cb525e033ad7 rootvg active
hdisk1 00c8ce2214eb01b4 rootvg active
hdisk2 none None
hdisk3 none None
hdisk4 none None
hdisk5 none None
hdisk6 none None
hdisk7 none None
hdisk8 none None
hdisk9 none None
sfc3rac2:/# cfgmgr --find the new disk
cfgmgr: 0514-621 WARNING: The following device packages are required for
device support but are not currently installed.
devices.fcp.array
devices.fcp.changer
sfc3rac2:/# lspv
hdisk0 00c8cb525e033ad7 rootvg active
hdisk1 00c8ce2214eb01b4 rootvg active
hdisk2 none None
hdisk3 none None
hdisk4 none None
hdisk5 none None
hdisk6 none None
hdisk7 none None
hdisk8 none None
hdisk9 none None
hdisk10 none None -- new disk
sfc3rac2:/#
sfc3rac2:/# lsattr -El hdisk10
PCM PCM/friend/hsvpcm Path Control Module False
PR_key_value none Persistant Reserve Key Value True
algorithm fail_over Algorithm True
hcheck_cmd test_unit_rdy Health Check Command True
hcheck_interval 60 Health Check Interval True
hcheck_mode nonactive Health Check Mode True
location Location Label True
lun_id 0x9000000000000 Logical Unit Number ID False
lun_reset_spt yes SCSI LUN reset True
max_transfer 0x40000 Maximum TRANSFER Size True
node_name 0x50001fe1500e5610 FC Node Name False
pvid none Physical volume identifier False
q_type simple Queuing TYPE True
queue_depth 8 Queue DEPTH True
reserve_policy single_path Reserve Policy True
rw_timeout 60 READ/WRITE time out value True
scsi_id 0x10000 SCSI ID False
unique_id 34213600508B40006D4B2000100000034000006HSV20002HPfcp Unique device identifier False --check
ww_name 0x50001fe1500e561c FC World Wide Name False
sfc3rac2:/#
3. 修改磁盘属性
ls -l /dev/rhdisk*
chown oracle:dba /dev/rhdisk10
chmod 660 /dev/rhdisk10
ls -l /dev/rhdisk*
lsattr -El hdisk10
chdev -l hdisk10 -a reserve_policy=no_reserve
lsattr -El hdisk10
sfc3rac2:/# ls -l /dev/rhdisk*
crw------- 1 root system 24, 0 Aug 24 2009 /dev/rhdisk0
crw------- 2 root system 24, 1 Aug 24 2009 /dev/rhdisk1
crw------- 1 root system 24, 10 Dec 30 09:08 /dev/rhdisk10
crw-r----- 1 root oinstall 24, 2 Dec 30 09:12 /dev/rhdisk2
crw-r--r-- 1 oracle oinstall 24, 3 Dec 30 09:12 /dev/rhdisk3
crw-rw---- 1 oracle dba 24, 4 Dec 30 09:12 /dev/rhdisk4
crw-rw---- 1 oracle dba 24, 5 Dec 30 08:26 /dev/rhdisk5
crw-rw---- 1 oracle dba 24, 6 Dec 30 09:12 /dev/rhdisk6
crw-rw---- 1 oracle dba 24, 7 Dec 30 08:26 /dev/rhdisk7
crw-rw---- 1 oracle dba 24, 8 Dec 30 08:25 /dev/rhdisk8
crw-rw---- 1 oracle dba 24, 9 Dec 30 08:29 /dev/rhdisk9
sfc3rac2:/#
sfc3rac2:/#
sfc3rac2:/# chown oracle:dba /dev/rhdisk10 --change owner
sfc3rac2:/# chmod 660 /dev/rhdisk10 --change mode
sfc3rac2:/# ls -l /dev/rhdisk*
crw------- 1 root system 24, 0 Aug 24 2009 /dev/rhdisk0
crw------- 2 root system 24, 1 Aug 24 2009 /dev/rhdisk1
crw-rw---- 1 oracle dba 24, 10 Dec 30 09:08 /dev/rhdisk10 --check
crw-r----- 1 root oinstall 24, 2 Dec 30 09:13 /dev/rhdisk2
crw-r--r-- 1 oracle oinstall 24, 3 Dec 30 09:13 /dev/rhdisk3
crw-rw---- 1 oracle dba 24, 4 Dec 30 09:13 /dev/rhdisk4
crw-rw---- 1 oracle dba 24, 5 Dec 30 08:26 /dev/rhdisk5
crw-rw---- 1 oracle dba 24, 6 Dec 30 09:13 /dev/rhdisk6
crw-rw---- 1 oracle dba 24, 7 Dec 30 08:26 /dev/rhdisk7
crw-rw---- 1 oracle dba 24, 8 Dec 30 08:25 /dev/rhdisk8
crw-rw---- 1 oracle dba 24, 9 Dec 30 08:29 /dev/rhdisk9
sfc3rac2:/#
sfc3rac2:/# lsattr -El hdisk10
PCM PCM/friend/hsvpcm Path Control Module False
PR_key_value none Persistant Reserve Key Value True
algorithm fail_over Algorithm True
hcheck_cmd test_unit_rdy Health Check Command True
hcheck_interval 60 Health Check Interval True
hcheck_mode nonactive Health Check Mode True
location Location Label True
lun_id 0x9000000000000 Logical Unit Number ID False
lun_reset_spt yes SCSI LUN reset True
max_transfer 0x40000 Maximum TRANSFER Size True
node_name 0x50001fe1500e5610 FC Node Name False
pvid none Physical volume identifier False
q_type simple Queuing TYPE True
queue_depth 8 Queue DEPTH True
reserve_policy single_path Reserve Policy True
rw_timeout 60 READ/WRITE time out value True
scsi_id 0x10000 SCSI ID False
unique_id 34213600508B40006D4B2000100000034000006HSV20002HPfcp Unique device identifier False
ww_name 0x50001fe1500e561c FC World Wide Name False
sfc3rac2:/# chdev -l hdisk10 -a reserve_policy=no_reserve --change disk parameter
hdisk10 changed
sfc3rac2:/# lsattr -El hdisk10
PCM PCM/friend/hsvpcm Path Control Module False
PR_key_value none Persistant Reserve Key Value True
algorithm fail_over Algorithm True
hcheck_cmd test_unit_rdy Health Check Command True
hcheck_interval 60 Health Check Interval True
hcheck_mode nonactive Health Check Mode True
location Location Label True
lun_id 0x9000000000000 Logical Unit Number ID False
lun_reset_spt yes SCSI LUN reset True
max_transfer 0x40000 Maximum TRANSFER Size True
node_name 0x50001fe1500e5610 FC Node Name False
pvid none Physical volume identifier False
q_type simple Queuing TYPE True
queue_depth 8 Queue DEPTH True
reserve_policy no_reserve Reserve Policy True --changed
rw_timeout 60 READ/WRITE time out value True
scsi_id 0x10000 SCSI ID False
unique_id 34213600508B40006D4B2000100000034000006HSV20002HPfcp Unique device identifier False
ww_name 0x50001fe1500e561c FC World Wide Name False
sfc3rac2:/#
4. 将磁盘加入磁盘组
column name format a20
select name,state,type,total_mb,free_mb,unbalanced from v$asm_diskgroup;
select name,path,total_mb,free_mb,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS from v$asm_disk order by 1,2;
idle> select name,state,type,total_mb,free_mb,unbalanced from v$asm_diskgroup;
NAME STATE TYPE TOTAL_MB FREE_MB UN
-------------------- ---------------------- ---------- ---------- ---------- --
SFC3DB_ARCH MOUNTED EXTERN 102400 91832 N
SFC3DB_DATA MOUNTED EXTERN 512000 63954 N
idle> select name,path,total_mb,free_mb,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS from v$asm_disk order by 1,2;
NAME PATH TOTAL_MB FREE_MB MOUNT_STATUS HEADER_STATUS MODE_STATUS
-------------------- ------------------------------ ---------- ---------- -------------- ------------------------ --------------
SFC3DB_ARCH_0000 /dev/rhdisk6 102400 91832 CACHED MEMBER ONLINE
SFC3DB_DATA_0000 /dev/rhdisk4 102400 12789 CACHED MEMBER ONLINE
SFC3DB_DATA_0001 /dev/rhdisk5 102400 12790 CACHED MEMBER ONLINE
SFC3DB_DATA_0002 /dev/rhdisk7 102400 12789 CACHED MEMBER ONLINE
SFC3DB_DATA_0003 /dev/rhdisk8 102400 12794 CACHED MEMBER ONLINE
SFC3DB_DATA_0004 /dev/rhdisk9 102400 12792 CACHED MEMBER ONLINE
/dev/rhdisk10 102400 0 CLOSED CANDIDATE ONLINE ---check new disk in ASM
/dev/rhdisk3 1024 0 CLOSED FOREIGN ONLINE
8 rows selected.
alter diskgroup SFC3DB_DATA add disk '/dev/rhdisk10';
alter diskgroup SFC3DB_DATA rebalance power 11;
select * from v$asm_operation;
select name,total_mb,free_mb,unbalanced from v$asm_diskgroup;
select group_number,name,path,total_mb,free_mb from v$asm_disk order by group_number,name;
select group_number,name,path,total_mb,free_mb,header_status from v$asm_disk;
idle>alter diskgroup SFC3DB_DATA add disk '/dev/rhdisk10'; --add new disk to diskgroup
Diskgroup altered.
idle> select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES
------------ --------------- ------------ ---------- ---------- ---------- ---------- ---------- -----------
4 REBAL RUN 1 1 405 40176 1620 24
idle> select name,total_mb,free_mb,unbalanced from v$asm_diskgroup;
NAME TOTAL_MB FREE_MB UN
-------------------- ---------- ---------- --
SFC3DB_ARCH 102400 91832 N
SFC3DB_DATA 614400 166352 N
idle> select group_number,name,path,total_mb,free_mb from v$asm_disk order by group_number;
GROUP_NUMBER NAME PATH TOTAL_MB FREE_MB
------------ -------------------- ------------------------------ ---------- ----------
0 /dev/rhdisk3 1024 0
1 SFC3DB_ARCH_0000 /dev/rhdisk6 102400 91832
2 SFC3DB_DATA_0005 /dev/rhdisk10 102400 88651
2 SFC3DB_DATA_0004 /dev/rhdisk9 102400 15541
2 SFC3DB_DATA_0002 /dev/rhdisk7 102400 15538
2 SFC3DB_DATA_0003 /dev/rhdisk8 102400 15544
2 SFC3DB_DATA_0000 /dev/rhdisk4 102400 15539
2 SFC3DB_DATA_0001 /dev/rhdisk5 102400 15539
7 rows selected.
idle> alter diskgroup SFC3DB_DATA rebalance power 11; ---rebalance diskgroup
Diskgroup altered.
idle> select * from v$asm_operation;
no rows selected
idle> select group_number,name,path,total_mb,free_mb from v$asm_disk order by group_number;
GROUP_NUMBER NAME PATH TOTAL_MB FREE_MB
------------ -------------------- ------------------------------ ---------- ----------
0 /dev/rhdisk3 1024 0
1 SFC3DB_ARCH_0000 /dev/rhdisk6 102400 91832
2 SFC3DB_DATA_0005 /dev/rhdisk10 102400 85936
2 SFC3DB_DATA_0004 /dev/rhdisk9 102400 16085
2 SFC3DB_DATA_0002 /dev/rhdisk7 102400 16081
2 SFC3DB_DATA_0003 /dev/rhdisk8 102400 16087
2 SFC3DB_DATA_0000 /dev/rhdisk4 102400 16081
2 SFC3DB_DATA_0001 /dev/rhdisk5 102400 16082
8 rows selected.
idle> / --rebalance ok
GROUP_NUMBER NAME PATH TOTAL_MB FREE_MB
------------ -------------------- ------------------------------ ---------- ----------
0 /dev/rhdisk3 1024 0
1 SFC3DB_ARCH_0000 /dev/rhdisk6 102400 91832
2 SFC3DB_DATA_0005 /dev/rhdisk10 102400 27725
2 SFC3DB_DATA_0004 /dev/rhdisk9 102400 27726
2 SFC3DB_DATA_0002 /dev/rhdisk7 102400 27726
2 SFC3DB_DATA_0003 /dev/rhdisk8 102400 27725
2 SFC3DB_DATA_0000 /dev/rhdisk4 102400 27725
2 SFC3DB_DATA_0001 /dev/rhdisk5 102400 27725
8 rows selected.
idle>
对比HPUX和Solaris,我认为在管理上AIX更便捷简单,最难的是HPUX,特别是HPUX平台的JFS文件系统;Solaris下的ZFS系统相对来说还是比较好用的。虽然三大小机平台已经越来越少了,但是在一些领域(半导体,航司,轨道交通,银行等)它们仍然在默默支撑着核心系统,稳定,高效,昂贵是它们的标签。
-------------历史文章推荐----------------
达梦暴涨,国产数据库的春天到了吗?
ORACLE RAC的一些基本理论知识
传统制造型企业数据库选型之困
利用ASM功能实现Oracle RAC零停机存储迁移
查询rownum伪列引起的sql性能问题分析
这篇关于AIX小机环境如何给ASM添加磁盘的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!