How to Create ASM - on -HP-UX

How to Create ASM - on -HP-UX LVM


This is another post, on creating ASM on LVM’s.
Creating ASM on HP-UX LVM is pretty simple.  Following are few steps
STEP 1
======
Create Physical Volumes (PV) and Volume Groups (VG)
[root@/] pvcreate /dev/rdsk/c10t0d2
pvcreate: Could not perform LVM operation on VxVM disk “/dev/rdsk/c10t0d2″.
Well I tried removing it from VxVM control (But old metadata is not erased)
[root@/] vxdisk rm  c10t0d2
So next option, format the disk using dd
[root@/] dd if=/dev/zero of=/dev/rdsk/c10t0d2  bs=8192 count=12800
12800+0 records in
12800+0 records out
Now VxVM metadata gone and pvcreate works as expected
[root@/] pvcreate  /dev/rdsk/c10t0d2
Physical volume “/dev/rdsk/c10t0d2″ has been successfully created.
Create Volume Group on PV
[root@/] vgcreate vgora1 /dev/dsk/c10t0d2
Increased the number of physical extents per physical volume to 1279.
Volume group “/dev/vgora1″ has been successfully created.
Volume Group configuration for /dev/vgora1 has been saved in /etc/lvmconf/vgora1.conf
[root@/] vgdisplay
VG Name                     /dev/vgora1
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      0
Open LV                     0
Max PV                      16
Cur PV                      1
Act PV                      1
Max PE per PV               1279
VGDA                        2
PE Size (Mbytes)            4
Total PE                    1279
Alloc PE                    0
Free PE                     1279
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 81856m
VG Max Extents              20464
STEP 2
======
Create Logical Volume (LV) and set it’s attributes
[root@/] lvcreate -n oradatavol2 vgora1
Logical volume “/dev/vgora1/oradatavol2″ has been successfully created with
character device “/dev/vgora1/roradatavol2″.
Volume Group configuration for /dev/vgora1 has been saved in /etc/lvmconf/vgora1.conf
[root@/] lvchange -C y /dev/vgora1/oradatavol2
Logical volume “/dev/vgora1/oradatavol2″ has been successfully changed.
Volume Group configuration for /dev/vgora1 has been saved in /etc/lvmconf/vgora1.conf
-C contiguous:
Specify the contiguous allocation policy. Physical extents are allocated in ascending order without any gap between adjacent extents and all extents are contained in a single physical volume.  Contiguous can have one of the following values:
y    Set a contiguous allocation policy.
n    Do not set a contiguous allocation policy.
[root@/] lvextend -l 1200 /dev/vgora1/oradatavol2
Logical volume “/dev/vgora1/oradatavol2″ has been successfully extended.
Volume Group configuration for /dev/vgora1 has been saved in /etc/lvmconf/vgora1.conf
-l le_number:
Increase the space, specified in logical extents, allocated to the logical volume or snapshot volume.
[root@/] lvchange -t 60 /dev/vgora1/oradatavol2
Logical volume “/dev/vgora1/oradatavol2″ has been successfully changed.
Volume Group configuration for /dev/vgora1 has been saved in /etc/lvmconf/vgora1.conf
-t IO_timeout:
Set the IO_timeout for the logical volume to the number of seconds indicated. This value will be used to determine how long to wait for IO requests to complete before concluding that an IO request cannot be completed.
[root@/]vgdisplay -v vgora1
— Volume groups —
VG Name                     /dev/vgora1
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      1
Open LV                     1
Max PV                      16
Cur PV                      1
Act PV                      1
Max PE per PV               1279
VGDA                        2
PE Size (Mbytes)            4
Total PE                    1279
Alloc PE                    1200
Free PE                     79
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 81856m
VG Max Extents              20464
   — Logical volumes —
   LV Name                     /dev/vgora1/oradatavol2
   LV Status                   available/syncd
   LV Size (Mbytes)            4800
   Current LE                  1200
   Allocated PE                1200
   Used PV                     1
   — Physical volumes —
   PV Name                     /dev/dsk/c10t0d2
   PV Status                   available
   Total PE                    1279
   Free PE                     79
   Autoswitch                  On
   Proactive Polling           On
STEP 3
======
Change the character device permission
[root@/dev/vgora1]ls -al
total 16
drwxr-xr-x   2 root       sys             96 Oct 23 15:47 .
dr-xr-xr-x  22 bin        bin           8192 Oct 23 15:44 ..
crw-r—–   1 root       sys         64 0×010000 Oct 23 15:44 group
brw-r—–   1 root       sys         64 0×010001 Oct 23 15:47 oradatavol2
crw-r—–   1 root       sys         64 0×010001 Oct 23 15:47 roradatavol2
[root@/dev/vgora1]chown ora11gr1:dba  roradatavol2
[root@/dev/vgora1]ls -al
total 16
drwxr-xr-x   2 root       sys             96 Oct 23 15:47 .
dr-xr-xr-x  22 bin        bin           8192 Oct 23 15:44 ..
crw-r—–   1 root       sys         64 0×010000 Oct 23 15:44 group
brw-r—–   1 root       sys         64 0×010001 Oct 23 15:47 oradatavol2
crw-r—–   1 ora11gr1   dba         64 0×010001 Oct 23 15:47 roradatavol2
STEP 4
======
Change the asm_diskstring  and create required ASM DG’s
SQL> show parameter string
NAME                                 TYPE        VALUE
———————————— ———– ——————————
asm_diskstring                       string      /dev/vgora*/*
SQL> create diskgroup mydg external redundancy disk  ‘/dev/vgora1/roradatavol2′
/
SQL> select name, state,total_mb, free_mb, required_mirror_free_mb, usable_file_mb  from v$asm_diskgroup
/
NAME                           STATE         TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
—————————— ———– ———- ———- ———————– ————–
FRADG                          MOUNTED           4096       2698                       0           2698
MYDG                           MOUNTED           4800       2288                       0           2288
SQL> select name, state, header_status, path,total_mb, free_mb from v$asm_disk
/
NAME                           STATE    HEADER_STATU PATH                                                 TOTAL_MB    FREE_MB
—————————— ——– ———— ————————————————– ———- ———-
FRADG_0000                     NORMAL   MEMBER       /dev/vgora2/roravol2                                     4096       2698
MYDG_0000                      NORMAL   MEMBER       /dev/vgora1/roradatavol2                                 4800       2288
SHARE

sangeethakumar

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment