ASM using ASMLib and Raw Devices
Both
ASMLib and raw devices require the candidate disks to be partitioned before
they can be accessed. Here, three 10g VMware virtual disks are to be used for
the ASM storageThe following text shows the "/dev/sdb" disk being
partitioned.
(I have
added 3 disks of size 3G each and all on different SCSI disk controller. We
usually do this to get most out of the ASM disk mirroring i.e. even if one disk
is dead, Oracle will still be able to read data from mirrored copies from other
disks. But think about all of your disks are on one disk controller and that
whole controller is burnt, then you loose all of your data.)
[root@localhost ~]# ls /dev/sd*
/dev/sda /dev/sda2
/dev/sda4 /dev/sdb
/dev/sda1 /dev/sda3
/dev/sda5 /dev/sdc /dev/sdd
[root@localhost ~]# cat /proc/partitions
major minor #blocks
name
8
0 36700160 sda
8
1 48163 sda1
8
2 4088542 sda2
8
3 30515467 sda3
8
4 1 sda4
8
5 2040223 sda5
8
16 3145728 sdb
8
32 3145728 sdc
8
48 3145728 sdd
Create one partition in all disks
[root@localhost ~]#fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun,
SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected
by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-3): 1
First cylinder (1-391, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-391, default 391):
Using default value 391
[root@localhost ~]#fdisk /dev/sdc
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-3): 1
First cylinder (1-391, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-391, default 391):
Using default value 391
Command (m for help): w
The partition table has been altered!
[root@localhost ~]#fdisk /dev/sdd
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-3): 1
First cylinder (1-391, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-391, default 391):
Using default value 391
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Verify that you have one partition for every disk.
[root@localhost ~]# cat /proc/partitions
major minor #blocks name
8 0 36700160 sda
8 1 48163 sda1
8 2 4088542 sda2
8 3 30515467 sda3
8 4 1 sda4
8 5 2040223 sda5
8 16 3145728 sdb
8 32 3145728 sdc
8 48 3145728 sdd
Oracle provides ASM libraries to
stamp the disks as ASM disks. These libraries are distributed on the Linux kernel
basis. You need to know which kernel version you are using then get the
libraries from the OTN
website to download libs for your kernel.
Check using the following commands
For checking kernel version:
[root@localhost ~]# uname -r
2.6.9-67.EL
For checking processor type:
[root@localhost ~]# uname -p
i686
For checking hardware platform:
[root@localhost ~]# uname -i
i386
According to the above information I
need following RPMs:
oracleasm-suppurt-2.1.7.el4.i386.rpm
oracleasmlib-2.0.4-1.el4.i386.rpm
oracleasm-2.4.9-67.EL.2.0.3-1.i686.rpm
Installation the rpms as below-
[root@localhost ~]# rpm –Uvh oracleasm-suppurt-2.1.7.el4.i386.rpm \
oracleasmlib-2.0.4-1.el4.i386.rpm \
oracleasm-2.4.9-67.EL.2.0.3-1.i686.rpm
With the oracleasm utility
installed, configure the kernel module for ASM
[root@localhost ~]# /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 []: oinstall
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 ]
After the kernel module is updated, label the disks as ASM disks and give then an ASM name.
[root@localhost ~]# /etc/init.d/oracleasm createdisk ASM1 /dev/sdb1
Marking disk "ASM1" as an ASM disk: [ OK ]
[root@localhost ~]# /etc/init.d/oracleasm createdisk ASM2 /dev/sdc1
Marking disk "ASM2" as an ASM disk: [ OK ]
[root@localhost ~]# /etc/init.d/oracleasm createdisk ASM3 /dev/sdd1
Marking disk "ASM3" as an ASM disk: [ OK ]
Issue a scandisks on all ASM disks.
[root@localhost ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
listsdisks will list all ASM disks. Make sure you see all the disks you configured.
[root@localhost ~]# /etc/init.d/oracleasm listdisks
ASM1
ASM2
ASM3
#
Configure
RAW disks to use as ASM disks:
Open
/etc/sysconfig/rawdevices and add following lines:
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1
/dev/raw/raw3 /dev/sdd1
Restart
the rwdevices service to make your changes effective
Assigning
devices:
/dev/raw/raw1 -->
/dev/sdb1
/dev/raw/raw2: bound to major 8, minor 17
/dev/raw/raw2 -->
/dev/sdc1
/dev/raw/raw2: bound to major 8, minor 33
/dev/raw/raw3 -->
/dev/sdd1
/dev/raw/raw3: bound to major 8, minor 49
done
This
will bound the disks with raw devices.
Execute
the following commands to set access and ownership on the raw disks for user
oracle.
Also add these lines in /etc/rc.local to preserve these settings after system restart.
Also add these lines in /etc/rc.local to preserve these settings after system restart.
chown
oracle:oinstall /dev/raw/raw1
chown
oracle:oinstall /dev/raw/raw2
chown
oracle:oinstall /dev/raw/raw3
chmod
600 /dev/raw/raw1
chmod
600 /dev/raw/raw2
chmod
600 /dev/raw/raw3
The ASM
raw device disks are now configured.
To be continued in next post
To be continued in next post
No comments:
Post a Comment