How to know which physical disks the ASM Disk group consists of

Source: Internet
Author: User
Tags disk usage

We know that you can create an ASM disk in the following ways, and then create a logical ASM disk group.

Create the ASM disk as root user.
#/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 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

So how do you find the appropriate physical disk for the ASM disk through the ASM disk or the disk group?
This is the reverse query of the above method, because sometimes the ASM disk is created by a previous administrator, and the new administrator wants to know about the previous system storage.
The same can be queried with another parameter of the ORACLEASM command, as follows:


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 a 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 April 21:37/dev/sda1
BRW-RW----1 root disk 8, 17 April 13:37/DEV/SDB1
BRW-RW----1 root disk 8, 33 April 13:37/DEV/SDC1
BRW-RW----1 root disk 8, 49 April 13:37/DEV/SDD1
BRW-RW----1 root disk 8, 65 April 13:37/dev/sde1
BRW-RW----1 root disk 8, 81 April 13:37/DEV/SDF1

[ROOT@WEBDBB ~]# Fdisk-l

disk/dev/sda:359.7 GB, 359701413888 bytes
255 heads, Sectors/track, 43731 cylinders
Units = Cylinders of 16065 * 8225280 bytes

Device Boot Start End Blocks Id System
/DEV/SDA1 * 1 104391 Linux
/dev/sda2 42202 338883142+ Linux
/dev/sda3 42203 43731 12281692+ Linux Swap

... ...

disk/dev/sdf:107.3 GB, 107373920256 bytes
255 heads, Sectors/track, 13054 cylinders
Units = Cylinders of 16065 * 8225280 bytes

Device Boot Start End Blocks Id System
/DEV/SDF1 1 13054 104856223+ Linux

The following is a description of the Oracle official documentation about ORACLEASM Management 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/oracl Easm Configure
Enabledisable Use the Disable and enable options to the behavior. 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/orac Leasm Enable
Startstoprestart Use the start, stop, and restart options to load or unload the Automatic Storage Management library driver without restart ing 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

Caution:do not with this command to unmark disks, are being used by a Automatic Storage disk group. You are 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 are being used by the Automatic Storage 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 Gement Library driver disks on another node: #/etc/init.d/oracleasm Scandisks

Another command to view oracleasm disk information: Kfod

Note: This is also the only logical disk usage that can be queried, and the corresponding physical disk cannot be viewed.

[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_d isks=true/(FALSE)] 
_asm_l/ibraries asm libraries[_asm_libraries= ' lib1 ', ' lib2 ',...] &NBSP
_asms/id asm instance[_asmsid=sid] 
a/sm_diskstring asm diskstring [asm_diskstring= ' Discoverystring ', ' discoverystring ' ...] &NBSP
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.