How to map device name to ASMLIB disk [ID 1098682.1]
Applies to:
Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.2.0.1 - Release: 10.2 to 11.2Generic Linux
Goal
ASMLIB is a support library for the Automatic Storage Management (ASM) feature of the Oracle Database and is available for the Linux operating system. ASMLIB packages are available for Linux kernel 2.4 and 2.6 for the following Linux operating systems:- Suse Linux Enterprise Server/United Linux versions 8 - 11
- Red Hat Advanced Server 2.1, Red Hat Enterprise Linux versions 3 - 5
- Oracle Enterprise Linux version 5
Solution
That information can be obtained with the following shell script:#!/bin/bash
for asmlibdisk in `ls /dev/oracleasm/disks/*`
do
echo "ASMLIB disk name: $asmlibdisk"
asmdisk=`kfed read $asmlibdisk | grep dskname | tr -s | cut -f2 -d`
echo "ASM disk name: $asmdisk"
majorminor=`ls -l $asmlibdisk | tr -s | cut -f5,6 -d`
device=`ls -l /dev | tr -s | grep "$majorminor" | cut -f10 -d`
echo "Device path: /dev/$device"
done
The script can be run as OS user that owns ASM or Grid Infrastructure home (oracle/grid), i.e. it does not need to be run as privileged user. The only requirement it that kfed binary exists and that it is in the PATH.
If an ASMLIB disk was already deleted, it will not show up in /dev/oracleasm/disks. We can check for devices that are (or were) associated with ASM with the following shell script:
#!/bin/bash
for device in `ls /dev/sd*`
do
asmdisk=`kfed read $device | grep ORCLDISK | tr -s | cut -f2 -d | cut -c1-8`
if [ "$asmdisk" = "ORCLDISK" ]
then
echo "Disk device $device may be an ASM disk!"
fi
done
The second scripts takes a peek at sd devices in /dev, so in addition to the requirement for the kfed binary to be in the PATH, it also needs to be run as privileged user. Of course we can look at /dev/dm*, /dev/mapper, etc or all devices in /dev, although that may not be a good idea.
The kfed binary should be available in RDBMS home (prior to version 11.2) and in the Grid Infrastructure home (in version 11.2 and later). If the binary is not there, it can be built as follows:
cd $ORACLE_HOME/rdbms/lib
make -f ins* ikfed
Where ORACLE_HOME is the RDBMS home (prior to version 11.2) and the Grid Infrastructure home in version 11.2 and later.[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/161195/viewspace-1055563/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How to Set Device Name Using UDEV on Oracle Linux 7.1devOracleLinux
- Using ASMLIB Management ASM DiskASM
- How to mount usb device in CentOS?devCentOS
- ‘map’ does not name a type
- How to Restore a Lost Voting Disk in 10g [ID 279793.1]REST
- How to move ASM spfile to a different disk group [ID 1082943.1]ASM
- Linux locate/print block device attributes ASMLibLinuxBloCdevASM
- How to Choose Size of Datafile on Raw Devicedev
- Contens 5.8 安裝 oracle grid infrastruture(使用asmlib製作asm disk)OracleASTASM
- ASM: Device is already labeled for ASM diskASMdev
- emulator: ERROR: unknown virtual device nameErrordev
- Andorid“emulator: ERROR: unknown virtual device name”問題解決Errordev
- How to Rename Database/Change DB_NAME or ORACLE_SID/Instance Name-15390.1DatabaseOracle
- oracleasm createdisk ASM: Device is already labeled for ASM diskOracleASMdev
- How to Troubleshoot Connectivity Issue with 11gR2 SCAN Name (Doc ID 975457.1)
- 【譯】How I built a wind map with WebGLUIWeb
- How to Add a New Disk new partition in centos7CentOS
- linux下如何使用raw device來建立管理asm diskLinuxdevASM
- Config LUNs for ASM Disk using WWID,DM-Multipathing,ASMLIB on RHEL 5/6_1365511.1ASM
- How can I prevent users from connecting to a USB storage device?dev
- ASM 11g New Features - How ASM Disk Resync WorksASM
- [原創] How to revise author name and email in commit historyAIMIT
- How to Troubleshoot Connectivity Issue with 11gR2 SCAN Name
- DB_NAME&TANCE_NAME&DB_UNIQUE_NAME&ORACLE_SID&GLOBAL_NAME&DB_DOMAIN&SERVICE_NAMEOracleAI
- IDBObjectStore.nameObject
- IDBDatabase.nameDatabase
- asmlibASM
- iOS Device ID 的前世今生iOSdev
- @media:device-width、orientationdev
- how to start '10046 trace name context forever,level 12'Context
- ServeRAID disk drive error recoveryServerAIError
- linux下asm裡如何找到asm disk和os device的對應關係LinuxASMdev
- Oracle identifiers :Database NameOracleIDEDatabase
- 淺談 iOS Device ID 的修改iOSdev
- How To Kill Good IdeasGoIdea
- ORACLE_SID,INSTANCE_NAME和DB_NAMEOracle
- DB_NAME DB_UNIQUE_NAME 和 SID 的理解
- fatal: Not a valid object name: 'master'ObjectAST