如何知道ASM磁盘组由哪些物理磁盘组成
2014-03-17 10:37
309 查看
我们知道用下面的方法可创建 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:
另外一个查看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
以 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:
configure | Use the configure option to reconfigure the Automatic Storage Management library driver, if necessary: # /etc/init.d/oracleasm configure |
enabledisable | Use 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 |
startstoprestart | Use the start, stop, and restart options to load or unload the Automatic Storage Management library driver without restarting the system: # /etc/init.d/oracleasm restart |
createdisk | Use 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 |
deletedisk | Use 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. |
querydisk | Use 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} |
listdisks | Use the listdisks option to list the disk names of marked Automatic Storage Management library driver disks: # /etc/init.d/oracleasm listdisks |
scandisks | Use 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 |
注意:这也是只能查询逻辑磁盘使用情况,不能查看对应的物理磁盘。
[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
相关文章推荐
- 如果ASM磁盘组由哪些物理磁盘组成?
- ASM磁盘组由哪些物理磁盘组成?
- 如果ASM磁盘组由哪些物理磁盘组成?
- 当ASM磁盘组无法MOUNT之时如何找到对应的物理磁盘?
- 如何检查ASM磁盘空间使用情况
- 如何修复ASM Disk header_status=FORMER的磁盘重新加入Diskgroup
- 如何通过程序知道有哪些计算机与自己的电脑连接
- 如何知道哪些表是FTS
- 如何知道磁盘信息
- AIX如何查看文件系统分布在哪个物理磁盘上
- oracle rac 11g如何修改归档到ASM FRA磁盘
- 如何创建ASM磁盘?
- 如何知道应用程序使用了哪些DLL文件
- 知道一张表的主键,如何查找该主键被哪些表引用(转)
- Oracle 如何在线添加ASM磁盘
- C#--[反射]如何知道一个类都实现了哪些接口和从那个类继承
- VMware vCenter中, 如何辩认虚机上Raw Device Mapping过了的一块物理磁盘?
- 如何查看ASM磁盘空间使用情况
- 如何检查ASM磁盘空间使用情况
- 如何知道java手机的J2ME Connection interface 支持HTTP, Socket, UDP, Serial port中的哪些?