如何知道ASM磁盘组由哪些物理磁盘组成

我们知道用下面的方法可创建 ASM 磁盘,然后再创建逻辑的ASM磁盘组。

以 root 用户身份创建 ASM 磁盘。
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk:                   [  OK  ]
# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk:                   [  OK  ]
# /etc/init.d/oracleasm createdisk VOL3 /dev/sde1
Marking disk "/dev/sde1" as an ASM disk:                   [  OK  ]
Verify that the ASM disks are visible from every node. 
# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks:                      [  OK  ]
# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3

那么如何通过ASM磁盘或是磁盘组找到ASM磁盘对应的物理磁盘呢?
也就是上面方法的反向查询,因为有些时候ASM磁盘是由以前管理员创建,新的管理员要对以前系统存储进行查询了解。
同样用oracleasm命令的另外的参数可以查询到,如下:


SQL> Select Name,path From v$asm_disk;

NAME                           PATH
------------------------------ ---------------
V1                             ORCL:V1
V2                             ORCL:V2

[root@webdbb ~]# oracleasm querydisk V1
Disk "V1" is a valid ASM disk

[root@webdbb ~]# oracleasm querydisk /dev/sdf1
Device "/dev/sdf1" is marked an ASM disk with the label "V5"

[oracle@webdbb ~]$ /etc/init.d/oracleasm querydisk -d V5
Disk "V5" is a valid ASM disk on device [8, 81]
[oracle@webdbb ~]$ ll /dev/sd*1
brw-rw----  1 root disk 8,  1  4月 28 21:37 /dev/sda1
brw-rw----  1 root disk 8, 17  4月 28 13:37 /dev/sdb1
brw-rw----  1 root disk 8, 33  4月 28 13:37 /dev/sdc1
brw-rw----  1 root disk 8, 49  4月 28 13:37 /dev/sdd1
brw-rw----  1 root disk 8, 65  4月 28 13:37 /dev/sde1
brw-rw----  1 root disk 8, 81  4月 28 13:37 /dev/sdf1

[root@webdbb ~]# fdisk -l

Disk /dev/sda: 359.7 GB, 359701413888 bytes
255 heads, 63 sectors/track, 43731 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       42202   338883142+  83  Linux
/dev/sda3           42203       43731    12281692+  82  Linux swap

... ...

Disk /dev/sdf: 107.3 GB, 107373920256 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1       13054   104856223+  83  Linux

 

下面是oracle官方文档关于oracleasm管理ASM的说明:

Administering the Automatic Storage Management Library Driver and Disks

To administer the Automatic Storage Management library driver and disks, use the oracleasm initialization script. with different options, as follows:



configureUse the configure option to reconfigure the Automatic Storage Management library driver, if necessary: # /etc/init.d/oracleasm configure
enabledisableUse the disable and enable options to change the behavior. of the Automatic Storage Management library driver when the system starts. The enableoption causes the Automatic Storage Management library driver to load when the system starts: # /etc/init.d/oracleasm enable
startstoprestartUse the startstop, and restart options to load or unload the Automatic Storage Management library driver without restarting the system: # /etc/init.d/oracleasm restart
creatediskUse the createdisk option to mark a disk device for use with the Automatic Storage Management library driver and give it a name: # /etc/init.d/oracleasm createdisk DISKNAMEdevicename
deletediskUse the deletedisk option to unmark a named disk device: # /etc/init.d/oracleasm deletedisk DISKNAME

Caution: Do not use this command to unmark disks that are being used by an Automatic Storage Management disk group. You must drop the disk from the Automatic Storage Management disk group before you unmark it.

querydiskUse the querydisk option to determine whether a disk device or disk name is being used by the Automatic Storage Management library driver: # /etc/init.d/oracleasm querydisk {DISKNAME devicename}
listdisksUse the listdisks option to list the disk names of marked Automatic Storage Management library driver disks: # /etc/init.d/oracleasm listdisks
scandisksUse the scandisks option to enable cluster nodes to identify which shared disks have been marked as Automatic Storage Management library driver disks on another node: # /etc/init.d/oracleasm scandisks

 

另外一个查看OracleASM磁盘信息的命令:kfod

注意:这也是只能查询逻辑磁盘使用情况,不能查看对应的物理磁盘。

[oracle@localhost ~]$ which kfod 
/u01/oracle/product/10.2.0.1/db_1/bin/kfod

[oracle@localhost ~]$ kfod -h 
_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' ...] 
d/isks Disks to discover [disks=raw,asm,all] 
g/roup Group discover [group=controlfile] 
n/ohdr KFOD header suppression [nohdr=TRUE/(FALSE)] 
o/p KFOD options type [OP=DISKS/GROUPS/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)]

[oracle@localhost ~]$ kfod d=all 
-------------------------------------------------------------------------------- 
Disk Size Path 
================================================================================ 
1: 10236 Mb ORCL:VOL1 
2: 4094 Mb ORCL:VOL2 
3: 12284 Mb ORCL:VOL3 
-------------------------------------------------------------------------------- 
ORACLE_SID ORACLE_HOME 
================================================================================ 
+ASM /u01/oracle/product/10.2.0.1/db_1

select name,total_mb,free_mb, (total_mb-free_mb) used from v$asm_diskgroup;

SQL> select name,total_mb,free_mb, (total_mb-free_mb) used from v$asm_diskgroup;

NAME TOTAL_MB FREE_MB USED 
------------------------------ ---------- ---------- ---------- 
ORADATA 26614 24595 2019
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值