Showing posts with label asmlib. Show all posts
Showing posts with label asmlib. Show all posts

Friday, February 1, 2013

Parsing KFOD-00307: asmlib error!! function = [asm_open], error = [0], mesg = [Operation not permitted]

This was a new installation and storage vendor had setup the block devices as below.
ls -l /dev/eql/*
lrwxrwxrwx 1 root root 8 Jan 15 12:00 /dev/eql/clus-01 -> ../dm-16
lrwxrwxrwx 1 root root 8 Jan 15 12:00 /dev/eql/clus-02 -> ../dm-18
lrwxrwxrwx 1 root root 8 Jan 15 12:00 /dev/eql/clus-03 -> ../dm-20
(Showing only the block devices relevant to the post). This was using Dell EqualLogic PS4100x iSCSI SAN and was told to use /dev/eql/* for the database. Though asked "why the softlink and /dev/dm*" was told that's how it setup and have to use the /dev/eql/* softlink for "my work". At this point decided to use ASMLib since it was not possible to change the ownership of the softlink and ASMLib was able to use root owned disks without a problem. The Oracle documents that have read (605828.1,470913.1,602952.1) said not to use /dev/dm* so didn't want to directly use them and conveyed this to storage vendor before proceeding.
Installed and configured ASMLib
/usr/sbin/oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=grid
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER="dm"
ORACLEASM_SCANEXCLUDE="sd"
and created the ASM disk that will be used in theASM diskgroup used for storing clusterware files using oracleasm
/etc/init.d/oracleasm listdisks
CLUS01
CLUS02
CLUS03
Went ahead with the installation and when at the ASM creation page, not ASM disks were visible when the discovery string ORCL:* was set. On the installer log following error message could be seen
INFO: ... discoveryString = ORCL:*
INFO: Executing [/tmp/OraInstall2013-01-10_02-28-18PM/ext/bin/kfod, nohdr=true, verbose=true, disks=all, status=true, op=disks, asm_diskstring='ORCL:*']
 with environment variables {XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt, LANG=en_GB.UTF-8, DISPLAY=:1, PWD=/home/grid/grid, _=/home/grid/grid/install/.oui, GS_LIB=/home/grid/.fonts, KDEDIR=/usr, KDE_MULTIHEAD=false, NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat, USER=grid, CLASSPATH=, XMODIFIERS=@im=none, G_BROKEN_FILENAMES=1, SSH_AGENT_PID=8475, COLORTERM=, HOME=/home/grid, HOSTNAME=RCL-DB-02, SESSION_MANAGER=local/RCL-DB-02:/tmp/.ICE-unix/8600, LESSOPEN=|/usr/bin/lesspipe.sh %s, LD_LIBRARY_PATH=/tmp/OraInstall2013-01-10_02-28-18PM/ext/bin/../lib, WINDOWID=4194311, ORACLE_HOME=/tmp/OraInstall2013-01-10_02-28-18PM/ext/bin, LOGNAME=grid, SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass, SHELL=/bin/bash, SSH_AUTH_SOCK=/tmp/ssh-GSFGtX8450/agent.8450, CVS_RSH=ssh, DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-KbHCyuMD9K,guid=1f484b25202997262dd3e40050eecda6, INPUTRC=/etc/inputrc, SHLVL=5, KDE_IS_PRELINKED=1, KDE_FULL_SESSION=true, HISTTIMEFORMAT=%b %e - %H:%M:%S , MAIL=/var/spool/mail/grid, KDE_NO_IPV6=1, VNCDESKTOP=RCL-DB-02:1 (grid), KONSOLE_DCOP=DCOPRef(konsole-8643,konsole), JAVA_HOME=, LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:, KONSOLE_DCOP_SESSION=DCOPRef(konsole-8643,session-1), LC_ALL=, HISTSIZE=1000, XDG_CONFIG_DIRS=/etc/kde/xdg:/etc/xdg, TERM=xterm, PATH=/usr/bin:/usr/ccs/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/grid/bin:/home/grid/grid/install}
INFO: Starting Output Reader Threads for process /tmp/OraInstall2013-01-10_02-28-18PM/ext/bin/kfod
INFO: Parsing KFOD-00307: asmlib error!! function = [asm_close], error = [0], mesg = [Invalid argument]
INFO: Parsing KFOD-00307: asmlib error!! function = [asm_open], error = [0], mesg = [Operation not permitted]
INFO: The process /tmp/OraInstall2013-01-10_02-28-18PM/ext/bin/kfod exited with code 0
INFO: Parsing KFOD-00307: asmlib error!! function = [asm_close], error = [0], mesg = [Invalid argument]
INFO: Waiting for output processor threads to exit.
INFO: Parsing KFOD-00307: asmlib error!! function = [asm_open], error = [0], mesg = [Operation not permitted]
INFO: Parsing KFOD-00307: asmlib error!! function = [asm_close], error = [0], mesg = [Invalid argument]
INFO: Parsing KFOD-00307: asmlib error!! function = [asm_open], error = [0], mesg = [Operation not permitted]
INFO: Output processor threads exited.
Closest metalink note that could be found was ORA-15186: ASMLIB error function = [asm_open], error = [1], mesg = [Operation not permitted] [ID 398622.1] but even that was not an exact match in terms of the error code and of no help as this was a new installation.
However it was confirmed that ASM disk are there by listing the /dev/oracleasm/disk and using that path in the discovery string.




It's at this point the tinkering work began. First place was the scan order. Try different combinations including eql/clus-*, eql/*, dm-* , dm* but still didn't discover any ASM disk using ORCL:*.
But when the exact device was specified in the scan order it was possible to get the ASM disks using the ORCL:*. It took a while to get the head around this
ORACLEASM_SCANORDER="dm" <---- DOES NOT WORK NO ASM DISK DISCOVERED
ORACLEASM_SCANORDER="dm-16 dm-18 dm-20" <--- WORK FINE SEE THE ASM DISK
At this point raise an SR. Understandably Oracle's initial effort revolved around checking if ASMLib setup is correct and it was confirmed to be setup correct and correct value for ORACLEASM_SCANORDER was dm. But still couldn't explain why dm doesn't work and dm-16 work (work = ASM disk visible in the installer).
After sometime an Oracle engineer spot the issue which was believed to do with the multipath setup used by the storage vendor and might even explain the oddity mentioned above. Storage vendor wasn't using the Linux multipathing software but a proprietary one that came with the SAN. Similar to SCANORDER and SCANEXCLUDE it had eql and ignore-eql.
ls -l /dev/ignore_eql/
lrwxrwxrwx 1 root root 8 Jan 18 19:32 0-1cb196-32b50460e-993001e8c7650e17_a -> ../dm-15
lrwxrwxrwx 1 root root 8 Jan 18 19:32 0-1cb196-33f50460e-197001e8c7950e17_a -> ../dm-17
lrwxrwxrwx 1 root root 8 Jan 18 19:32 0-1cb196-34f50460e-8a7001e8c7c50e17_a -> ../dm-19
lrwxrwxrwx 1 root root 7 Jan 18 19:32 0-1cb196-3a950460e-f17001e8c8550e17_a -> ../dm-9
lrwxrwxrwx 1 root root 8 Jan 18 19:32 0-1cb196-3ba50460e-ffb001e8c8850e17_a -> ../dm-13
lrwxrwxrwx 1 root root 8 Jan 18 19:32 0-1cb196-3c950460e-ce7001e8c8b50e17_a -> ../dm-11
lrwxrwxrwx 1 root root 7 Jan 18 19:32 0-1cb196-3e050460e-0a1001e8c8e50e17_a -> ../dm-5
lrwxrwxrwx 1 root root 7 Jan 18 19:32 0-1cb196-3f050460e-833001e8c9150e17_a -> ../dm-7
lrwxrwxrwx 1 root root 8 Jan 18 19:32 0-1cb196-3ff50460e-a3b001e8c9450e17_a -> ../dm-21

ls -l /dev/eql/
lrwxrwxrwx 1 root root 8 Jan 18 19:32 clus-01 -> ../dm-16
lrwxrwxrwx 1 root root 8 Jan 18 19:32 clus-02 -> ../dm-18
lrwxrwxrwx 1 root root 8 Jan 18 19:32 clus-03 -> ../dm-20
However looking at the /dev/mapper could see that there are multiple labels for the same device(only one set highlighted)
ls -l /dev/mapper/
brw-rw---- 1 root disk 253, 15 Jan 18 19:32 eql-0-1cb196-32b50460e-993001e8c7650e17_a <-- dm-15
brw-rw---- 1 root disk 253, 16 Jan 18 19:32 eql-0-1cb196-32b50460e-993001e8c7650e17-clus-01 <-- dm-16
brw-rw---- 1 root disk 253, 17 Jan 18 19:32 eql-0-1cb196-33f50460e-197001e8c7950e17_a
brw-rw---- 1 root disk 253, 18 Jan 18 19:32 eql-0-1cb196-33f50460e-197001e8c7950e17-clus-02
brw-rw---- 1 root disk 253, 19 Jan 18 19:32 eql-0-1cb196-34f50460e-8a7001e8c7c50e17_a
brw-rw---- 1 root disk 253, 20 Jan 18 19:32 eql-0-1cb196-34f50460e-8a7001e8c7c50e17-clus-03
and on the multipath list only one of these labels from each set appeared (only one highlighted)
 multipath -ll
eql-0-1cb196-34f50460e-8a7001e8c7c50e17_a () dm-19 EQLOGIC,100E-00
[size=1.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=2][active]
 \_ 6:0:0:0 sdf 8:80  [active][ready]
 \_ 14:0:0:0 sdm 8:192 [active][ready]
eql-0-1cb196-33f50460e-197001e8c7950e17_a () dm-17 EQLOGIC,100E-00
[size=1.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=2][active]
 \_ 1:0:0:0 sdj 8:144 [active][ready]
 \_ 15:0:0:0 sdn 8:208 [active][ready]
eql-0-1cb196-32b50460e-993001e8c7650e17_a () dm-15 EQLOGIC,100E-00
[size=1.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=2][active]
 \_ 16:0:0:0 sdo 8:224 [active][ready]
 \_ 17:0:0:0 sdp 8:240 [active][ready]
But the ASM is seeing all these paths.(only one set highlighted)
/etc/init.d/oracleasm querydisk -p CLUS01
Disk "CLUS01" is a valid ASM disk
/dev/sdj: LABEL="CLUS01" TYPE="oracleasm"
/dev/mapper/eql-0-1cb196-32b50460e-993001e8c7650e17_a: LABEL="CLUS01" TYPE="oracleasm" <-- dm-15
/dev/mapper/eql-0-1cb196-32b50460e-993001e8c7650e17-clus-01: LABEL="CLUS01" TYPE="oracleasm" <-- dm-16
/dev/sdp: LABEL="CLUS01" TYPE="oracleasm"

/etc/init.d/oracleasm querydisk -p CLUS02
Disk "CLUS02" is a valid ASM disk
/dev/sdf: LABEL="CLUS02" TYPE="oracleasm"
/dev/mapper/eql-0-1cb196-33f50460e-197001e8c7950e17_a: LABEL="CLUS02" TYPE="oracleasm"
/dev/mapper/eql-0-1cb196-33f50460e-197001e8c7950e17-clus-02: LABEL="CLUS02" TYPE="oracleasm"
/dev/sdo: LABEL="CLUS02" TYPE="oracleasm"

/etc/init.d/oracleasm querydisk -p CLUS03
Disk "CLUS03" is a valid ASM disk
/dev/mapper/eql-0-1cb196-34f50460e-8a7001e8c7c50e17_a: LABEL="CLUS03" TYPE="oracleasm"
/dev/mapper/eql-0-1cb196-34f50460e-8a7001e8c7c50e17-clus-03: LABEL="CLUS03" TYPE="oracleasm"
/dev/sdm: LABEL="CLUS03" TYPE="oracleasm"
/dev/sdn: LABEL="CLUS03" TYPE="oracleasm"
It was thought that this could explain why dm in the scan order would not discover any ASM disks while dm-16 (and others) could discover them.
Unfortunately that's where this post ends. Going to the storage vendor with this information didn't yield anything. "That's how it is setup" was repeated and due the time critical nature of the work decided to drop using ASMLib altogether and decided to go for block devices (events on this post happened before the post on the link) after letting the storage vendor know what Oracle says about using /dev/dm*.

Useful metalink notes
New ASMLib / oracleasm Disk Gets "header_status=Unknown" - Cannot be Added to ASM Diskgroup [ID 391136.1]
ORA-15186: ASMLIB error function = [asm_open], error = [1], mesg = [Operation not permitted] [ID 398622.1]

Monday, July 2, 2012

Moving ASMLib disk to block devices (Non-ASMLib) in 11gR2 RAC

This post list the steps to migrate from ASMLib to block devices in a 11gR2 RAC environment. There's an earlier post which list the step to migrate from ASMLib to block devices in a 11gR2 standalone system.
The cluster users ASM for the vote disk and OCR and current configuration is
crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   6d44155fe5054fb5bfd2abd3dee8a5b2 (ORCL:CLUS1) [CLUSTERDG]
 2. ONLINE   05233de65ba64fbebf13238219316963 (ORCL:CLUS2) [CLUSTERDG]
 3. ONLINE   84202daea6964f1ebf0af8c38e5a88f5 (ORCL:CLUS3) [CLUSTERDG]
Located 3 voting disk(s).
All the ASMLib disks in the system are
kfod disk=all
--------------------------------------------------------------------------------
 Disk          Size Path                                     User     Group
================================================================================
   1:       5114 Mb ORCL:CLUS1                                
   2:       5114 Mb ORCL:CLUS2                                
   3:       5114 Mb ORCL:CLUS3                                
   4:      10236 Mb ORCL:DATA                                 
   5:      10236 Mb ORCL:FLASH                                
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME
================================================================================
     +ASM1 /opt/app/11.2.0/grid3
     +ASM2 /opt/app/11.2.0/grid3
ASM instances
SQL> select inst_id,name,path,label from gv$asm_disk order by 1;

   INST_ID NAME       PATH       LABEL
---------- ---------- ---------- ----------
         1 DATA       ORCL:DATA  DATA
         1 CLUS3      ORCL:CLUS3 CLUS3
         1 CLUS2      ORCL:CLUS2 CLUS2
         1 CLUS1      ORCL:CLUS1 CLUS1
         1 FLASH      ORCL:FLASH FLASH
         2 DATA       ORCL:DATA  DATA
         2 CLUS3      ORCL:CLUS3 CLUS3
         2 CLUS2      ORCL:CLUS2 CLUS2
         2 CLUS1      ORCL:CLUS1 CLUS1
         2 FLASH      ORCL:FLASH FLASH
1. The ASMLib to block device migration could be done in a rolling fashion. Before proceeding shutdown the database instance on the node that's being worked on.
srvctl stop instance -d rac11g2 -i rac11g21
2. Unlike in the previous cases it was not possible to test the migration on a one node and one a single disk group.
/etc/init.d/oracleasm querydisk -d FLASH
Disk "FLASH" is a valid ASM disk on device [8, 81]

ls -l /dev/sd*
...
brw-r----- 1 root disk 8, 80 Jun 25 13:03 /dev/sdf
brw-r----- 1 root disk 8, 81 Jun 25 13:04 /dev/sdf1
brw-r----- 1 root disk 8, 96 Jun 25 13:03 /dev/sdg
brw-r----- 1 root disk 8, 97 Jun 25 13:04 /dev/sdg1

chown oracle:asmadmin /dev/sdf1

SQL> alter diskgroup flash dismount;

Diskgroup altered.

SQL> alter system set asm_diskstring='/dev/sdf1','ORCL:CLUS1','ORCL:CLUS2','ORCL:CLUS3','ORCL:DATA' scope=memory sid='+ASM1';

System altered.
It is important to set the parameter change instance level (sid='+ASM1') otherwise following error will be thrown
SQL> alter system set asm_diskstring='ORCL:CLUS*','ORCL:DATA*','/dev/sdf1' scope=memory;
alter system set asm_diskstring='ORCL:CLUS*','ORCL:DATA*','/dev/sdf1' scope=memory
*
ERROR at line 1:
ORA-32008: error while processing parameter update at instance +ASM2
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-15014: path 'ORCL:FLASH' is not in the discovery set
Mounting the diskgroup again results in diskgroup using the ASMLib disk not the value set on the ASM diskstring parameter, which was happening in non-rac 11gR2 and 11gR1 RAC environments.
Mon Jun 25 13:44:38 2012
SQL> alter diskgroup flash dismount
NOTE: cache dismounting (clean) group 3/0x9A384CBC (FLASH)
NOTE: messaging CKPT to quiesce pins Unix process pid: 6170, image: oracle@rac4.code.net (TNS V1-V3)
Mon Jun 25 13:44:38 2012
NOTE: LGWR doing clean dismount of group 3 (FLASH)
NOTE: LGWR closing thread 1 of diskgroup 3 (FLASH) at ABA 58.1895
NOTE: LGWR released thread recovery enqueue
...
...
Mon Jun 25 13:44:38 2012
NOTE: diskgroup resource ora.FLASH.dg is offline
NOTE: diskgroup resource ora.FLASH.dg is updated
ALTER SYSTEM SET asm_diskstring='/dev/sdf1','ORCL:CLUS1','ORCL:CLUS2','ORCL:CLUS3','ORCL:DATA' SCOPE=MEMORY SID='+ASM1';
SQL> alter diskgroup flash mount
NOTE: cache registered group FLASH number=3 incarn=0xa6c84cc2
NOTE: cache began mount (first) of group FLASH number=3 incarn=0xa6c84cc2
NOTE: Assigning number (3,0) to disk (ORCL:FLASH)
Mon Jun 25 13:44:51 2012
NOTE: GMON heartbeating for grp 3
GMON querying group 3 at 50 for pid 27, osid 6170
3. Therefore all the ASMLib disk in the ASM instance were migrated to block devices
# /etc/init.d/oracleasm querydisk -d FLASH
Disk "FLASH" is a valid ASM disk on device [8, 81]
# /etc/init.d/oracleasm querydisk -d data
Disk "DATA" is a valid ASM disk on device [8, 65]
# /etc/init.d/oracleasm querydisk -d clus1
Disk "CLUS1" is a valid ASM disk on device [8, 17]
# /etc/init.d/oracleasm querydisk -d clus2
Disk "CLUS2" is a valid ASM disk on device [8, 33]
# /etc/init.d/oracleasm querydisk -d clus3
Disk "CLUS3" is a valid ASM disk on device [8, 49]

# chown oracle:asmadmin /dev/sdb1
# chown oracle:asmadmin /dev/sdc1
# chown oracle:asmadmin /dev/sdd1
# chown oracle:asmadmin /dev/sde1

# ls -l /dev/sd*
...
brw-r----- 1 root   disk     8, 16 Jun 25 13:03 /dev/sdb
brw-r----- 1 oracle asmadmin 8, 17 Jun 25 13:04 /dev/sdb1
brw-r----- 1 root   disk     8, 32 Jun 25 13:03 /dev/sdc
brw-r----- 1 oracle asmadmin 8, 33 Jun 25 13:04 /dev/sdc1
brw-r----- 1 root   disk     8, 48 Jun 25 13:03 /dev/sdd
brw-r----- 1 oracle asmadmin 8, 49 Jun 25 13:04 /dev/sdd1
brw-r----- 1 root   disk     8, 64 Jun 25 13:03 /dev/sde
brw-r----- 1 oracle asmadmin 8, 65 Jun 25 13:04 /dev/sde1
brw-r----- 1 root   disk     8, 80 Jun 25 13:03 /dev/sdf
brw-r----- 1 oracle asmadmin 8, 81 Jun 25 13:04 /dev/sdf1
brw-r----- 1 root   disk     8, 96 Jun 25 13:03 /dev/sdg
brw-r----- 1 root   disk     8, 97 Jun 25 13:04 /dev/sdg1
4. Change the asm_diskstring on the ASM instance
SQL> alter system set asm_diskstring='/dev/sdb1','/dev/sdc1','/dev/sdd1','/dev/sde1','/dev/sdf1' scope=spfile sid='+ASM1';

System altered.
5. Create udev rules file in the node
# ASM OCR VOTE
KERNEL=="sdb[1]", OWNER="oracle", GROUP="asmadmin", MODE="660"
KERNEL=="sdc[1]", OWNER="oracle", GROUP="asmadmin", MODE="660"
KERNEL=="sdd[1]", OWNER="oracle", GROUP="asmadmin", MODE="660"

# ASM DATA
KERNEL=="sde[1]", OWNER="oracle", GROUP="asmadmin", MODE="660"

# ASM FLASH
KERNEL=="sdf[1]", OWNER="oracle", GROUP="asmadmin", MODE="660"
6. Shutdown the clusterware stack on the node. Unlike in 11gR1 RAC since clusterware is also dependent on ASM diskgroup a database instance shutdown alone is not enough to complete the migration. A full clusterware stack shutdown on the node that's being worked on is required. Other node can remain open.
# crsctl stop crs


7. Unload the oracleasm module
# /sbin/lsmod  | grep oracleasm
oracleasm              84136  1

# /etc/init.d/oracleasm stop
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

# /etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration: done
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

# /sbin/chkconfig oracleasm off
8. Start the crs and verify the new block devices are in use by monitoring the ASM alert log
# crsctl start crs

crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   6d44155fe5054fb5bfd2abd3dee8a5b2 (/dev/sdb1) [CLUSTERDG]
 2. ONLINE   05233de65ba64fbebf13238219316963 (/dev/sdc1) [CLUSTERDG]
 3. ONLINE   84202daea6964f1ebf0af8c38e5a88f5 (/dev/sdd1) [CLUSTERDG]
Located 3 voting disk(s).

SQL> ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:2} */
NOTE: Diskgroups listed in ASM_DISKGROUPS are
         DATA
         FLASH
NOTE: Diskgroup used for Voting files is:
         CLUSTERDG
Diskgroup with spfile:CLUSTERDG
Diskgroup used for OCR is:CLUSTERDG
NOTE: cache registered group CLUSTERDG number=1 incarn=0xeadcf7b1
NOTE: cache began mount (not first) of group CLUSTERDG number=1 incarn=0xeadcf7b1
NOTE: cache registered group DATA number=2 incarn=0xeaecf7b2
NOTE: cache began mount (not first) of group DATA number=2 incarn=0xeaecf7b2
NOTE: cache registered group FLASH number=3 incarn=0xa6ccf7b3
NOTE: cache began mount (not first) of group FLASH number=3 incarn=0xa6ccf7b3
NOTE: Assigning number (1,0) to disk (/dev/sdb1)
NOTE: Assigning number (1,1) to disk (/dev/sdc1)
NOTE: Assigning number (1,2) to disk (/dev/sdd1)
NOTE: Assigning number (2,0) to disk (/dev/sde1)
NOTE: Assigning number (3,0) to disk (/dev/sdf1)
GMON querying group 1 at 4 for pid 23, osid 7880
NOTE: cache opening disk 0 of grp 1: CLUS1 path:/dev/sdb1
NOTE: F1X0 found on disk 0 au 2 fcn 0.0
NOTE: cache opening disk 1 of grp 1: CLUS2 path:/dev/sdc1
NOTE: F1X0 found on disk 1 au 2 fcn 0.0
NOTE: cache opening disk 2 of grp 1: CLUS3 path:/dev/sdd1
NOTE: F1X0 found on disk 2 au 2 fcn 0.0
NOTE: cache mounting (not first) normal redundancy group 1/0xEADCF7B1 (CLUSTERDG)
...
NOTE: cache mounting group 1/0xEADCF7B1 (CLUSTERDG) succeeded
NOTE: cache ending mount (success) of group CLUSTERDG number=1 incarn=0xeadcf7b1
GMON querying group 2 at 5 for pid 23, osid 7880
NOTE: cache opening disk 0 of grp 2: DATA path:/dev/sde1
NOTE: F1X0 found on disk 0 au 2 fcn 0.0
NOTE: cache mounting (not first) external redundancy group 2/0xEAECF7B2 (DATA)
...
NOTE: cache mounting group 2/0xEAECF7B2 (DATA) succeeded
NOTE: cache ending mount (success) of group DATA number=2 incarn=0xeaecf7b2
GMON querying group 3 at 6 for pid 23, osid 7880
NOTE: cache opening disk 0 of grp 3: FLASH path:/dev/sdf1
NOTE: F1X0 found on disk 0 au 2 fcn 0.0
NOTE: cache mounting (not first) external redundancy group 3/0xA6CCF7B3 (FLASH)
9. From the data views
SQL> select inst_id,name,path,label from gv$asm_disk order by 1;

   INST_ID NAME       PATH       LABEL
---------- ---------- ---------- ----------
         1 DATA       /dev/sde1
         1 CLUS3      /dev/sdd1
         1 CLUS2      /dev/sdc1
         1 CLUS1      /dev/sdb1
         1 FLASH      /dev/sdf1
         2 DATA       ORCL:DATA  DATA
         2 CLUS3      ORCL:CLUS3 CLUS3
         2 CLUS2      ORCL:CLUS2 CLUS2
         2 CLUS1      ORCL:CLUS1 CLUS1
         2 FLASH      ORCL:FLASH FLASH

10 rows selected.
10. Since it's verified that ASMLib to block device migration is working make the changes applicable to all ASM instances in the cluster by removing the instance specific asm_diskstring entry and changing the entry applicable to all instances
SQL> alter system reset asm_diskstring scope=spfile sid='+ASM1';

System altered.

SQL> alter system set asm_diskstring='/dev/sdb1','/dev/sdc1','/dev/sdd1','/dev/sde1','/dev/sdf1' scope=spfile;

System altered.
11. Make udev rules file on all the remaining nodes
# ASM OCR VOTE
KERNEL=="sdb[1]", OWNER="oracle", GROUP="asmadmin", MODE="660"
KERNEL=="sdc[1]", OWNER="oracle", GROUP="asmadmin", MODE="660"
KERNEL=="sdd[1]", OWNER="oracle", GROUP="asmadmin", MODE="660"

# ASM DATA
KERNEL=="sde[1]", OWNER="oracle", GROUP="dba", MODE="660"

# ASM FLASH
KERNEL=="sdf[1]", OWNER="oracle", GROUP="asmadmin", MODE="660"
12. Stop the cluster stack and unload and disable the oracleasm module starting on reboot and start the cluster stack
crsctl stop crs

# /sbin/lsmod  | grep oracleasm
oracleasm              84136  1
# /etc/init.d/oracleasm stop
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

# /etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration: done
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

# /sbin/chkconfig oracleasm off

crsctl start crs
13. Remove oracleasm libraries
# rpm -e oracleasmlib-2.0.4-1.el5
# rpm -e oracleasm-2.6.18-194.el5-2.0.5-1.el5
# rpm -e oracleasm-support-2.1.3-1.el5
This concludes the ASMLib to block device migration.

If the correct permission and ownership setting are not set on the block devices the start of the clusterware stack will fail and following could be observed in the ocssd.log
2012-06-25 14:03:35.314: [    CSSD][1093900608]clssnmReadDiscoveryProfile: voting file discovery string(/dev/sdb1,/dev/sdc1,/dev/sdd1,/dev/sde1,/dev/sdf1)
2012-06-25 14:03:35.314: [    CSSD][1093900608]clssnmvDDiscThread: using discovery string /dev/sdb1,/dev/sdc1,/dev/sdd1,/dev/sde1,/dev/sdf1 for initial discovery
2012-06-25 14:03:35.314: [   SKGFD][1093900608]Discovery with str:/dev/sdb1,/dev/sdc1,/dev/sdd1,/dev/sde1,/dev/sdf1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]UFS discovery with :/dev/sdb1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]Fetching UFS disk :/dev/sdb1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]OSS discovery with :/dev/sdb1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]Discovery advancing to nxt string :/dev/sdc1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]UFS discovery with :/dev/sdc1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]Fetching UFS disk :/dev/sdc1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]OSS discovery with :/dev/sdc1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]Discovery advancing to nxt string :/dev/sdd1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]UFS discovery with :/dev/sdd1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]Fetching UFS disk :/dev/sdd1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]OSS discovery with :/dev/sdd1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]Discovery advancing to nxt string :/dev/sde1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]UFS discovery with :/dev/sde1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]Fetching UFS disk :/dev/sde1:
2012-06-25 14:03:35.314: [   SKGFD][1093900608]OSS discovery with :/dev/sde1:
2012-06-25 14:03:35.315: [   SKGFD][1093900608]Discovery advancing to nxt string :/dev/sdf1:
2012-06-25 14:03:35.315: [   SKGFD][1093900608]UFS discovery with :/dev/sdf1:
2012-06-25 14:03:35.315: [   SKGFD][1093900608]Fetching UFS disk :/dev/sdf1:
2012-06-25 14:03:35.315: [   SKGFD][1093900608]OSS discovery with :/dev/sdf1:
2012-06-25 14:03:35.315: [    CSSD][1093900608]clssnmvDiskVerify: Successful discovery of 0 disks
Setting the correct permission and ownership and restarting the clusterware stack will resolve this issue.

Related Posts
Migrating block devices using ASM instance to ASMLib
Moving ASMLib disk to block devices (Non-ASMLib) in 11gR2 Standalone
Moving ASMLib disk to block devices (Non-ASMLib) in 11gR1 RAC

Useful Metalink Notes
How To Migrate ASMLIB Devices To Block Devices (Non-ASMLIB)? [ID 567508.1]

Friday, June 22, 2012

Upgrading ASMLib and OS in 11gR1 RAC Environment

Upgrading operating system (OS) requires several consideration and tasks.
1. If ASMLib is used then ASMLib libraries must be upgraded as part of the OS upgrade.
2. After the upgrade Oracle/clusterware binaries should be relinked.
In this case the two nodes 11gR1 (11.1.0.7) RAC environment running on RHEL 5 (2.6.18-194.el5) will be upgraded to RHEL 5 (2.6.18-308.el5).
As per (743649.1) Oralce support rolling upgrade of OS when both OS are certified on the database that's running. This is supported only for the duration of the upgrade. But according to (1391807.1) using multiple versions of ASMLib across the cluster may not be compatible. To avoid these incompatible issues and to minimize the total downtime one node could be upgraded first and then shutting down the other node before the upgraded one with new version of ASMLib is started. This way only one node will be active in the cluster when two nodes are having different ASMLib versions. In this case all nodes are upgraded at the same time incurring total system outage.

1. Find out if ASMLibs are available for the kernel version to which the system is being upgraded to. If not move asmlib devices to block devices before the upgrade (also true if upgrading to RHEL 6 where to get asmlibs require ULN account) or see if (462618.1) could be of any help.

2. Make a note of the ownership and permission of the following files in $CRS_HOME/bin directory using the script below. Some files might be missing this is not a problem.
#!/bin/sh

if [ "$CRS_HOME" != "" ]; then
                echo "crs home exist"

        for i in clntsh.map clntst_1.lis clntst_2.lis clntst.lis libclntsh.so libclntsh.so.10.1 libclntst10.so libclntsh.so.11.1 libclntst11.so clntst
        do
                if [ -f $CRS_HOME/lib/$i ]; then
                        echo "file exists"
                        ls -l $CRS_HOME/lib/$i

                        if [ -f $CRS_HOME/lib32/$i ]; then
                                echo "file in lib32"
                                ls -l $CRS_HOME/lib32/$i
                        else
                                echo "file not exists"
                        fi
                else
                        if [ -f $CRS_HOME/lib32/$i ]; then
                                echo "file in lib32"
                                ls -l $CRS_HOME/lib32/$i
                        else
                                echo "file not exists"
                        fi
                fi
        done
else
                echo "Please set CRS_HOME and run again"
fi

./cluster_file_check.sh
crs home exist
file exists
-rwxr--r-- 1 root root 4765562 Feb  8  2011 /opt/crs/oracle/product/11.1.0/crs/lib/clntsh.map
file in lib32
-rw-r--r-- 1 root root 3985432 Feb  8  2011 /opt/crs/oracle/product/11.1.0/crs/lib32/clntsh.map
file not exists
file not exists
file not exists
file exists
lrwxrwxrwx 1 root root 17 Feb  8  2011 /opt/crs/oracle/product/11.1.0/crs/lib/libclntsh.so -> libclntsh.so.11.1
file in lib32
lrwxrwxrwx 1 root root 17 Feb  8  2011 /opt/crs/oracle/product/11.1.0/crs/lib32/libclntsh.so -> libclntsh.so.11.1
file exists
lrwxrwxrwx 1 oracle oinstall 51 Feb  8  2011 /opt/crs/oracle/product/11.1.0/crs/lib/libclntsh.so.10.1 -> /opt/crs/oracle/product/11.1.0/crs/lib/libclntsh.so
file in lib32
lrwxrwxrwx 1 oracle oinstall 53 Feb  8  2011 /opt/crs/oracle/product/11.1.0/crs/lib32/libclntsh.so.10.1 -> /opt/crs/oracle/product/11.1.0/crs/lib32/libclntsh.so
file not exists
file exists
-rwxr-xr-x 1 root root 48316147 Feb  8  2011 /opt/crs/oracle/product/11.1.0/crs/lib/libclntsh.so.11.1
file in lib32
-rwxr-xr-x 1 root root 37081093 Feb  8  2011 /opt/crs/oracle/product/11.1.0/crs/lib32/libclntsh.so.11.1
file not exists
file not exists
3. Make a note of the asm disk's scsi_ids , this setup is a test setup using Virtualbox. The scsi_ids will be compared after the OS upgrade and must be the same as before the upgrade.
# blkid|grep sd.*oracleasm|while read a b;do echo -n $a$b" scsi_id=";(echo $a|tr -d [:digit:]|tr -d [:]|cut -d"/" -f3|xargs -i scsi_id -g -s /block/{})done;
/dev/sdc1:LABEL="DATA" TYPE="oracleasm" scsi_id=SATA     VBOX HARDDISK  VB35fd6dbb-14d87b49
/dev/sdd1:LABEL="FLASH" TYPE="oracleasm" scsi_id=SATA     VBOX HARDDISK  VB4b88ed44-eff71eb1
4. Shutdown the cluster stack across the cluster. If one node at a time is upgraded then do this only on one node. In this case since all nodes are upgraded at the same time entire cluster is brought down
crs_stop -all
5. Stop the crs and disbale auto start of the crs. Do this on all ndoes.
# crsctl stop crs
Stopping resources.
This could take several minutes.
Successfully stopped Oracle Clusterware resources
Stopping Cluster Synchronization Services.
Shutting down the Cluster Synchronization Services daemon.
Shutdown request successfully issued.

# crsctl disable crs
Oracle Clusterware is disabled for start-up after a reboot.
6. Comment out the crs spwaning processes entries in /etc/inittab. Do this on all nodes
#h1:35:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 </dev/null
#h2:35:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 </dev/null
#h3:35:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1 </dev/null
Run init on the systme and verify that no crs related processes are running.
/sbin/init q

ps -ef|grep css
ps -ef|grep crs
ps -ef|grep evm
ps -ef|grep init
7. Stop oracleasm running and disable and prevent it loading on reboot. Do this on all nodes.
# /etc/init.d/oracleasm stop
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

# /etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration: done
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

# /sbin/chkconfig --list | grep oracleasm
oracleasm       0:off   1:off   2:on    3:on    4:on    5:on    6:off
# /sbin/chkconfig oracleasm off
# /sbin/chkconfig --list | grep oracleasm
oracleasm       0:off   1:off   2:off   3:off   4:off   5:off   6:off
8. Make a backup of /etc/sysconfig/oracleasm-_dev_oracleasm on all nodes.
# cp /etc/sysconfig/oracleasm-_dev_oracleasm /etc/sysconfig/oracleasm-_dev_oracleasm.bak
At this point the system is ready for the OS upgrade.

9. Carry out the OS ugprade. All Oracle Home locations (ORACLE_HOME,ASM_HOME and CRS_HOME) are to be same before and after the upgrade





10. Install the new version of oracleasm and remove the old version. Old version could only be removed after installing the new version due to dependencies.
rpm -e oracleasm-2.6.18-194.el5-2.0.5-1.el5
error: Failed dependencies:
        oracleasm >= 1.0.4 is needed by (installed) oracleasmlib-2.0.4-1.el5.x86_64

# rpm -ivh oracleasm-2.6.18-308.el5-2.0.5-1.el5.x86_64.rpm
warning: oracleasm-2.6.18-308.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-2.6.18-308.el########################################### [100%]

# rpm -e oracleasm-2.6.18-194.el5-2.0.5-1.el5

# rpm -qa | grep oracleasm
oracleasmlib-2.0.4-1.el5
oracleasm-2.6.18-308.el5-2.0.5-1.el5
oracleasm-support-2.1.3-1.el5
11. Configure oracleasm and make sure content on oracleasm-_dev_oracleasm.bak and oracleasm-_dev_oracleasm are the same.
/etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting  without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface [oracle]:
Default group to own the driver interface [dba]:
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]
12. Enable oracleasm and set it up to start on reboot.
/etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]

chkconfig --list | grep oracleasm
oracleasm       0:off   1:off   2:off   3:off   4:off   5:off   6:off

# chkconfig oracleasm on

# chkconfig --list | grep oracleasm
oracleasm       0:off   1:off   2:on    3:on    4:on    5:on    6:off
13. Verify scsi_id are same as before the upgrade
# blkid|grep sd.*oracleasm|while read a b;do echo -n $a$b" scsi_id=";(echo $a|tr -d [:digit:]|tr -d [:]|cut -d"/" -f3|xargs -i scsi_id -g -s /block/{})done;
/dev/sdc1:LABEL="DATA" TYPE="oracleasm" scsi_id=SATA     VBOX HARDDISK  VB35fd6dbb-14d87b49
/dev/sdd1:LABEL="FLASH" TYPE="oracleasm" scsi_id=SATA     VBOX HARDDISK  VB4b88ed44-eff71eb1
With this the ASMLib upgrade is complete. Next is to relink the Oracle binaries.

14. As oracle user relink both ASM_HOME and ORACLE_HOME. Verify which relink is in the path variable using
which relink
Relink ORACLE_HOME
$ cd $ORACLE_HOME/bin
$ relink all
Reset the PATH and ORACLE_HOME before running relink for ASM_HOME
export PATH=$ASM_HOME/bin:$PATH
export ORACLE_HOME=$ASM_HOME
Verify the relink binary from ASM_HOME is in path
which relink
Run the relink of ASM_HOME
$ cd $ASM_HOME/bin
$ relink all
15. As per (743649.1 step 10) clusterware client shared libraries should be relinked as the clusterware software owner. But running this as software owner result in permission issue
export ORACLE_HOME=$CRS_HOME (important to set ORACLE_HOME variable to CRS_HOME location)
cd $ORACLE_HOME/bin

./genclntsh
/bin/rm: cannot remove `/opt/crs/oracle/product/11.1.0/crs/lib/libclntsh.so.11.1': Permission denied
/bin/rm: cannot remove `/opt/crs/oracle/product/11.1.0/crs/lib/clntsh.map': Permission denied
./genclntsh: line 309: /opt/crs/oracle/product/11.1.0/crs/lib/clntsh.map: Permission denied
genclntsh: Failed to link libclntsh.so.11.1
Permission issue persist even after setting the permission to oracle:oinstall. Running ./genclntsh as root results in files get created with new timestamp permission same as before (metalink note could be wrong!??). When genclntsh runs without any issue no message is shown and return to shell prompt. After run check the file permissions are same as before (step 2 above).
./cluster_file_check.sh
crs home exist
file exists
-rw-r--r-- 1 root root 4764652 Jun 20 16:49 /opt/crs/oracle/product/11.1.0/crs/lib/clntsh.map
file in lib32
-rw-r--r-- 1 root root 3984490 Jun 20 16:49 /opt/crs/oracle/product/11.1.0/crs/lib32/clntsh.map
file not exists
file not exists
file not exists
file exists
lrwxrwxrwx 1 root root 17 Jun 20 16:49 /opt/crs/oracle/product/11.1.0/crs/lib/libclntsh.so -> libclntsh.so.11.1
file in lib32
lrwxrwxrwx 1 root root 17 Jun 20 16:49 /opt/crs/oracle/product/11.1.0/crs/lib32/libclntsh.so -> libclntsh.so.11.1
file exists
lrwxrwxrwx 1 oracle oinstall 51 Feb  8  2011 /opt/crs/oracle/product/11.1.0/crs/lib/libclntsh.so.10.1 -> /opt/crs/oracle/product/11.1.0/crs/lib/libclntsh.so
file in lib32
lrwxrwxrwx 1 oracle oinstall 53 Feb  8  2011 /opt/crs/oracle/product/11.1.0/crs/lib32/libclntsh.so.10.1 -> /opt/crs/oracle/product/11.1.0/crs/lib32/libclntsh.so
file not exists
file exists
-rwxr-xr-x 1 root root 48316147 Jun 20 16:49 /opt/crs/oracle/product/11.1.0/crs/lib/libclntsh.so.11.1
file in lib32
-rwxr-xr-x 1 root root 37081093 Jun 20 16:49 /opt/crs/oracle/product/11.1.0/crs/lib32/libclntsh.so.11.1
file not exists
file not exists
16. Enable crs and remove the comments on /etc/inittab and start crs
# crsctl enable crs
Oracle Clusterware is enabled for start-up after a reboot.

h1:35:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 </dev/null
h2:35:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 </dev/null
h3:35:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1 </dev/null
17. Start crs with crsctl or with OS init
crsctl start crs
Attempting to start Oracle Clusterware stack
The CRS stack will be started shortly
or
/sbin/init q
This conclude the ASMLib and OS upgrade.

Useful Metalink Notes
How to Relink Oracle Database Software on UNIX [ID 131321.1]
Is It Necessary To Relink Oracle Following OS Upgrade? [ID 444595.1]
Will an Operating System Upgrade Affect Oracle Clusterware? [ID 743649.1]
How To Upgrade ASMLib Kernel Driver as Part of Kernel Upgrade? [ID 1391807.1]
Do You Need to Relink Oracle Clusterware When Upgrading the Operating System? [ID 743649.1]
Is It Required To Relink The Oracle Binaries When Booting With The Old Kernel? [ID 461138.1]
Cannot Find Exact Kernel Version Match For ASMLib (Workaround using oracleasm_debug_link tool) [ID 462618.1]
RAC: Frequently Asked Questions [ID 220970.1] (Is a relink required for the clusterware home after an OS upgrade?)

Useful White Paper
Best Practices for Optimizing Availability During Planned Maintenance Using Oracle Clusterware and Oracle Real Application Clusters. Oracle Maximum Availability Architecture White Paper September 2007

Related Posts
Upgrading RHEL 6 OS in a 11gR2 RAC Environment
Upgrading OS in 11gR2 RAC Environment (RHEL 5)

Moving ASMLib disk to block devices (Non-ASMLib) in 11gR1 RAC

This post list steps specific to moving ASMLib disk to block devices in two nodes 11gR1 RAC environment. There's an earlier post which shows steps involved with moving ASMLib to block devices in a 11gR2 standalone setup. Most of the steps are similar as the earlier post but in the RAC environment the moving from ASMLib to block device could be done in a rolling fashion reducing down time.

1. Create a pfile from the asm spfile. This is more for protection (to start ASM if there's a mistake in asm_string and can't get the ASM up with spfile) and is not part of the moving process.
SQL> create pfile='/home/oracle/asmpfile.ora' from spfile;
File created.

more asmpfile.ora
+ASM1.__oracle_base='/opt/app/oracle'#ORACLE_BASE set from environment
+ASM2.__oracle_base='/opt/app/oracle'#ORACLE_BASE set from environment
+ASM1.asm_diskgroups='DATA','FLASH'
+ASM2.asm_diskgroups='DATA','FLASH'
*.cluster_database=true
*.diagnostic_dest='/opt/app/oracle'
+ASM2.instance_number=2
+ASM1.instance_number=1
*.instance_type='asm'
*.large_pool_size=12M
2. Current ASM disks
SQL> select name,label,path from v$asm_disk;

NAME       LABEL      PATH
---------- ---------- ----------
DATA       DATA       ORCL:DATA
FLASH      FLASH      ORCL:FLASH
3. It is possible to dismount diskgroup in one node and test the procedure before applying the changes permanently.
SQL> alter diskgroup flash dismount
From ASM alert log
SQL> alter diskgroup flash dismount
NOTE: cache dismounting group 2/0x73784638 (FLASH)
Fri Jun 22 13:29:49 2012
kjbdomdet send to node 1
detach from dom 2, sending detach message to node 1
Fri Jun 22 13:29:49 2012
NOTE: detached from domain 2
NOTE: cache dismounted group 2/0x73784638 (FLASH)
kfdp_dismount(): 9
Fri Jun 22 13:29:49 2012
kfdp_dismountBg(): 9
NOTE: De-assigning number (2,0) from disk (ORCL:FLASH)
SUCCESS: diskgroup FLASH was dismounted
SUCCESS: alter diskgroup flash dismount
Status of ASM disks accross cluster which shows FLASH disgroup in node 1 dismounted
SQL> select inst_id,name,state from gv$asm_diskgroup; 

   INST_ID NAME      STATE
    ------- --------- -----------
         2 DATA      MOUNTED
         2 FLASH     MOUNTED
         1 DATA      MOUNTED
         1 FLASH     DISMOUNTED
4. Query the ASMLib disk and find out the block device used for creating ASMLib disk
# /etc/init.d/oracleasm querydisk -d FLASH
Disk "FLASH" is a valid ASM disk on device [8, 49]

ls -l /dev/sd*
...
brw-r----- 1 root   disk     8, 32 Jun 20 17:16 /dev/sdc
brw-r----- 1 root   disk     8, 33 Jun 20 17:17 /dev/sdc1
brw-r----- 1 root   disk     8, 48 Jun 20 17:16 /dev/sdd
brw-r----- 1 root   disk     8, 49 Jun 20 17:17 /dev/sdd1
Change the ownership of the block device
chown oracle:dba /dev/sdd1

ls -l /dev/sd*
...
brw-r----- 1 root   disk     8, 32 Jun 20 17:16 /dev/sdc
brw-r----- 1 root   disk     8, 33 Jun 20 17:17 /dev/sdc1
brw-r----- 1 root   disk     8, 48 Jun 20 17:16 /dev/sdd
brw-r----- 1 oracle dba      8, 49 Jun 20 17:17 /dev/sdd1
5. Change the asm_diskstring to include the block device and mount the flash diskgroup
SQL> alter system set asm_diskstring ='ORCL:DATA','/dev/sdd1' scope=memory;
System altered.
Mount the FLASH diskgroup and verify block device is used for ASM diskgroup
SQL> alter diskgroup flash mount

NOTE: cache registered group FLASH number=2 incarn=0x73784644
NOTE: cache began mount (not first) of group FLASH number=2 incarn=0x73784644
NOTE: Assigning number (2,0) to disk (/dev/sdd1)
kfdp_query(FLASH): 11
Fri Jun 22 13:35:46 2012
kfdp_queryBg(): 11
NOTE: cache opening disk 0 of grp 2: FLASH path:/dev/sdd1
NOTE: F1X0 found on disk 0 fcn 0.0
NOTE: cache mounting (not first) group 2/0x73784644 (FLASH)
Fri Jun 22 13:35:46 2012
kjbdomatt send to node 1
From the data views
SQL> select inst_id,name,label,path from gv$asm_disk;

   INST_ID NAME       LABEL      PATH
---------- ---------- ---------- ----------
         1 DATA       DATA       ORCL:DATA
         1 FLASH                 /dev/sdd1
         2 DATA       DATA       ORCL:DATA
         2 FLASH      FLASH      ORCL:FLASH
6. Do the same with the other diskgroup. Query the disk to find out the block device and change the ownership of the block device so oracle process could write to it directly
/etc/init.d/oracleasm querydisk -d data
Disk "DATA" is a valid ASM disk on device [8, 33]

# chown oracle:dba /dev/sdc1

ls /dev/sd*
...
brw-r----- 1 root   disk     8, 32 Jun 20 17:16 /dev/sdc
brw-r----- 1 oracle dba      8, 33 Jun 20 17:17 /dev/sdc1
brw-r----- 1 root   disk     8, 48 Jun 20 17:16 /dev/sdd
brw-r----- 1 oracle dba      8, 49 Jun 22 13:39 /dev/sdd1
7. Unmount all the diskgroups in the node and set the asm_diskstring. Trying to set asm_diskstring while one is mounted would result in an error. See earlier post's step 9
SQL> alter diskgroup flash dismount;
Diskgroup altered.

SQL> alter diskgroup data dismount;
Diskgroup altered.

SQL> alter system set asm_diskstring ='/dev/sdc1','/dev/sdd1' scope=memory;
System altered.

SQL> alter diskgroup data mount;
Diskgroup altered.

SQL> alter diskgroup flash mount;
Diskgroup altered.
From ASM alert log
NOTE: cache registered group DATA number=1 incarn=0x7378464e
NOTE: cache began mount (not first) of group DATA number=1 incarn=0x7378464e
NOTE: Assigning number (1,0) to disk (/dev/sdc1)
kfdp_query(DATA): 16
Fri Jun 22 13:41:12 2012
kfdp_queryBg(): 16
NOTE: cache opening disk 0 of grp 1: DATA path:/dev/sdc1
NOTE: F1X0 found on disk 0 fcn 0.0
NOTE: cache mounting (not first) group 1/0x7378464E (DATA)
Fri Jun 22 13:41:12 2012
kjbdomatt send to node 1
...
...
SQL> alter diskgroup flash mount
NOTE: cache registered group FLASH number=2 incarn=0x73784652
NOTE: cache began mount (not first) of group FLASH number=2 incarn=0x73784652
NOTE: Assigning number (2,0) to disk (/dev/sdd1)
kfdp_query(FLASH): 19
kfdp_queryBg(): 19
NOTE: cache opening disk 0 of grp 2: FLASH path:/dev/sdd1
NOTE: F1X0 found on disk 0 fcn 0.0
NOTE: cache mounting (not first) group 2/0x73784652 (FLASH)
kjbdomatt send to node 1
Confirm first node's ASM diskgroups are now using block devices
SQL> select inst_id,name,label,path from gv$asm_disk;

   INST_ID NAME       LABEL      PATH
---------- ---------- ---------- ----------
         2 DATA       DATA       ORCL:DATA
         2 FLASH      FLASH      ORCL:FLASH
         1 DATA                  /dev/sdc1
         1 FLASH                 /dev/sdd1
8. Create udev rules so the block device ownerships are persistent across reboots.
# ASM DATA
KERNEL=="sdc[1]", OWNER="oracle", GROUP="dba", MODE="660"

# ASM FLASH
KERNEL=="sdd[1]", OWNER="oracle", GROUP="dba", MODE="660"
9. Set the new asm_diskstring values to ASM spfile
SQL> alter system set asm_diskstring ='/dev/sdc1','/dev/sdd1' scope=both;
10. Unload the oracleasm module. To unload the oracleasm module the ASM instance must be shutdown.
lsmod  | grep oracleasm
oracleasm              84136  1

# /etc/init.d/oracleasm stop
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [FAILED]

srvctl stop asm -n rac1

# /etc/init.d/oracleasm stop
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

# /etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration: done
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

# chkconfig oracleasm off
11. Start the ASM instance on the node
srvctl start asm -n rac1
Verify the block devices are used by monitoring the ASM alert log
NOTE: cache opening disk 0 of grp 1: DATA path:/dev/sdc1
NOTE: F1X0 found on disk 0 fcn 0.0
NOTE: cache mounting (not first) group 1/0x737E1A2E (DATA)
kjbdomatt send to node 1
NOTE: attached to recovery domain 1
NOTE: LGWR attempting to mount thread 1 for diskgroup 1
NOTE: LGWR mounted thread 1 for disk group 1
NOTE: opening chunk 1 at fcn 0.69396 ABA
NOTE: seq=102 blk=4866
NOTE: cache mounting group 1/0x737E1A2E (DATA) succeeded
NOTE: cache ending mount (success) of group DATA number=1 incarn=0x737e1a2e
kfdp_query(FLASH): 4
kfdp_queryBg(): 4
NOTE: cache opening disk 0 of grp 2: FLASH path:/dev/sdd1
NOTE: F1X0 found on disk 0 fcn 0.0
NOTE: cache mounting (not first) group 2/0x737E1A2F (FLASH)
Start the database instance on the node

12. Next step is to mount the asm diskgroup on the remaining node with the block devices. Stop the database instance running on the node and change the ownership of the block devices. These were identified earlier
# chown oracle:dba /dev/sdc1
# chown oracle:dba /dev/sdd1
13. Since asm_diskstring was set as both no need to make any changes simply dismount and mount one diskgroup to test the configuration
SQL> alter diskgroup flash dismount;

Diskgroup altered.

SQL> alter diskgroup flash mount;

Diskgroup altered.
14. Create a udev rules file in this node as well
# ASM DATA
KERNEL=="sdc[1]", OWNER="oracle", GROUP="dba", MODE="660"

# ASM FLASH
KERNEL=="sdd[1]", OWNER="oracle", GROUP="dba", MODE="660"
15. Stop the asm instance and unload the oracleasm module
srvctl stop asm -n rac2

# /etc/init.d/oracleasm stop
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

# /etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration: done
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

#chkconfig oracleasm off
15. Start asm instance and verify block devices being used through ASM alert log
srvctl start asm -n rac2

NOTE: cache opening disk 0 of grp 1: DATA path:/dev/sdc1
NOTE: F1X0 found on disk 0 fcn 0.0
NOTE: cache mounting (not first) group 1/0x73701F4C (DATA)
kjbdomatt send to node 0
NOTE: attached to recovery domain 1
NOTE: LGWR attempting to mount thread 2 for diskgroup 1
NOTE: LGWR mounted thread 2 for disk group 1
NOTE: opening chunk 2 at fcn 0.69424 ABA
NOTE: seq=86 blk=4843
NOTE: cache mounting group 1/0x73701F4C (DATA) succeeded
NOTE: cache ending mount (success) of group DATA number=1 incarn=0x73701f4c
kfdp_query(FLASH): 4
kfdp_queryBg(): 4
NOTE: cache opening disk 0 of grp 2: FLASH path:/dev/sdd1
NOTE: F1X0 found on disk 0 fcn 0.0
NOTE: cache mounting (not first) group 2/0x73701F4D (FLASH)
Querying the data view
SQL> select inst_id,name,label,path from gv$asm_disk order by 1;

   INST_ID NAME       LABEL      PATH
---------- ---------- ---------- ----------
         1 DATA                  /dev/sdc1
         1 FLASH                 /dev/sdd1
         2 DATA                  /dev/sdc1
         2 FLASH                 /dev/sdd1
16. As the last step uninstall the oracleasm libraries
# rpm -e oracleasmlib-2.0.4-1.el5
# rpm -e oracleasm-2.6.18-308.el5-2.0.5-1.el5
# rpm -e oracleasm-support-2.1.3-1.el5
Related Posts
Migrating block devices using ASM instance to ASMLib
Moving ASMLib disk to block devices (Non-ASMLib) in 11gR2 Standalone

Useful Metalink Notes
How To Migrate ASMLIB Devices To Block Devices (Non-ASMLIB)? [ID 567508.1]

Tuesday, June 19, 2012

Moving ASMLib disk to block devices (Non-ASMLib) in 11gR2 Standalone

This post list steps to move ASMLib devices to block devices for a standalone 11gR2 installation with role separation created earlier.
1. As the grid user login to ASM instance and create a pfile from the ASM spfile
sqlplus  / as sysasm
SQL> create pfile='/home/grid/asmpfile.ora' from spfile;

File created.

$ more asmpfile.ora
+ASM.__oracle_base='/opt/app/oracle'#ORACLE_BASE set from in memory value
+ASM.asm_diskgroups='FLASH','DATA'#Manual Mount
*.asm_power_limit=1
*.diagnostic_dest='/opt/app/oracle'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'
2. Current ASMLib disks are
SQL> select name,label,path from v$asm_disk;

NAME    LABEL   PATH
------- ------- -----------
DATA    DATA    ORCL:DATA
FLASH   FLASH   ORCL:FLASH
3. Before ASMLib disks could be moved the database must be stopped. This is required as ASM diskgroups will be dismounted later on.
srvctl stop database -d stdalone
4. Dismount and mount the flash diskgroup and monitor the ASM alert log which will show the ASM disk(s) used with the diskgroup. This information is useful to verify if the new block device disk assignment is working.
SQL> alter diskgroup flash dismount;

Diskgroup altered.
From the alert log
NOTE: cache deleting context for group FLASH 2/0x9328489f
Thu Jun 14 11:57:49 2012
NOTE: diskgroup resource ora.FLASH.dg is offline
SUCCESS: alter diskgroup flash dismount
NOTE: diskgroup resource ora.FLASH.dg is updated
When mounting
SQL> alter diskgroup flash mount
From alert log
NOTE: cache registered group FLASH number=2 incarn=0xed0848a6
NOTE: cache began mount (first) of group FLASH number=2 incarn=0xed0848a6
NOTE: Assigning number (2,0) to disk (ORCL:FLASH)
Thu Jun 14 11:58:18 2012
NOTE: GMON heartbeating for grp 2
5. Identify the block device used to create the ASMLib disk by querying the ASMLib disk
# /etc/init.d/oracleasm querydisk -d FLASH
Disk "FLASH" is a valid ASM disk on device [8, 33]
Block device could be identified with
ls -l /dev/sd*
brw-r----- 1 root disk 8,  0 Jun 14 11:47 /dev/sda
brw-r----- 1 root disk 8,  1 Jun 14 11:48 /dev/sda1
brw-r----- 1 root disk 8,  2 Jun 14 11:47 /dev/sda2
brw-r----- 1 root disk 8,  3 Jun 14 11:48 /dev/sda3
brw-r----- 1 root disk 8, 16 Jun 14 11:47 /dev/sdb
brw-r----- 1 root disk 8, 17 Jun 14 11:48 /dev/sdb1
brw-r----- 1 root disk 8, 32 Jun 14 11:47 /dev/sdc
brw-r----- 1 root disk 8, 33 Jun 14 11:48 /dev/sdc1
The block device used to create the FLASH ASMLib disk is /dev/sdc1.

6. Set the permission on the block device to grid:asmadmin
# chown grid:asmadmin /dev/sdc1
# ls -l /dev/sdc*
brw-r----- 1 root disk     8, 32 Jun 14 11:47 /dev/sdc
brw-r----- 1 grid asmadmin 8, 33 Jun 14 11:48 /dev/sdc1
7. Dismount the FLASH diskgroup again and set the asm_diskstring to include the block device. Still the DATA diskgroup is using ASMLib therefore ORCL* is also set. This mix setting is alright for testing purposes but it's better not to run production environments in the mix mode (both ASMLib and Block devices).
SQL> alter system set asm_diskstring ='ORCL:DATA','/dev/sdc1' SCOPE=MEMORY;
Mount the FLASH diskgroup and monitor the ASM alert log and verify block device is used
SQL> ALTER DISKGROUP flash mount
On the alert log
NOTE: cache registered group FLASH number=2 incarn=0x3d4848aa
NOTE: cache began mount (first) of group FLASH number=2 incarn=0x3d4848aa
NOTE: Assigning number (2,0) to disk (/dev/sdc1)
Thu Jun 14 12:01:15 2012
NOTE: GMON heartbeating for grp 2
GMON querying group 2 at 18 for pid 19, osid 3268
NOTE: cache opening disk 0 of grp 2: FLASH path:/dev/sdc1
Further verification from the v$asm_disk view
SQL> select name,label,path from v$asm_disk;

NAME    LABEL   PATH
------- ------- -----------
DATA    DATA    ORCL:DATA
FLASH   FLASH   /dev/sdc1
8. Do the same with other diskgroup
# /etc/init.d/oracleasm querydisk -d DATA
Disk "DATA" is a valid ASM disk on device [8, 17]
Set the block device permissions
# chown grid:asmadmin /dev/sdb1
# ls -l /dev/sdb*
brw-r----- 1 root disk     8, 16 Jun 14 11:47 /dev/sdb
brw-r----- 1 grid asmadmin 8, 17 Jun 14 11:48 /dev/sdb1
9. Dismount all diskgroups. Trying to change the asm_diskstring while diskgroups are mounted will throw the following error
SQL> alter system set asm_diskstring ='/dev/sdb1','/dev/sdc1' scope=memory;
alter system set asm_diskstring ='/dev/sdb1','/dev/sdc1' scope=memory
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-15014: path 'ORCL:DATA' is not in the discovery set
Once all diskgroups are dismounted no issue.
SQL> alter diskgroup data dismount;
Diskgroup altered.

SQL> alter diskgroup flash dismount;
Diskgroup altered.

SQL> alter system set asm_diskstring ='/dev/sdb1','/dev/sdc1' scope=both;
Mount each diskgroup and verify the block device is used. Following from the alert log
Thu Jun 14 12:04:51 2012
SQL> alter diskgroup data mount
NOTE: cache registered group DATA number=1 incarn=0xa8c848b4
NOTE: cache began mount (first) of group DATA number=1 incarn=0xa8c848b4
NOTE: Assigning number (1,0) to disk (/dev/sdb1)
Further verification from v$asm_disk
SQL> select name,label,path from v$asm_disk;

NAME    LABEL   PATH
------- ------- -----------
DATA    DATA    /dev/sdb1
FLASH   FLASH   /dev/sdc1
10. Now that it's been verified that block devices are used for ASM create udev rules.
# ASM DATA
KERNEL=="sdb[1]", OWNER="grid", GROUP="asmadmin", MODE="660"

# ASM FLASH
KERNEL=="sdc[1]", OWNER="grid", GROUP="asmadmin", MODE="660"
11. Stop the high availability stack
crsctl stop has
and unload the oracleasm modules
# lsmod  | grep oracleasm
oracleasm              84136  1

# /etc/init.d/oracleasm stop
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

# lsmod  | grep oracleasm
disable loading of oracleasm when server is rebooted
# chkconfig oracleasm off
Restart the high availability service
crsctl start has
CRS-4123: Oracle High Availability Services has been started.
and check all ASM starting with block devices without an issue. When the restart is complete check the ASM alert log
SQL> ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:2} */
NOTE: Diskgroups listed in ASM_DISKGROUPS are
         DATA
         FLASH
NOTE: cache registered group DATA number=1 incarn=0xa71a3a36
NOTE: cache began mount (first) of group DATA number=1 incarn=0xa71a3a36
NOTE: cache registered group FLASH number=2 incarn=0xa71a3a37
NOTE: cache began mount (first) of group FLASH number=2 incarn=0xa71a3a37
Errors in file /opt/app/oracle/diag/asm/+asm/+ASM/trace/+ASM_rbal_4010.trc:
ORA-15183: ASMLIB initialization error [driver/agent not installed]
WARNING: FAILED to load library: /opt/oracle/extapi/64/asm/orcl/1/libasm.so
NOTE: Assigning number (1,0) to disk (/dev/sdb1)
NOTE: Assigning number (2,0) to disk (/dev/sdc1)
and/or using kfod tool to confirm block devices are being used correctly
kfod asm_diskstring='/dev/sd*' disk=all
--------------------------------------------------------------------------------
 Disk          Size Path                                     User     Group
================================================================================
   1:      10236 Mb /dev/sdb1                                grid     asmadmin
   2:      10236 Mb /dev/sdc1                                grid     asmadmin
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME
================================================================================
      +ASM /opt/app/oracle/product/11.2.0/grid
12. If possible restart the server and check all changes (udev rules, disk permissions) and are working without issue and as the final step uninstall the ASMLib
# rpm -e oracleasmlib-2.0.4-1.el5
# rpm -e oracleasm-2.6.18-194.el5-2.0.5-1.el5
# rpm -e oracleasm-support-2.1.3-1.el5
Related Post
Migrating block devices using ASM instance to ASMLib
Moving ASMLib disk to block devices (Non-ASMLib) in 11gR1 RAC

Useful Metalink Notes
How To Migrate ASMLIB Devices To Block Devices (Non-ASMLIB)? [ID 567508.1]

Sunday, December 19, 2010

ASM Disk Creation Fails with EMC PowerPath

Creating an ASM disk with oracleasm createdisk fails with
Marking disk "/dev/emcpowera1" as an ASM disk: asmtool: Device "/dev/emcpowera1" is not a partition [FAILED]
even though multipathing is setup correctly.

According to metalink note 469163.1 ASMLib: oracleasm createdisk command fails: Device '/dev/emcpowera1 is not a partition this is due to the PowerPath version is less than 5.3.0.

In spite this error ASM disks could be created using asmtool by specifying the force option.
# /usr/sbin/asmtool -C -l /dev/oracleasm -n DATA01 -s /dev/emcpowera1 -a force=yes
Once created the disk will be visible through listdisks command and running a scandisks on other nodes in the cluster will make it discoverable on these nodes as well.

Another related metalink note is 566676.1 How To Determinate If An EMCPOWER Partition Is Valid For ASMLIB? which list a different cause for the problem but error message shown is same as above.

Friday, July 16, 2010

ORA-15061: ASM operation not supported

When ASM and RDBMS are in two seperate homes in 11gR1 and 11gR2
SQL> create tablespace test datafile '+DATA(datafile)' size 10m
2 ;
create tablespace test datafile '+DATA(datafile)' size 10m
*
ERROR at line 1:
ORA-19510: failed to set size of 1280 blocks for file
"+DATA/livedb/datafile/test.285.724527409" (block size=8192)
ORA-17505: ksfdrsz:1 Failed to resize file to size 1280 blocks
ORA-15061: ASM operation not supported [41]
could be seen when RDBMS has been applied a PSU while ASM isn't.

To resovle apply the PSU to ASM Home as well.

Above has been observed in 11gR1.

What this means in 11gR2 is that before applying the PSU to RDBMS home have to wait and see if the patch for grid infrastructure is released, since as of 11gR2 grid home is also the ASM home.
metalink note 1070880.1 describes the issue in 11gR2.

Updated information for PSU 11.2.0.1.2 available on metalink note 1089071.1

Friday, July 2, 2010

Migrating block devices using ASM instance to ASMLib

Metalink note 394955.1 describes how to migrate raw devices to ASMLib. Same theory is employed here to migrate block devices to ASM. This blog uses the block devices which were migrated from raw devices.

A block (or raw) device could be migrated to ASMLib and vise versa. But it is easier to migrate a device that was used in the ASMLib to use as a block (or raw) device than other way around. Reason is that when a disk is used to create a ASM instance either with ASMLib or directly using ASM itself, as in the case of block or raw devices, a disk tag or a disk marker "ORCLDISK" is written to the disk header among other things.
When a disk is used with ASMLib then in addition to a disk tag, a disk label is also added. This is missing when a raw or block devices are added to ASM with ASM itself (without the use of ASMLib). Disk label is the text used in the creatdisk command in the oracleasm.
/etc/init.d/oracleasm createdisk VOL1 /dev/sdc10
Creating Oracle ASM disk "DATA" [ OK ]
Here the text DATA is the disk label. This could be seen in v$asm_disk view in a ASM instance.
ASM instance using block devices
NAME       LABEL                PATH
---------- -------------------- ---------
DATA_0000 /dev/sdc8
FLASH_0000 /dev/sdc9
Label is missing.

ASM instance using ASMLib
NAME       LABEL                PATH
---------- -------------------- ------------
DATA01 DATA01 ORCL:DATA01
FLASH01 FLASH01 ORCL:FLASH01
Label is present.

Block or raw devices doesn't have any use for the label so ASMLib disks could be easily migrated to use raw or block devices. But ASMLib does look into the label and if it is not present it will not work.

To migrate block devices to ASMLib all that is required is to label them.

1. Set the new asm_diskstring to ORACL:* in the ASM instance
show parameter asm_diskstring
NAME TYPE VALUE
----------------- ----------- --------------------
asm_diskstring string /dev/sdc8, /dev/sdc9

alter system set asm_diskstring='ORCL:*' scope=spfile;
2.Shutdown the database instances and asm instances. If a disk is renamed while in use it could result in loss of data.

3. Install and configure ASMLib if already not done.

4. use ASMLib renamedisk to add a label to the disks. Tried to rename the disk as per above mentioned metalink note and received following warning.
/etc/init.d/oracleasm renamedisk /dev/sdc8 CLUSDATA
WARNING: Changing the label of an disk marked for ASM is a very dangerous
operation. If this is really what you mean to do, you must
ensure that all Oracle and ASM instances have ceased using
this disk. Otherwise, you may LOSE DATA.
If you really wish to change the label, rerun with the force-renamedisk command.
Renaming disk "/dev/sdc8" to "CLUSDATA": [FAILED]
which shows how serious the consequences are if rename was done while ASM is up.
Ok then try the force-renamedisk
/etc/init.d/oracleasm force-renamedisk /dev/sdc8 CLUSDATA
Renaming disk "/dev/sdc8" to "CLUSDATA": [ OK ]
/etc/init.d/oracleasm force-renamedisk /dev/sdc9 CLUSFLASH
Renaming disk "/dev/sdc9" to "CLUSFLASH": [ OK ]
This time no warning. Scan and list the disks
/etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
/etc/init.d/oracleasm listdisks
CLUSDATA
CLUSFLASH




5. Start the ASM instances. On the ASM alert log verify
cluster_database         = TRUE
instance_number = 1
asm_diskstring = "ORCL:*"
.
.
SQL> ALTER DISKGROUP ALL MOUNT
NOTE: cache registered group DATA number=1 incarn=0xe4da9dba
NOTE: cache began mount (first) of group DATA number=1 incarn=0xe4da9dba
NOTE: cache registered group FLASH number=2 incarn=0xe4da9dbb
NOTE: cache began mount (first) of group FLASH number=2 incarn=0xe4da9dbb
NOTE:Loaded lib: /opt/oracle/extapi/64/asm/orcl/1/libasm.so
NOTE: Assigning number (1,0) to disk (ORCL:CLUSDATA)
NOTE: Assigning number (2,0) to disk (ORCL:CLUSFLASH)
NOTE: start heartbeating (grp 1)
kfdp_query(): 4
kfdp_queryBg(): 4
NOTE: cache opening disk 0 of grp 1: DATA_0000 label:CLUSDATA
NOTE: F1X0 found on disk 0 fcn 0.0
NOTE: cache mounting (first) group 1/0xE4DA9DBA (DATA)
* allocate domain 1, invalid = TRUE
NOTE: attached to recovery domain 1
NOTE: cache recovered group 1 to fcn 0.9731
NOTE: LGWR attempting to mount thread 1 for diskgroup 1
NOTE: LGWR mounted thread 1 for disk group 1
NOTE: opening chunk 1 at fcn 0.9731 ABA
NOTE: seq=17 blk=1358
NOTE: cache mounting group 1/0xE4DA9DBA (DATA) succeeded
NOTE: cache ending mount (success) of group DATA number=1 incarn=0xe4da9dba
NOTE: start heartbeating (grp 2)
kfdp_query(): 6
kfdp_queryBg(): 6
NOTE: cache opening disk 0 of grp 2: FLASH_0000 label:CLUSFLASH
NOTE: F1X0 found on disk 0 fcn 0.0
NOTE: cache mounting (first) group 2/0xE4DA9DBB (FLASH)
* allocate domain 2, invalid = TRUE
NOTE: attached to recovery domain 2
NOTE: cache recovered group 2 to fcn 0.4360
NOTE: LGWR attempting to mount thread 1 for diskgroup 2
NOTE: LGWR mounted thread 1 for disk group 2
NOTE: opening chunk 1 at fcn 0.4360 ABA
NOTE: seq=17 blk=248
NOTE: cache mounting group 2/0xE4DA9DBB (FLASH) succeeded
NOTE: cache ending mount (success) of group FLASH number=2 incarn=0xe4da9dbb
5. Label could be seen in the v$asm_disk view
NAME       LABEL      PATH
---------- ---------- --------------
DATA_0000 CLUSDATA ORCL:CLUSDATA
FLASH_0000 CLUSFLASH ORCL:CLUSFLASH

Related Posts
Migrating OCR to ASM in 11gR2 Clusterware
Migrating Voting Disk to ASM in 11gR2 Clusterware
Moving OCR, Vote and ASM from Raw Devices to Block Devices
Moving ASMLib disk to block devices (Non-ASMLib) in 11gR2 Standalone
Moving ASMLib disk to block devices (Non-ASMLib) in 11gR1 RAC
Moving ASMLib disk to block devices (Non-ASMLib) in 11gR2 RAC

Friday, May 2, 2008

Finding OS Disk path from ASMLib Disk group

Run querydisk command on oracleasm look up major and minor versions from ls -la /dev

or use


export ORACLE_SID=+ASM
export ORAENV_ASK=NO
. oraenv

$ORACLE_HOME/bin/sqlplus -S "/ as sysdba" << EOS 2>&1 |grep [A-Z] > asmdisks.txt
set head off feed off
select a.group_number||' '||b.disk_number||' '||a.name||' '||b.label
from v\$asm_diskgroup a, v\$asm_disk b
where a.group_number = b.group_number;
exit
EOS

printf "%-9s %-30s %-3s %-10s %-3s\n" "ASM Disk" "Device Path [MAJ,MIN]" "GRP" "Disk Group" "DSK"
/etc/init.d/oracleasm querydisk `/etc/init.d/oracleasm listdisks` | cut -f2,10,11 -d" " | perl -pe 's/"(.*)".*\[(.*), *(.*)\]/$1 $2 $3/g;' | while read v_asmdisk v_minor v_major
do
v_device=`ls -la /dev | grep " $v_minor, *$v_major " | awk '{print $10}'`
grp=`grep $v_asmdisk asmdisks.txt|cut -f1 -d" "`
dsk=`grep $v_asmdisk asmdisks.txt|cut -f2 -d" "`
diskgroup=`grep $v_asmdisk asmdisks.txt|cut -f3 -d" "`

printf "%-9s /dev/%-25s %-3s %-10s %-3s\n" $v_asmdisk "$v_device [$v_minor, $v_major]" $grp $diskgroup $dsk
done