Tuesday, 16 January 2018

Configuring ASM for single Instance DB

Automatic Storage Management (ASM)

ASM is advance feature provided by Oracle for management of storage devices and data placed on it form 10g ownwards. ASM combines the storage disks to form a disk groups, used
for storing of Data. It is automatic in the sense that you can add disks and remove disks from Disk group even its online and data is written on it live. Other features are stripping
mirroring of data across different disks. There are other storage management tool as well but Oracle ASM is best of them all is because it provides you with
Oracle Automatic Storage Management Cluster File System (Oracle ACFS).

ASM can be implemented in 2 ways: i.e ASMLib drivers and through Raw Devices

 1) ASM configuration through ASMLib: (Below method is use to configure ASM in all most all environments)

--First of All you'll Install rpm, 3 rpms

1) oracleasm-support-2.1.7-1.el5.i386.rpm
2) oracleasm-2.6.18-92.el5-2.0.4-1.el5.i686.rpm
3) oracleasmlib-2.0.4-1.el5.i386.rpm

-- Partition Harddisk

#fdisks -l


#fdisk /dev/sda

n for new partition
P for primary partition
1 starts
enter
enter
wq to write quite

similarly you'll partition all the disks

--Now configure ASM 

#/etc/init.d/oracleasm configure

than will ask for user : oracle
                       : oinstall
                       : y
                       : y 

-- Naming ASM Disks

/etc/init.d/oracleasm createdisk vol1 /dev/sda1
/etc/init.d/oracleasm createdisk vol2 /dev/sda2
/etc/init.d/oracleasm createdisk vol3 /dev/sda3
/etc/init.d/oracleasm createdisk vol4 /dev/sda4
/etc/init.d/oracleasm createdisk vol4 /dev/sda5

--Listing all the diks created

/etc/init.d/oracleasm listdisks
vol1
vol2
vol3
vol4
vol4

Once the formating is done execute runinstaller


2)  Raw Device Configuration: (These days its not configured but one should have knowledge)

In linux disk are partitioned but not formated for raw formate

# fdisk -l 

/dev/sda1
/dev/sda2
/dev/sda3 etc...

In some release of linux raw devices configuration are depreciated
If you don't have raw devices attached to  than you can check it by command:


(i)  service rawdevices start
     (unrecognised command)
(ii) ll /etc/sysconfig/raw*
      (no such file or directory)
 
  You above commands didn't return any result please follow the below procedure:
 

cd /etc/udev/rules.d
(rules file are executed when machine startups )
these are called udev rules

vi 60-raw.rules
paste :

ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw5 %N"
KERNEL=="raw[1-2]*", OWNER="root", GROUP="oinstall", MODE="640"
KERNEL=="raw[3-5]*", OWNER="oracle", GROUP="oinstall", MODE="644"

if you want that it will be effected immediate use this command :

/bin/raw /dev/raw/raw1 /dev/sdb1
/bin/raw /dev/raw/raw2 /dev/sdc1
/bin/raw /dev/raw/raw3 /dev/sdd1
/bin/raw /dev/raw/raw4 /dev/sde1
/bin/raw /dev/raw/raw5 /dev/sdf1

keep in mind that this is the drawback of rawdevices that after restart these permisstion reset to root but keeping the 2 lines in 60-raw files keep it static.

chown oracle:oinstall /dev/raw/raw*
chmod 640 /dev/raw/*

Now Run the runinstaller  

No comments:

Post a Comment

Installing Oracle 11g on Linux

Unpack Files Unzip the files. # 11.2.0.1 unzip linux.x64_11gR2_database_1of2.zip unzip linux.x64_11gR2_database_2of2.zip #11.2.0.2 u...