You are on page 1of 6

ASM Automatic storage management:

ASM is the new feature is introduced from oracle 10g onwards.

ASM is oracle filesystem and volume manager. it is extentsion of OMF


along with striping and mirroring.

we have different storage options available in the market are

SAN storage area network


NAS network attached storage
DAS direct attached storage

99% of the companies are using SAN storage and SAN storage vendors
are EMC2,HP,DELL,HITACHI etc

we have different types of filesystem.


1. cooked filesystem/os filesystem
2. raw filesystem
3. ASM filesytem.

1. cooked filesystem/os filesystem:

will take the SAN storage and SAN storage admin will do the partitions
and linux admin will format the partitions using formatting software
and linux admin will mount as filesystem. this process of creating
the filesystem is called cooked filesystem or os filesystem.

if will store the CRD file in cooked filesystem/os filesystem and to read
that CRD Files we need to communicate with os,os will communicate with
kernel and kernel will communicate with hardware.

kernel is mediatior between the software and hardware.


this the drawback of the cooked filesystem/os filesystem.
hardparsing -- reading the data from disk -- needs more resources
softparsing -- reading the data from memory -- needs less resources.

2. raw filesystem/block filesystem.

will take the SAN storage and SAN storage admin will do the partitions
and linux admin will do rawdevice mapping and linux admin will mount
as filesystem. this process of creating the filesystem is called raw filesystem or
block filesystem.

rawfilesystem is also called as block filesystem.


there is no formatting software on raw filesystem.
rawfilesystem performance wise good
rawfilesystem backup and recovery is difficult
once will create the raw filesystem cant expand or shrink
we can create upto 256 partitions in a disk
we can store only one file in partition
will configure the raw devices mapping in /etc/sysconfig/rawdevices and
will register the filesystem in /etc/fstab to automatically mounts when
the os boots.
raw filesystem is having own advantages and disadvantages.

3. ASM filesystem:

Before oracle 10g we dont have ASM filesystem we need to depends either
cooked filesystem or raw filesytem. from oracle 10g onwards oracle is
introduced ASM filesystem.
will take the SAN storage and SAN storage admin will do the partitions and
DBA will mark as ASM disks and DBA will mount as ASM diskgroups. this process of
creating the filesystem is ASM filesystem.

will store the CRD in ASM filesystem.

volume manager:

Before oracle 10g we dont have volume management we need to depends thirdparty
volume management like vertitas volume manager,tivoli volume
manager etc but from oracle 10g onwards ASM acts as volume manager.

purpose of volume manager is logically grouping of disks and mount as


filesystem but physically no of disks will be available.

purpose of OMF is oracle automatically manages the filesnames and


filelocations.

similary ASM also maintains the own filesnames and file locations.

ASM is having 3 advantages


1. ASM will maintains own filesname and filelocation
2.mirroring
3. striping

Mirroring:

In ASM we have 3 types of mirroring:


1. normal redundancy
2. high redundancy
3. external redundancy.

Normal redundancy: maintaining 2 failgroups/2 copies of data.

high redundancy : maintianing 3 failgroups/3 copies of data

external redundancy: There is no failgroups we have only actual disks/data


if will mirroring on storage level .i.e RAID concept redundant array of
inexpensive disk RAID 0,RAID1 and RAID 5 then ASM level will go for
external redundancy.

striping:
striping is nothing but scattered the data (distributed the data) across
the disks.

we have 2 types of striping


1. fine striping
2. coarse striping

ASM configuration:

In oracle 10g ASM is included with rdbms software.

oracle 10g software=RDBMS+ASM

from oracle 11gr2 onwards ASM is included with grid software.


oracle grid software=RAC+ASM

software required to configure the 10gASM:


oracle software
ASM related RPMs

software required to configure the 11gASM onwards:


grid software
ASM related RPMS
oracle software

ASM configuration in oracle 12c:

1. install the vmware workstation

2. install the linux on vmware workstation with filesystem /,swap,/u01,/u02,/stage


and /prod
/u01 -- to install the grid software
/u02 -- to install the oracle software

3. install the vmware tools

4. enable the shared drive

5. create the LUN logical unit network for ASM disks using option in
vmware.

6. create the required no of users and groups


useradd oracle
useradd grid
groupadd dba
groupadd oinstall
groupadd oper
groupadd asmdba
groupadd asmoper
groupadd asmadmin
usermod -g oinstall -G asmdba,asmadmin,asmoper grid
usermod -g oinstall -G dba,asmdba oracle

7. create the directory and provide the ownership and permission.


grid_base
mkdir -p /u01/app/oracle
chown -R grid:oinstall /u01/app/oracle
chmod -R 755 /u01/app/oracle
grid_home
mkdir -p /u01/app/oracle/product/12chome
chown -R grid:oinstall /u01/app/oracle/product/12chome
chmod -R 755 /u01/app/oracle/product/12chome
oracle_base
mkdir -p /u02/app/oracle
chown -R oracle:oinstall /u02/app/oracle
chmod -R 755 /u02/app/oracle
oracle_home
mkdir -p /u02/app/oracle/product/12c
chown -R oracle:oinstall /u02/app/oracle/product/12c
chmod -R 755 /u02/app/oracle/product/12c
oraInventory
mkdir -p /u02/app/oraInventory
chown -R grid:oinstall /u02/app/oraInventory
chmod -R 755 /u02/app/oraInventory

8. create the required no of partitions using the fdisk command


fdisk -l
fdisk /dev/sdb
/dev/sdb1
/dev/sdb2
/dev/sdb3
/dev/sdb4

9. we configure the ASM disks in 2 ways.


1. using ASM libriaries
2. using RAWIO
to configure the ASM disks using ASM libraries we need to install
the ASM related RPMS
rpm -Uvh oracleasm* --nodeps --force

10. configure the ASM libraries and create the ASM disks
cd /etc/init.d
./oracleasm configure
grid
oinstall
Y
Y
Y
./oracleasm createdisk DATA1 '/dev/sdb1'
./oracleasm createdisk DATA2 '/dev/sdb2'
./oracleasm createdisk DATA3 '/dev/sdb3'
./oracleasm createdisk DATA4 '/dev/sdb4'
./oracleasm scandisks
./oracleasm listdisks

11. xhost+

12. su - grid
cd /stage/grid
./runinstaller -- to install the grid software
choose grid infrasture for standalone
enter the diskgroup name: DATA
redundancy : normal high external
choose the disks : ORCL:DATA1 ORCL:DATA2 ORCL:DATA3 ORCL:DATA4
choose the grid_base:/u01/app/oracle and grid_home:/u01/app/oracle/
product/12cgrid
select os group: asmdba asmadmin asmoper
it will check prereqs
need to execute runfixup.sh script
need to install the packages.
click on install button.
it will throw orainstroot.sh and root.sh scritps we need to run the
scripts from root user.

after the grid software installation it will starts the OHASD oracle
high availability service daemon,CSSD cluster synchorinazation service
daemon,EVMD event management daemon and it will starts the listener
and it will configureand starts the ASM instance and it will mount
the ASM diskgroups.

13. su - oracle
cd /state/database
./runInstaller -- to install the oracle software
run the root.sh script from root user.

14. create the database either manually or DBCA using ASM diskgroups.

DB creating using ASM diskgroups:

1. create env file -- same


2. directory structure -- same
3. configure pfile
cd $ORACLE_HOME/dbs
vi initabc.ora
control_files=+DATA/abc/control01.ctl,+DATA1/abc/control02.ctl
log_archive_dest=+DATA/abc/arch
:wq!

4. create script file


cd /prod/abc/admin/scripts
vi abc.sql
create database abc archivelog
datafile '+DATA' size 500m
sysaux datafile '+DATA' size 500m
undo tablespace undotbs datafile '+DATA' size 100m
default tablespace userdata datafile '+DATA' size 100m
default temporary tablespace temp tempfile '+DATA' size 100m
default tablespace userdata datafile '+DATA' size 100m
logfile
group 1 '+DATA' size 50m,
group 2 '+DATA' size 50m
character set UTF8;
esc
:wq!

5. Run scripts -- same

how to create the tablespace using ASM diskgroups:

create tablespace hrdata datafile '+DATA' size 100m;

how to add a datafile using ASM diskgroups

alter tablespace hrdata add datafile '+DATA' size 200m;

how to add the redolog group using ASM diskgroups:

alter database add logfile group 3 '+DATA' size 50m;

You might also like