Monday, May 25, 2015

Install Oracle ASM packages and create ASM disk groups.

We will perform the following task for configuring ASM disk group. All task will perform from root user.

1. Install ASM rpm.
2. Configuring and load the ASM kernel module.
3. Creating ASM disk volumes.
4. Creating ASM disks.
5. Test disks discovery.

1. Install ASM rpm.

To configure ASM we have to install the following rpm. You can find this rpm file from OTN

oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.1.8-1.el5.i386.rpm

[root@OEL564ASMN1 ASM]# ls -ltr
total 244
-rwxrwxr-x 1 root root 137486 Apr 11 12:14 oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
-rwxrwxr-x 1 root root  85303 Apr 11 12:16 oracleasm-support-2.1.8-1.el5.i386.rpm
-rwxrwxr-x 1 root root  13929 Apr 11 12:17 oracleasmlib-2.0.4-1.el5.i386.rpm
[root@OEL564ASMN1 ASM]# rpm -Uvh oracleasm-support-2.1.8-1.el5.i386.rpm
warning: oracleasm-support-2.1.8-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [100%]
[root@OEL564ASMN1 ASM]# rpm -Uvh oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
warning: oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-2.6.18-194.el########################################### [100%]
[root@OEL564ASMN1 ASM]# rpm -Uvh oracleasmlib-2.0.4-1.el5.i386.rpm
warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasmlib           ########################################### [100%]

2. Configuring and load the ASM kernel module.

[This script completes the following tasks.
Creates the /etc/sysconfig/oracleasm configuration file
Creates the /dev/oracleasm mount point
Mounts the ASMLib driver file system
]

[root@OEL564ASMN1 ASM]# oracleasm configure -i
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 <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

[This will load oracleasm kernel module ]

[root@OEL564ASMN1 ASM]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm

Mounting ASMlib driver filesystem: /dev/oracleasm

3. Creating ASM disk volumes.

Showing available disk for Oracle ASM Disk Volume.
[root@OEL564ASMN1 ASM]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        3146     4192965   82  Linux swap / Solaris
/dev/sda4            3147        6527    27157882+   5  Extended
/dev/sda5            3147        6527    27157851   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

[ We will use /dev/sdb and /dev/sdc for ASM Disk group ]

[root@OEL564ASMN1 ASM]# 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.


The number of cylinders for this disk is set to 3916.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
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-3916, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-3916, default 3916):
Using default value 3916

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@OEL564ASMN1 ASM]# fdisk /dev/sdc
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.


The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
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.

4. Creating ASM disks.

[root@OEL564ASMN1 ~]# oracleasm createdisk DATAVOL1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@OEL564ASMN1 ~]# oracleasm createdisk FRAVOL1 /dev/sdc1
Writing disk header: done

Instantiating disk: done

5. Test disks discovery. (discovery is being used by the oracle DBCA)

[root@OEL564ASMN1 ~]# oracleasm listdisks
DATAVOL1
FRAVOL1
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm-discover
Using ASMLib from /opt/oracle/extapi/32/asm/orcl/1/libasm.so
[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
Discovered disk: ORCL:DATAVOL1 [62910477 blocks (32210164224 bytes), maxio 512]
Discovered disk: ORCL:FRAVOL1 [20964762 blocks (10733958144 bytes), maxio 512]
[root@OEL564ASMN1 ~]#

No comments:

Post a Comment