Configured RAW Devices & ASM

Create RAW devices & configured ASM in ORACLE

Both ASMLib and raw devices require the candidate disks to be partitioned before they can be accessed.

Create the partition with fdisk command

1. Following example shows the “/dev/sdb” disk being partitioned.

-- List the disk present on server
# ls sd*
sda sda1 sda2 sdb sdc sdd

-- Partition the disk with fdisk
# fdisk /dev/sdb

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-4): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
Using default value 1305

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Note: The remaining disks (“/dev/sdc” and “/dev/sdd”) must be partitioned in the same way.

ASMLib Installation

1. Determine your kernel version using the following command as the root user.

# uname -r
2.6.9-34.ELsmp

2. Download the ASMLib software, with correct version.

oracleasm-support-2.0.1-1.i386.rpm
oracleasmlib-2.0.1-1.i386.rpm
oracleasm-2.6.9-34.ELsmp-2.0.1-1.i686.rpm

3. Install the packages as the root user.

# rpm -Uvh oracleasm-support-2.0.1-1.i386.rpm \
oracleasmlib-2.0.1-1.i386.rpm \
oracleasm-2.6.9-34.ELsmp-2.0.1-1.i686.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.9-34.ELsm########################################### [ 67%]
3:oracleasmlib ########################################### [100%]

4. With the software installed, configure the ASM kernel module.

# /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
Fix permissions of Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: [ OK ]
Creating /dev/oracleasm mount point: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]

5. Create ASM Disk with asm libraries.

# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk "/dev/sdb1" as an ASM disk: [ OK ]

# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk: [ OK ]

# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk: [ OK ]

6. In Case of RAC installation, the disks would only be stamped by one node. The other nodes would just scan for the disks.

# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]

7. List the disk with command for verify all the nodes.

# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3

Raw Device Setup

1. Map the raw disk with the disk partition for accessing:

Note: Edit the "/etc/sysconfig/rawdevices" file, adding the following lines.
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1
/dev/raw/raw3 /dev/sdd1

2. Restart the rawdevices service using the following command.

service rawdevices restart

3. Change the owner and permission for raw disks:
Edit the “/etc/rc.local” file and add following lines:

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

 

Advertisements

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s