Wednesday, March 23, 2011

Preparing the Storwize V7000 storage volumes to install Oracle ASM

I wanted to create a single standalone Oracle database on ASM. The storage attached to my AIX host is Storwize V7000.

I had created three volumes on the V7000, and had mounted files systems on them. Now, I want to re-use those volumes on have ASM on them. and re-create the database.

Here is how things looked when I began:


isvp17> lspv
hdisk0          00f65d51a5aa3cf1                    rootvg          active
hdisk1          00f65d51bfba4e2e                    test1           active
hdisk2          00f65d5108ff9043                    test2           active
hdisk3          00f65d5108ffefb6                    test3           active
hdisk4          00f65d51c465f8eb                    metro           active
hdisk5          00f65d51cdf2c48c                    swap            active
hdisk6          00f65d514519e449                    gm_test1        active
hdisk7          00f65d51451a1693                    gm_test2        active
hdisk8          00f65d51451a4067                    gm_test3        active
isvp17>
isvp17> df -m
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4       10240.00   2556.56   76%    52314     9% /
/dev/hd2       16896.00  14396.23   15%    44361     2% /usr
/dev/hd9var     5120.00   4813.32    6%     5785     1% /var
/dev/hd3        3584.00   2527.33   30%     1786     1% /tmp
/dev/hd1       15360.00   1894.61   88%     5963     2% /home
/dev/hd11admin    256.00    255.61    1%        5     1% /admin
/proc                 -         -    -         -     -  /proc
/dev/hd10opt    5120.00   4935.14    4%     7015     1% /opt
/dev/livedump    256.00    255.64    1%        4     1% /var/adm/ras/livedump
/dev/lv00       9440.00   4976.29   48%       83     1% /home/test
vanhalen:/vanhalen/tools    512.00    486.43    5%      541     1% /testlab/tools
nimble:/71aix  30208.00  25331.73   17%     1334     1% /mnt
/dev/lv04       9440.00   4477.18   53%       31     1% /gm_oradata
/dev/lv05       9440.00   8986.10    5%       22     1% /gm_oralog
/dev/lv06       9440.00   9128.91    4%       20     1% /gm_oraarch
isvp17>


I unmounted the file systems /gm_oradata, /gm_oralog. and /gm_oraarch which were using the three V7000 volumes. Next, I tried to run the chdev command to clear the disks.


isvp17> chdev -l hdisk6 -a pv=clear
Method error (/etc/methods/chgdisk):
        0514-062 Cannot perform the requested function because the
                 specified device is busy.
     pv

isvp17> varyoffvg gm_test1
isvp17> varyoffvg gm_test2
isvp17> varyoffvg gm_test3
isvp17> lspv
hdisk0          00f65d51a5aa3cf1                    rootvg          active
hdisk1          00f65d51bfba4e2e                    test1           active
hdisk2          00f65d5108ff9043                    test2           active
hdisk3          00f65d5108ffefb6                    test3           active
hdisk4          00f65d51c465f8eb                    metro           active
hdisk5          00f65d51cdf2c48c                    swap            active
hdisk6          00f65d514519e449                    gm_test1
hdisk7          00f65d51451a1693                    gm_test2
hdisk8          00f65d51451a4067                    gm_test3
isvp17>
isvp17> chdev -l hdisk6 -a pv=clear
hdisk6 changed
isvp17> chdev -l hdisk7 -a pv=clear
hdisk7 changed
isvp17> chdev -l hdisk8 -a pv=clear
hdisk8 changed
isvp17> lspv
hdisk0          00f65d51a5aa3cf1                    rootvg          active
hdisk1          00f65d51bfba4e2e                    test1           active
hdisk2          00f65d5108ff9043                    test2           active
hdisk3          00f65d5108ffefb6                    test3           active
hdisk4          00f65d51c465f8eb                    metro           active
hdisk5          00f65d51cdf2c48c                    swap            active
hdisk6          none                                None
hdisk7          none                                None
hdisk8          none                                None
isvp17>

isvp17> ls -l /dev/rhdisk6
crw-------    1 root     system       18,  6 Mar 21 10:47 /dev/rhdisk6
isvp17> ls -l /dev/rhdisk7
crw-------    1 root     system       18,  8 Mar 21 10:48 /dev/rhdisk7
isvp17> ls -l /dev/rhdisk8
crw-------    1 root     system       18,  7 Mar 21 10:48 /dev/rhdisk8
isvp17>


Changing the ownership of the disk to oracle and group to dba


isvp17> chown oracle:dba /dev/rhdisk6
isvp17> chown oracle:dba /dev/rhdisk7
isvp17> chown oracle:dba /dev/rhdisk8
isvp17> ls -l /dev/rhdisk6
crw-------    1 oracle   dba          18,  6 Mar 21 10:47 /dev/rhdisk6
isvp17> ls -l /dev/rhdisk7
crw-------    1 oracle   dba          18,  8 Mar 21 10:48 /dev/rhdisk7
isvp17> ls -l /dev/rhdisk8
crw-------    1 oracle   dba          18,  7 Mar 21 10:48 /dev/rhdisk8
isvp17>


The volumes/disks are now ready for creation of an ASM diskgroup.

No comments: