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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [AlwaysOn2017] AlwaysOn的DMV和DMF - Sys.dm_hadr_name_id_map
- ‘map’ does not name a type
- iOS Device ID 的前世今生iOSdev
- How to Add a New Disk new partition in centos7CentOS
- 7.57 CON_NAME_TO_ID
- How To Turn SNMP On/Off ? [ID 472530.1]
- 淺談 iOS Device ID 的修改iOSdev
- 【譯】How I built a wind map with WebGLUIWeb
- [原創] How to revise author name and email in commit historyAIMIT
- HTML中的tag、element、class、name、idHTML
- What is OPAQUE_TRANSFORM Hint and how to Control it [ID 780503.1]OpaqueORM
- How to Collect Diagnostics for Database Hanging Issues (Doc ID 452358.1)Database
- Android Studio中的package name和application IDAndroidPackageAPP
- How to Increase CSS Misscount in single instance ASM installations [ID 729878.1]CSSASM
- 【CURSOR】How to Monitor and tune Open and Cached Cursors (Doc ID 1430255.1)
- How to redirect to a specific web page after sign out from Entra IDWeb
- How To Replicate Data from Oracle to Postgres Using GoldenGate (Doc ID 1544137.1OracleGo
- Selenium4自動化測試2--元素定位By.ID,By.CLASS_NAME,By.TAG_NAME
- Python3正規表示式之:(?(id/name)yes-pattern|no-Python
- 面試題:給你個id,去拿到name,多叉樹遍歷面試題
- move linux os from disk A to disk B with 0 lossLinux
- NTFS Disk by Omi NTFS Mac;NTFS Disk by Omi NTFSMac
- 【BUILD_ORACLE】使用ASMLib包搭建ASM磁碟UIOracleASM
- python中id()函式、zip()函式、map()函式、lamda函式Python函式
- Python3正規表示式之:(?(id/name)yes-pattern|no-pattern)條件性匹配Python
- How to ssh
- WPF筆記3——x:Name 與 Name筆記
- 執行時報錯RuntimeError: expected device cpu but got device cuda:0ErrordevGo
- Oracle修改instance_name、db_name、db_unique_name、service_namesOracle
- How to find dependency
- linux vdo驗證 oracle asm diskgroup sector_size 4096 udev asmlibLinuxOracleASMdev
- 翻譯:Linux and the Device TreeLinuxdev
- As 除錯 no target device found除錯dev
- kubernetes container device interface (CDI)AIdev
- Waiting for target device to come onlineAIdev
- Partition|Disk Utility 如何分割磁碟
- IDBDatabase.nameDatabase
- IDBObjectStore.nameObject
- Python(Path().name)Python