Oracle MVA

Tales from a Jack of all trades

Creating a failover disk using ascrs

leave a comment »

I certainly hope that installing CRS is no magic anymore for most DBA’s. If it is, please refer to Tim Hall’s website and follow the guide. Certain things in the CRS installation are less documented though:

  1. X-forwarding has been a nuisance for a lot of DBA’s. Refer to this post for some more information about x-forwarding.
  2. I notice that most guides on VMWare ask you to reboot after adding disks. Refer to this post to see how to scan your bus without rebooting.
  3. Shared disks and VMWare Workstation are a pain in the behind.  Obviously someone else felt the same pain too.

I installed CRS on my laptop running VMWare Workstation. The machines are called wls1 and wls2 (guess what this will be in when I’m done 😉 ) After installing CRS, I installed ascrs. ascrs is delivered through the Companion CD of Oracle Fusion Middleware 11g. It installs by just unzipping the ascrs.zip file in your CRS-tree. Next simply call the configure script in the $CRS_HOME/ascrs/bin directory. When you want to use ascrs on all nodes of the cluster, you need to unzip the file on all nodes.

Next I add the disk to my vmware configuration. This works exactly like adding a ASM disk or OCR disk, simple follow the instructions mentioned here. When you have added the disk, add a partition:

[root@wls1 ~]# mkfs.ext3  /dev/sde1

Please keep in mind that you need to rescan your scsi bus after adding the partition on the device.

When the device is know on all nodes of the cluster, create mountpoint for the disk on all nodes:

[root@wls1 ~]# mkdir /u01/app/oracle/mwhome
[root@wls1 ~]# chown oracle:oinstall !$
[root@wls2 ~]# mkdir /u01/app/oracle/mwhome
[root@wls2 ~]# chown oracle:oinstall !$

The ascrsctl utility enables you to add the disk to the cluster configuration like this:

[oracle@wls1 ~]$ ascrsctl create -n wlshome -t disk -path /u01/app/oracle/mwhome -mc “/bin/mount /dev/sde1 /u01/app/oracle/mwhome” -umc “/bin/umount /dev/sde1”

Please run the following as root to complete this operation.
/u01/app/oracle/product/11.1.0/crs/crs/public/ora.wlshome.cfcdisk.cre.root

[oracle@wls1 ~]$ su –
Password:
[root@wls1 ~]# /u01/app/oracle/product/11.1.0/crs/crs/public/ora.wlshome.cfcdisk.cre.root
Command setperm root executed successfully
Command setperm user executed successfully
[root@wls1 ~]#

Check the status of the disk:

[oracle@wls1 ~]$ ascrsctl status
Name                                     Target     State
————————————————————————
ora.wls1.gsd                             ONLINE     ONLINE on wls1
ora.wls1.ons                             ONLINE     ONLINE on wls1
ora.wls1.vip                             ONLINE     ONLINE on wls1
ora.wls2.gsd                             ONLINE     ONLINE on wls2
ora.wls2.ons                             ONLINE     ONLINE on wls2
ora.wls2.vip                             ONLINE     ONLINE on wls2
ora.wlshome.cfcdisk                      OFFLINE    OFFLINE

Start the disk:

[oracle@wls1 ~]$ ascrsctl start -n ora.wlshome.cfcdisk
Start of resource ora.wlshome.cfcdisk on node wls1 completed successfully.

[oracle@wls1 ~]$  ascrsctl status
Name                                     Target     State
————————————————————————
ora.wls1.gsd                             ONLINE     ONLINE on wls1
ora.wls1.ons                             ONLINE     ONLINE on wls1
ora.wls1.vip                             ONLINE     ONLINE on wls1
ora.wls2.gsd                             ONLINE     ONLINE on wls2
ora.wls2.ons                             ONLINE     ONLINE on wls2
ora.wls2.vip                             ONLINE     ONLINE on wls2
ora.wlshome.cfcdisk                      ONLINE     ONLINE on wls1

Check if it is really there:

[oracle@wls1 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             5.9G  1.5G  4.1G  27% /
tmpfs                 506M     0  506M   0% /dev/shm
/dev/sdb1              20G  1.9G   17G  10% /u01/app/oracle
/dev/sde1             9.9G  151M  9.2G   2% /u01/app/oracle/mwhome

[oracle@wls2 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             5.9G  1.8G  3.8G  33% /
tmpfs                 506M     0  506M   0% /dev/shm
/dev/sdb1              20G  1.2G   18G   6% /u01/app/oracle

Now switch over the disk to the other node:

[oracle@wls2 ~]$ ascrsctl switch -name ora.wlshome.cfcdisk -node wls2
Are you sure you want to switchover ora.wlshome.cfcdisk (y/n) ?y
Switchover of ora.wlshome.cfcdisk completed successfully.

[oracle@wls2 ~]$ ascrsctl status
Name                                     Target     State
————————————————————————
ora.wls1.gsd                             ONLINE     ONLINE on wls1
ora.wls1.ons                             ONLINE     ONLINE on wls1
ora.wls1.vip                             ONLINE     ONLINE on wls1
ora.wls2.gsd                             ONLINE     ONLINE on wls2
ora.wls2.ons                             ONLINE     ONLINE on wls2
ora.wls2.vip                             ONLINE     ONLINE on wls2
ora.wlshome.cfcdisk                      ONLINE     ONLINE on wls2

And check if it is really there:

[oracle@wls1 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             5.9G  1.5G  4.1G  27% /
tmpfs                 506M     0  506M   0% /dev/shm
/dev/sdb1              20G  1.9G   17G  10% /u01/app/oracle

[oracle@wls2 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             5.9G  1.8G  3.8G  33% /
tmpfs                 506M     0  506M   0% /dev/shm
/dev/sdb1              20G  1.2G   18G   6% /u01/app/oracle
/dev/sde1             9.9G  151M  9.2G   2% /u01/app/oracle/mwhome

For more information, see the Oracle Fusion Middleware High Availlabillity Guide.

Hope this helps….

Advertisements

Written by Jacco H. Landlust

August 18, 2009 at 3:36 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: