Sunday, July 7, 2013

ASM configuration

STEP1
=====
Install RPM's for ASM
oracleasm-support-2.1.3-1.el4.i386.rpm
oracleasm-2.6.9-67.EL-2.0.3-1.i686.rpm
oracleasmlib-2.0.4-1.el4.i386.rpm
oracleasm-2.6.9-67.ELsmp-2.0.3-1.i686.rpm


Step2: Create Partitions
======
[root@linux ~]# fdisk -l

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        2550    20482843+  83  Linux
/dev/hda2            2551        6381    30772507+  83  Linux
/dev/hda3            6382       10212    30772507+  83  Linux
/dev/hda4           10213       19457    74260462+   5  Extended
/dev/hda5           10213       14043    30772476   83  Linux
/dev/hda6           14044       17874    30772476   83  Linux
/dev/hda7           17875       18511     5116671   83  Linux
/dev/hda8           18512       18772     2096451   82  Linux swap
/dev/hda9           18773       19457     5502231    b  W95 FAT32

Disk /dev/sda: 8011 MB, 8011120640 bytes
41 heads, 41 sectors/track, 9307 cylinders
Units = cylinders of 1681 * 512 = 860672 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           5        9308     7819328    b  W95 FAT32
[root@linux ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 9307.
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)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-9307, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-9307, default 9307): +4g

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (4650-9307, default 4650):
Using default value 4650
Last cylinder or +size or +sizeM or +sizeK (4650-9307, default 9307):
Using default value 9307

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

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@linux ~]# fdisk -l

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        2550    20482843+  83  Linux
/dev/hda2            2551        6381    30772507+  83  Linux
/dev/hda3            6382       10212    30772507+  83  Linux
/dev/hda4           10213       19457    74260462+   5  Extended
/dev/hda5           10213       14043    30772476   83  Linux
/dev/hda6           14044       17874    30772476   83  Linux
/dev/hda7           17875       18511     5116671   83  Linux
/dev/hda8           18512       18772     2096451   82  Linux swap
/dev/hda9           18773       19457     5502231    b  W95 FAT32

Disk /dev/sda: 8011 MB, 8011120640 bytes
41 heads, 41 sectors/track, 9307 cylinders
Units = cylinders of 1681 * 512 = 860672 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        4649     3907464   83  Linux
/dev/sda2            4650        9307     3915049   83  Linux



3.### insert these values###
----
[root@linux ~]# cat /etc/sysconfig/rawdevices
# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format:  
#          
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
/dev/raw/raw1   /dev/sda1
/dev/raw/raw2   /dev/sda2


[root@linux ~]# service rawdevices restart
Assigning devices:
           /dev/raw/raw1  -->   /dev/sda1
/dev/raw/raw1:  bound to major 8, minor 1
           /dev/raw/raw2  -->   /dev/sda2
/dev/raw/raw2:  bound to major 8, minor 2
done


REBOOT ----> Server( If any Issues)



4.STEP4: Change Permissions
======
[root@linux ~]# ls -ltr /dev/raw/raw*
crw-rw----  1 root disk 162, 1 Aug 17 18:31 /dev/raw/raw1
crw-rw----  1 root disk 162, 2 Aug 17 18:31 /dev/raw/raw2

[root@linux ~]# chown -R oracle:dba /dev/raw/raw*
[root@linux ~]# ls -ltr /dev/raw/raw*
crw-rw----  1 oracle dba 162, 1 Aug 17 18:31 /dev/raw/raw1
crw-rw----  1 oracle dba 162, 2 Aug 17 18:31 /dev/raw/raw2
[root@linux ~]# ls -ltr /dev/raw/raw*
crw-rw----  1 oracle dba 162, 1 Aug 17 18:31 /dev/raw/raw1
crw-rw----  1 oracle dba 162, 2 Aug 17 18:31 /dev/raw/raw2




STEP5: ASM Configure
=====
[root@linux tmp]#  /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 []: dba
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
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]


STEP6  (Start/Stop)
======

[root@linux tmp]# /etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration: done
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]
[root@linux tmp]#

[root@linux tmp]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]
[root@linux tmp]#


Step7
=====
[root@linux tmp]# ps -ef | grep css
root     10232  6577  0 19:44 pts/1    00:00:00 grep css

Oracle 10g:
===========
[root@linux bin]# pwd
/u02/app/oraasm/product/10.1.0/bin

[root@linux bin]# ./localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized

Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
        linux
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)





---Create ASM instance& DiskGroups through DBCA
--- Create Database though DBCA& assign ASM Diskgroups.




Manually creation of disk groups :
=========================
SQL> CREATE DISKGROUP DG1 External REDUNDANCY  DISK '/dev/raw/raw1' SIZE 1000M , '/dev/raw/raw2' SIZE 1000M;
SQL> CREATE DISKGROUP DG2 External REDUNDANCY  DISK '/dev/raw/raw3' SIZE  1000M;
Add disk to existing diskgroup :
SQL> ALTER DISKGROUP DG2 ADD  DISK '/dev/raw/raw4' SIZE 1000M;

No comments:

Post a Comment