正德厚生,臻于至善

oracleasm

# rpm -qa |grep oracleasm
# rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm\n" | grep asm
# df -ha

# /etc/init.d/oracleasm status
# /etc/init.d/oracleasm listdisks
# /usr/sbin/oracleasm configure
# /sbin/modinfo oracleasm
# /usr/sbin/oracleasm-discover
# /usr/sbin/oracleasm-discover 'ORCL:*'
# /etc/init.d/oracleasm querydisk -p DATA01
# /etc/init.d/oracleasm querydisk -d DATA09
# ls -l /dev/oracleasm/disks
# /sbin/blkid

#CentOS6/OEL6/RHEL6
# for i in `oracleasm listdisks|xargs oracleasm querydisk -p|grep emc|awk -F[:1] '{print $1}'`; do echo $i `/sbin/scsi_id -g -u -d $i`; done
# for i in `oracleasm listdisks|xargs oracleasm querydisk -p|grep sddlm|awk -F[:1] '{print $1}'`; do echo $i `/sbin/scsi_id -g -u -d $i`; done
# for i in `oracleasm listdisks|xargs oracleasm querydisk -p|grep sd|awk -F[:1] '{print $1}'`; do echo $i `/sbin/scsi_id -g -u -d $i`; done

#CentOS7/OEL7/RHEL7
# for i in `oracleasm listdisks|xargs oracleasm querydisk -p|grep emc|awk -F: '{print $1}'`; do echo $i `/usr/lib/udev/scsi_id -g -u -d $i`; done
# for i in `oracleasm listdisks|xargs oracleasm querydisk -p|grep sddlm|awk -F: '{print $1}'`; do echo $i `/usr/lib/udev/scsi_id -g -u -d $i`; done
# for i in `oracleasm listdisks|xargs oracleasm querydisk -p|grep sd|awk -F: '{print $1}'`; do echo $i `/usr/lib/udev/scsi_id -g -u -d $i`; done
# for i in `oracleasm listdisks|xargs oracleasm querydisk -p|grep emc|awk -F[:\"] '{print $1}'`;do echo `oracleasm listdisks|xargs oracleasm querydisk -p|grep $i` `/usr/lib/udev/scsi_id -g -u -d $i`;done

/etc/init.d/oracleasm createdisk ASMDISK_NEW_SAN_1 /dev/mapper/mpathbp1
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks
/usr/sbin/oracleasm-discover 'ORCL:*'

一些相关的文件:
/var/log/messages*
/var/log/oracleasm
/etc/sysconfig/oracleasm

1. 查看有多少asm磁盘
kfod disk=all

2. 查看asm磁盘组
kfod op=groups

3. 查看磁盘与磁盘组的对应关系
kfod ds=true di=all

mount or dismount 磁盘组

kfod/kfed/amdu

set lines 200 pages 50000
col name for a25
col path for a55
select group_number,disk_number,name,path,total_mb/1024 total_G,mode_status,repair_timer from v$asm_disk order by group_number,disk_number;

1.1 获取磁盘组管理信息
1.1.1 查看磁盘路径
select name, path, group_number from v$asm_disk_stat;

1.1.2 查看磁盘组信息
select group_number,name,type,total_mb, free_mb,state from v$asm_diskgroup_stat;
select group_number,name,type,total_mb, free_mb,state from v$asm_diskgroup;

TYPE VARCHAR2(6) Redundancy type for the disk group:
EXTERN
NORMAL
HIGH

磁盘组状态为Mounted说明磁盘组状态正常;
磁盘组的total_mb,free_mb为非0说明可以读取磁盘信息,获取磁盘大小。

1.1.3 查看磁盘组操作
select * from v$asm_operation;

1.1.4 查看磁盘组属性
查询V$ASM_ATTRIBUTE视图查看磁盘组属性
SELECT dg.name AS diskgroup,SUBSTR(a.name,1,18) AS name,
SUBSTR(a.value,1,24) AS value, read_only FROM V$ASM_DISKGROUP_STAT dg,
V$ASM_ATTRIBUTE a
WHERE
dg.group_number = a.group_number
/*AND dg.name = 'DATA'*/;

1.1.5 查看磁盘组兼容属性
SELECT name,COMPATIBILITY,DATABASE_COMPATIBILITY FROM V$ASM_DISKGROUP_STAT;

1.1.6 查看磁盘状态
SELECT SUBSTR(d.name,1,16) AS asmdisk,d.mount_status,HEADER_STATUS, d.state,
dg.name AS diskgroup FROM V$ASM_DISKGROUP_STAT dg, V$ASM_DISK_STAT d
WHERE dg.group_number = d.group_number;

1.1.7 查看磁盘客户端信息
SELECT dg.name AS diskgroup,SUBSTR(c.instance_name,1,12) AS instance,
SUBSTR(c.db_name,1,12) AS dbname,SUBSTR(c.SOFTWARE_VERSION,1,12) AS software,
SUBSTR(c.COMPATIBLE_VERSION,1,12) AS compatible
FROM V$ASM_DISKGROUP_STAT dg, V$ASM_CLIENT c
WHERE dg.group_number = c.group_number;

1.1.8 查看磁盘访问控制用户信息
SELECT dg.name AS diskgroup, u.group_number,u.user_number, u.os_id, u.os_name
FROM V$ASM_DISKGROUP_STAT dg, V$ASM_USER u
WHERE dg.group_number = u.group_number
/*AND dg.name ='DATA'*/;

1.1.9 查看磁盘访问控制组信息
SELECT dg.name AS diskgroup, ug.group_number,ug.owner_number, u.os_name,
ug.usergroup_number, ug.name FROM V$ASM_DISKGROUP_STAT dg, V$ASM_USER u, V$ASM_USERGROUP ug
WHERE dg.group_number = ug.group_number
AND ug.owner_number = u.user_number
/*AND dg.name ='DATA'*/;

1.1.10 查看智能数据分布信息
SELECT dg.name AS diskgroup, f.file_number, f.primary_region,f.mirror_region, f.hot_reads,f.hot_writes, f.cold_reads, f.cold_writes
FROM V$ASM_DISKGROUP_STAT dg, V$ASM_FILE f
WHERE dg.group_number = f.group_number
/*and dg.name ='DATA'*/;
赞(0) 打赏
未经允许不得转载:徐万新之路 » oracleasm

评论 抢沙发

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫

微信扫一扫

登录

找回密码

注册