sitemap

RSS地图

收藏本站

设为首页

Oracle研究中心

当前位置:Oracle研究中心 > 运维DBA >

【学习笔记】Oracle ASM kfod命令测试grid是否对磁盘有访问权限

时间:2016-10-29 16:06   来源:Oracle研究中心   作者:HTZ   点击:

天萃荷净 kfod测试grid用户对磁盘的访问权限分享一篇关于在安装grid的时候,遇到不能访问磁盘,使用dd命令来测试对磁盘的读写权限,其实ASM提供kfod命令来测试对grid是否对磁盘有访问权限。
下面是测试使用kfod命令来测试对磁盘是否有访问权限。

1,版本介绍

[grid@oracleplus.net ~]$lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.5 (Santiago)
Release: 6.5
Codename: Santiago

2,查看磁盘名字

这里使用的multipath来固定磁盘命令,习惯了使用multipath,觉得使用asmlib,udev来固定磁盘命令都是在多路径软件上面增加一步,本来磁盘聚合的时候就可以固定磁盘名字,就没有必要再使用其它软件来实现了。不过从RHEL 6开始,multipath不能更改权限,需要使用到udev。
[root@oracleplus.net ~]#multipath -ll
asm2 (36000c29ca5ab0cd5649a66fa333180a0) dm-3 VMware,,VMware Virtual S
size=20G features=’0′ hwhandler=’0′ wp=rw
`-+- policy=’round-robin 0′ prio=1 status=active
`- 2:0:2:0 sdc 8:32 active ready running
asm1 (36000c296a51a699a8d04a746a3b31e23) dm-2 VMware,,VMware Virtual S
size=20G features=’0′ hwhandler=’0′ wp=rw
`-+- policy=’round-robin 0′ prio=1 status=active
`- 2:0:1:0 sdb 8:16 active ready running

3,kfod命令

[grid@oracleplus.net ~]$kfod -help
_asm_a/llow_only_raw_disks KFOD allow only raw devices [_asm_allow_only_raw_disks=TRUE/(FALSE)]
_asm_l/ibraries ASM Libraries[_asm_libraries=lib1,lib2,…]
_asms/id ASM Instance[_asmsid=sid]
a/sm_diskstring ASM Diskstring [asm_diskstring=discoverystring, discoverystring …]
c/luster KFOD cluster [cluster=TRUE/(FALSE)]
db/_unique_name db_unique_name for ASM instance[db_unique_name=dbname]
di/sks Disks to discover [disks=raw,asm,all]
ds/cvgroup Include group name [dscvgroup=TRUE/(FALSE)]
g/roup Disks in diskgroup [group=diskgroup]
h/ostlist hostlist[hostlist=host1,host2,…]
metadata_a/usize AU Size for Metadata Size Calculation
metadata_c/lients Client Count for Metadata Size Calculation
metadata_d/isks Disk Count for Metadata Size Calculation
metadata_n/odes Node Count for Metadata Size Calculation
metadata_r/edundancy Redundancy for Metadata Size Calculation
n/ohdr KFOD header suppression [nohdr=TRUE/(FALSE)]
o/p KFOD options type [OP=DISKS/CANDIDATES/MISSING/GROUPS/INSTS/VERSION/CLIENTS/RM/RMVERS/DFLTDSTR/GPNPDSTR/METADATA/ALL]
p/file ASM parameter file [pfile=parameterfile]
s/tatus Include disk header status [status=TRUE/(FALSE)]
v/erbose KFOD verbose errors [verbose=TRUE/(FALSE)]

[grid@oracleplus.net ~]$kfod asm_diskstring=’/dev/mapper/*’ disks=all
——————————————————————————–
Disk Size Path User Group
================================================================================
1: 20480 Mb /dev/mapper/asm1 grid oinstall
2: 20480 Mb /dev/mapper/asm2 grid oinstall
KFOD-00301: Unable to contact Cluster Synchronization Services (CSS). Return code 2 from kgxgncin.
KFOD-00311: Error scanning device /dev/mapper/control
ORA-15025: could not open disk "/dev/mapper/control"
Linux-x86_64 Error: 13: Permission denied
Additional information: 42
KFOD-00311: Error scanning device /dev/mapper/vg_asm11g-lv_root
ORA-15025: could not open disk "/dev/mapper/vg_asm11g-lv_root"
Linux-x86_64 Error: 13: Permission denied
Additional information: 42
KFOD-00311: Error scanning device /dev/mapper/vg_asm11g-lv_swap
ORA-15025: could not open disk "/dev/mapper/vg_asm11g-lv_swap"
Linux-x86_64 Error: 13: Permission denied
Additional information: 42
这里我们能发现有2块磁盘GRID用户可以正常访问,并且也显示了用户与组

下面来看看磁盘的权限
[grid@oracleplus.net ~]$ls -l /dev/mapper/*
lrwxrwxrwx 1 root root 7 Aug 30 04:15 /dev/mapper/asm1 -> ../dm-2
lrwxrwxrwx 1 root root 7 Aug 30 04:15 /dev/mapper/asm2 -> ../dm-3
crw-rw—- 1 root root 10, 58 Aug 30 03:50 /dev/mapper/control
lrwxrwxrwx 1 root root 7 Aug 30 03:50 /dev/mapper/vg_asm11g-lv_root -> ../dm-0
lrwxrwxrwx 1 root root 7 Aug 30 03:50 /dev/mapper/vg_asm11g-lv_swap -> ../dm-1
[grid@oracleplus.net ~]$ls -l /dev/dm*
brw-rw—- 1 root disk 253, 0 Aug 30 03:50 /dev/dm-0
brw-rw—- 1 root disk 253, 1 Aug 30 03:50 /dev/dm-1
brw-rw—- 1 grid oinstall 253, 2 Aug 30 04:15 /dev/dm-2
brw-rw—- 1 grid oinstall 253, 3 Aug 30 04:15 /dev/dm-3

再来看看grid用户的属主
[grid@oracleplus.net ~]$id grid
uid=501(grid) gid=501(oinstall) groups=501(oinstall),502(dba)
这里只创建了dba与oinstalOracleoracleplus.netl组,并没有创建其它的asmadmin,asmoper等组,越多组,越容易出错,最经典的就是grid/oracle用户下面oracle命令的属主导致的问题。
本文固定链接: http://www.htz.pw/2014/08/29/kfod%e6%b5%8b%e8%af%95grid%e7%94%a8%e6%88%b7%e5%af%b9%e7%a3%81%e7%9b%98%e7%9a%84%e8%ae%bf%e9%97%ae%e6%9d%83%e9%99%90.html | 认真就输

--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之【学习笔记】Oracle ASM kfod命令测试grid是否对磁盘有访问权限

本文由大师惜分飞原创分享,网址:http://www.oracleplus.net/arch/1100.html

Oracle研究中心

关键词:

Oralce kfod命令使用案例

Oracle RAC安装grid时遇到不能访问磁盘的解决办法