How can I get the logical valume by the datafile names and ASM disks?

Q:We use asmlib to create ASM disk in Oracle rac 11.2.0.3,
and how can I get the logical valume by the datafile names and ASM disks?


A:
 Datafiles were spread across in all the MEMBER disks of a diskgroup. To find out the device name, please check the below example:
We will take DG_01 diskgroup to find out the related device names:

SQL>select * from v$asm_diskgroup;
GROUP_NUMBER NAME SECTOR_SIZE BLOCK_SIZE ALLOCATION_UNIT_SIZE STATE TYPE TOTAL_MB FREE_MB
1 DG_01 512 4096 1048576 MOUNTED EXTERN 307200 264975

SQL>SELECT * FROM V$ASM_DISK ORDER BY GROUP_NUMBER,DISK_NUMBER;
GROUP_NUMBER DISK_NUMBER COMPOUND_INDEX INCARNATION MOUNT_S HEADER_STATU MODE_ST STATE REDUNDA LIBRARY OS_MB TOTAL_MB FREE_MB PATH
1 0 16777216 3541212914 CACHED MEMBER ONLINE NORMAL UNKNOWN ASM Library - Generic Linux, version 2.0.4 (KABI_V2) 102400 102400 ORCL:DG_01_DISK_01
1 1 16777217 3541212915 CACHED MEMBER ONLINE NORMAL UNKNOWN ASM Library - Generic Linux, version 2.0.4 (KABI_V2) 102400 102400 ORCL:DG_01_DISK_02
1 2 16777218 3541212916 CACHED MEMBER ONLINE NORMAL UNKNOWN ASM Library - Generic Linux, version 2.0.4 (KABI_V2) 102400 102400 ORCL:DG_01_DISK_03


DG_01 were having below MEMBER disks[select * from v$asm_disk]
ORCL:DG_01_DISK_01
ORCL:DG_01_DISK_02
ORCL:DG_01_DISK_03


Listing of the above disk as below:[$ls -l /dev/oracleasm/disks/*]
brw-rw---- 1 oracle dba 252, 0 Feb 12 11:23 /dev/oracleasm/disks/DG_01_DISK_01<<<<<<<<<<<<<<Device with major# as 252 and minor# as 0
brw-rw---- 1 oracle dba 252, 1 Feb 12 11:24 /dev/oracleasm/disks/DG_01_DISK_02
brw-rw---- 1 oracle dba 252, 2 Feb 12 11:25 /dev/oracleasm/disks/DG_01_DISK_03

Corresponding multipath devices for the above disks were[$cat /proc/partitions]
252 0 104857600 dm-0
252 1 104857600 dm-1
252 2 104857600 dm-2
The above devices were resolves to more than one path to sd* devices, by this way we can find out the device names.
Files which were stored in diskgroup DG_01 were spread across all the 3 devices i.e 1M of data will gets spread across the MEMBER disks and not at the datafile level.


posted on 2014-01-07 16:44  love so much  阅读(310)  评论(0编辑  收藏  举报

导航