Sunteți pe pagina 1din 6

8/4/2017 Creating ASM devices on AIX | AskDba.

org Weblog

AskDba.org Weblog
Writing About Our Experiences With Oracle Databases

Home Forums Oracle10g Oracle11g Oracle12c Performance Grid MySQL Unix Resource Center

PostgreSQL About Us

Creating ASM devices on AIX


Amit Bansal / 1 February, 2009

I thought of sharing few tips on creating ASM devices on AIX which I will be helpful to Oracle DBA's. Suppose SysAdmin gives you list of
Serial numbers for LUN instead of device Name

pcmpath query device


DEV#: 33 DEVICE NAME: hdisk33 TYPE: 2107900 ALGORITHM: Load Balance
SERIAL: 75DM011<span style="color: #ff0000;"><strong>1101</strong></span>
===========================================================================
Path# Adapter/Path Name State Mode Select Errors
0 fscsi0/path0 CLOSE NORMAL 9 0
1 fscsi1/path1 CLOSE NORMAL 8 0

In case there are lot many disks, then it could be a tiring task of running above command and finding each device. You can use below
code which will list name of  devices and size (In MB) of disk.

for i in 1000 1100 1018 1118 1030 1130 104C 114C 1068 1168 1080 1180
do
j=`pcmpath query device|grep -p $i"$"|grep DEVICE|awk -F ":" '{print }'|awk '{print }`
k=`bootinfo -s $j`
echo $i $j $k
done

This would return following output

1000 hdisk4 65536


1100 hdisk10 65536
1018 hdisk5 65536
1118 hdisk11 65536
1030 hdisk6 65536
1130 hdisk12 65536
104C hdisk7 65536
114C hdisk13 65536
1068 hdisk8 65536
1168 hdisk14 65536
1080 hdisk9 65536
1180 hdisk15 65536

http://askdba.org/weblog/2009/02/creating-asm-devices-on-aix/ 1/6
8/4/2017 Creating ASM devices on AIX | AskDba.org Weblog
Now if you need to create new device name, you need to use mknod command and pass on major and minor numbers. Following code
can be used to perform same

#export m=0
# for i in hdisk4 hdisk10 hdisk5 hdisk11 hdisk6 hdisk12 hdisk7 hdisk13 hdisk8 hdisk14 hdisk9 hdisk15
do
j=`ls -la /dev/$i |awk '{print }'|awk -F "," '{print }'`
k=`ls -la /dev/$i |awk '{print }'`
m=`expr $m + 1` ;echo "mknod /dev/asm_disk"$m "c "$j $k
done

mknod /dev/asm_disk1 c 21 4
mknod /dev/asm_disk2 c 21 12
mknod /dev/asm_disk3 c 21 13
mknod /dev/asm_disk4 c 21 15
mknod /dev/asm_disk5 c 21 5
mknod /dev/asm_disk6 c 21 6
mknod /dev/asm_disk7 c 21 8
mknod /dev/asm_disk8 c 21 7
mknod /dev/asm_disk9 c 21 14
mknod /dev/asm_disk10 c 21 10
mknod /dev/asm_disk11 c 21 9
mknod /dev/asm_disk12 c 21 11

Now you can change the ownership to oracle:dba and permission to 660. I have 12 disks , so using list of 12 variables. In case you have
more disks , then you can add more variables

# for i in 1 2 3 4 5 6 7 8 9 10 11 12
do
chown oracle:dba /dev/asm_disk$i
chmod 660 /dev/asm_disk$i
done

crw-rw---- 1 oracle dba 21, 11 Jan 28 17:10 /dev/asm_disk12


crw-rw---- 1 oracle dba 21, 9 Jan 28 17:10 /dev/asm_disk11
crw-rw---- 1 oracle dba 21, 10 Jan 28 17:10 /dev/asm_disk10
crw-rw---- 1 oracle dba 21, 14 Jan 28 17:04 /dev/asm_disk9
crw-rw---- 1 oracle dba 21, 7 Jan 28 17:04 /dev/asm_disk8
crw-rw---- 1 oracle dba 21, 8 Jan 28 17:04 /dev/asm_disk7
crw-rw---- 1 oracle dba 21, 6 Jan 28 17:04 /dev/asm_disk6
crw-rw---- 1 oracle dba 21, 5 Jan 28 17:04 /dev/asm_disk5
crw-rw---- 1 oracle dba 21, 15 Jan 28 17:04 /dev/asm_disk4
crw-rw---- 1 oracle dba 21, 13 Jan 28 17:04 /dev/asm_disk3
crw-rw---- 1 oracle dba 21, 12 Jan 28 17:04 /dev/asm_disk2
crw-rw---- 1 oracle dba 21, 4 Jan 28 17:04 /dev/asm_disk1

In case you need to use same logic for creating OCR and Voting disks on RAC system, replace /dev/asm with /dev/ocr or /dev/voting . I
hope this would save some time and also prevent errors

In case you have disks in ordered number,say 53 to 62 then you can also use for loop as below.

#bash
bash-3.00#
#export m=0
#for ((i=53;i<=62;i++))
do
j=`ls -la /dev/hdisk$i |awk '{print }'|awk -F "," '{print }'`
k=`ls -la /dev/hdisk$i |awk '{print }'`
m=`expr $m + 1` ;echo "mknod /dev/asm_disk"$m "c "$j $k
done
#for ((i=1;i<=10;i++))
do
chown oracle:dba /dev/asm_disk$i

http://askdba.org/weblog/2009/02/creating-asm-devices-on-aix/ 2/6
8/4/2017 Creating ASM devices on AIX | AskDba.org Weblog
chmod 660 /dev/asm_disk$i
done

I would suggest anyone using the scripts to first check in a test environment.

Related Posts
10.2.0.4 on AIX5L (64-Bit) is Out
ASM Disk Discovery
CRS Fails to Start – 10.2.0.1 RAC Install on AIX
Effect of OS Terminal Setting “STTY” on Oracle Database
How To Discover Disk Name When LUN Number is Known (OEL5)

Share this:

       1
More

Premium SSIS Add-On Components

Increase the power of SSIS


and accelerate productivity
Learn More

1 February, 2009 in 10g. Tags: 10g, AIX5L, ASM, oracle, RAC, Unix

Related posts

PROCESSED Messages not clearing from Oracle Queue

ORA-01873 error running SAP pre-upgrade scripts

LGWR terminating instance due to error 338

← CRS Fails to Start – 10.2.0.1 RAC Install on AIX Scheduling Job through Cron?? →

7 thoughts on “Creating ASM devices on AIX”

John Rigler 2 October, 2009 at 7:28 pm

Instead of running the mknod, why not just do an ln of the rdisk:

(these two should be the same)


mknod /dev/asm_disk1 c 21 4
ln rhdisk4 asm_disk1

If you can find a way to increment the disk # easily, you would be golden and it would save a few lines

Reply

http://askdba.org/weblog/2009/02/creating-asm-devices-on-aix/ 3/6
8/4/2017 Creating ASM devices on AIX | AskDba.org Weblog

Amit 9 October, 2009 at 3:55 am

John,

You can use soft links but oracle recommend's using mknod to create link. You can use following code to
increment disk#

for i in 1960 20CD 20CE 20CF 21CD 21CE


do
j=`pcmpath query device|grep -p $i"$"|grep DEVICE|awk -F ":" '{print $3}'|awk '{print
$1}`
k=`bootinfo -s $j`
a=`ls -la /dev/$j |awk '{print $5}'|awk -F "," '{print $1}'`
b=`ls -la /dev/$j |awk '{print $6}'`
b=`echo $b |awk '{x=$0+0; print x}'`
if [ b -le 1 ]
then
b=`ls -la /dev/$j |awk '{print $5}'|awk -F "," '{print $2}'`
fi
if [ m -le 8 ]
then
m=`expr $m + 1` ;echo "mknod /dev/asm_disk0"$m "c "$a $b
else
m=`expr $m + 1` ;echo "mknod /dev/asm_disk"$m "c "$a $b
fi
done

-Amit

Reply

Martin 19 August, 2010 at 2:09 pm

Hi there,

check out this post, might be a copy of yours!

http://gjilevski.wordpress.com/2010/02/16/creating-asm-devices-on-aix/

The author has copied other user’s material in countless occasions without giving credit.

Reply

Amit 19 August, 2010 at 2:46 pm

Yeah Martin. This seems to be exact copy.I have put a comment, let’s see what he has to say.

Thanks for pointing it.

Cheers
Amit

Reply

Lucas 15 July, 2011 at 7:31 pm

http://askdba.org/weblog/2009/02/creating-asm-devices-on-aix/ 4/6
8/4/2017 Creating ASM devices on AIX | AskDba.org Weblog
Thanks to your instructions, I was able to get this working once before. However, I am trying to do it again and I’m
running into trouble. When I try to create the ASM disk group during the grid infrastructure installation, the disks do not
show up. In my case, the disks I’m trying to add are EMC powerpath disks. Any idea what could cause them to not show
up?

Reply

Saurabh Sood 16 July, 2011 at 9:02 am

Hi Lucas,

If you have set set asm_diskstring parameter to correct value i.e, something like /dev/rhd* (in case of emcpowerpath)
the disks should be visible to you.

If still the disks are not getting shown please check Metalink note 1174604.1 “ASM Is Not Detecting EMC PowerPath
Raw Devices Or Regular Raw Devices On AIX” as there could be some permissions issue.

Regards,
Saurabh Sood

Reply

Natarajan Gounder 14 March, 2017 at 10:00 pm

Thanks for the sharp article.


It would be to name as /dev/asmdisk_data_nn for DATA, /dev/asmdisk_ocr_nn for OCR/Voting (12c), and
/dev/asmdisk_fra_nn for FRA and then asm_diskstring could be like “/dev/asmdisk*” for ALL disks to be discovered by
ASM. It is good way to do for Oracle Grid 12c where ocr/voting disks could be in/part of ASM Disk groups.
thanks again.
Natarajan

Reply

Leave a Reply
Enter your comment here...

http://askdba.org/weblog/2009/02/creating-asm-devices-on-aix/ 5/6
8/4/2017 Creating ASM devices on AIX | AskDba.org Weblog

Search

Custom Search Search

Trending

How To Change/Restore User Password in 11G

MGMTDB: Grid Infrastructure Management Repository

GATHER_STATS_JOB - Is it enabled?

Resolving Shutdown Immediate Hang Situations

Solving ORA-1031 while connecting as "/ as sysdba" :

Recreating Database Link

12c:Limiting PGA with pga_aggregate_limit

Recent Comments

tolu on 11g: Multiple failed login attempt can block New Application connections

venkatesh on Retrieving Database SID,Port information from Grid Control repository

Patrick on Solving ORA-1031 while connecting as “/ as sysdba” :

Natarajan Gounder on Creating ASM devices on AIX

kryptonite30 on Solving ORA-1031 while connecting as “/ as sysdba” :

Subscribe to Blog via Email

http://askdba.org/weblog/2009/02/creating-asm-devices-on-aix/ 6/6

S-ar putea să vă placă și