Quantcast
Channel: All System Administration posts
Viewing all articles
Browse latest Browse all 1179

Re: Linux UDEV for ASM oracle database

$
0
0

For example in udev I have rule

file name /etc/udev/rules.d/64-device-mapper.rules

---------------------------------------------------------------------------------------

SUSE 10.

----------------------------------------------------------------------------------------

# device mapper links hook into "online" event, when the dm table
# is available, while some table types must be ignored

KERNEL=="dm-*", ACTION=="add|online", GOTO="device_mapper_do"
GOTO="device_mapper_end"

LABEL="device_mapper_do"
IMPORT{program}="/sbin/dmsetup info -j %M -m %m --export"
ENV{DM_STATE}!="ACTIVE", GOTO="device_mapper_end"
PROGRAM!="/sbin/dmsetup status -j %M -m %m", GOTO="device_mapper_end"
RESULT=="|*snapshot*|*error*", GOTO="device_mapper_end"

IMPORT{program}="/sbin/vol_id --export $tempnode"
ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"

ENV{DM_TABLE}=="*SMOK*", PROGRAM="/bin/chown oracle:dba /dev/mapper/$env{DM_TABLE}"
ENV{DM_TABLE}=="*vv_morwahp1*", PROGRAM="/bin/chown oracle:dba /dev/mapper/$env{DM_TABLE}"

LABEL="device_mapper_end"
----------------------------------------------------------------------------------------------------------------------------------

 

example linux redhat  6

 

-----------------------------------------------------------------------------------------------------------------------------------

if [ -z "$1" ]
then
        echo ""
        echo "Usage:        $0 username"
        echo ""
        echo "Description:  Generate udev rules from multipath.conf Oracle RAC LUNs"
        echo "              Please name LUNs on multipath.conf begining with asm_* "
        echo ""
        echo "username:    The user name should be the oracle username or equivalent."
        echo ""
                echo ""
        exit 1
fi
ORA_USER="$1"
ORA_UID=`/usr/bin/id --user "${ORA_USER}"`
ORA_GID=`/usr/bin/id --group "${ORA_USER}"`

# Refresh partitions
#echo "Running partprobe"
#/sbin/partprobe

# Generating udev rules
echo "Generating udev rules on /etc/udev/rules.d/99-asm.rules"
for x in `/sbin/multipath -l | grep asm | awk '{print $1}'`
do for z in `/sbin/dmsetup ls | grep ${x} | grep p | awk '{ print $1}'`
do echo 'ENV{DM_NAME}=="'${z}'", NAME+="oracle/'${z}\"', OWNER="'${ORA_UID}'", GROUP="'${ORA_GID}'", MODE="0660", ACTION=="add|change"'
done
done | sort -r > /etc/udev/rules.d/99-asm.rules

 


Viewing all articles
Browse latest Browse all 1179

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>