ASM (AUTOMATIC STORAGE MANAGEMENT)

ASM provides flexible boundaries of PARTITIONS where you can increase and decrease the DISK QUOTA size accordingly. If Data file and Backup File is in same location or in same disk then performance get decrease. Single Point of Failure may occurs since the data file and backup file is in same location therefore if the disk becomes failure then both of it will get failed. In order to get ride of such failure, ASM were introduce from Oracle 10G. ASM makes a disk group functions.

 

In summary ASM provides the following functionality:

- ASM helps to managed groups of disk which is known as  disk groups.

- ASM helps for disk redundancy within a disk group.

- ASM automatic near-optimal I/O balancing without any manual performance.

- ASM automatically enables management of database objects without specifying mount points and file names.

- ASM support the large volume files.

 

Administering ASM Disk Groups

Before you plan to use ASM, there are certain few points you should plan while using ASM

- Generally only two DISK GROUS (DATA and FRA) is created where DATA holds all the database related files   and the FLASH RECOVERY AREA (FRA)  holds a variety of backup and recovery-related files on your behalf.You must also determine a disk quota for the flash recovery area, the maximum space to be used for all files stored there. You must choose a location large enough to accomodate the required disk quota. When the disk space limit is approached, Oracle can delete nonessential files to make room for new files, subject to the limitations of the retention policy.

 

Flash Recovery Area (FRA) holds the following files:

- A copy of all datafiles

- Incremental backups, as used by your chosen backup strategy

- Online redo logs

- Archived redo logs not yet backed up to tape

- Control files

 

 

Now lets Create Partition from Fdisk, In my case I have created total 6 Partitions (10GB each)  where I am planning allocate 3 Partitions for DATA and 3 Partition for FRA. Below is the steps that we can follow with.

 

[root@storage Desktop]# fdisk /dev/sda

 

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

         switch off the mode (command 'c') and change display units to

         sectors (command 'u').

 

Command (m for help): p

 

Disk /dev/sda: 536.9 GB, 536870912000 bytes

255 heads, 63 sectors/track, 65270 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000a968c

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64       13119   104857600   83  Linux

/dev/sda3           13119       26173   104857600   83  Linux

/dev/sda4           26173       65271   314059776    5  Extended

/dev/sda5           26173       39227   104857600   83  Linux

/dev/sda6           39227       44449    41943040   83  Linux

/dev/sda7           44449       46407    15728640   83  Linux

/dev/sda8           46407       48365    15728640   83  Linux

/dev/sda9           48366       49671    10485760   83  Linux

/dev/sda10          49671       50715     8388608   82  Linux swap / Solaris

/dev/sda11          50716       51760     8388608   83  Linux

 

Command (m for help): n

First cylinder (48365-65271, default 48365): 51761

Last cylinder, +cylinders or +size{K,M,G} (51761-65271, default 65271): +10G

 

Command (m for help): p

 

Disk /dev/sda: 536.9 GB, 536870912000 bytes

255 heads, 63 sectors/track, 65270 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000a968c

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64       13119   104857600   83  Linux

/dev/sda3           13119       26173   104857600   83  Linux

/dev/sda4           26173       65271   314059776    5  Extended

/dev/sda5           26173       39227   104857600   83  Linux

/dev/sda6           39227       44449    41943040   83  Linux

/dev/sda7           44449       46407    15728640   83  Linux

/dev/sda8           46407       48365    15728640   83  Linux

/dev/sda9           48366       49671    10485760   83  Linux

/dev/sda10          49671       50715     8388608   82  Linux swap / Solaris

/dev/sda11          50716       51760     8388608   83  Linux

/dev/sda12          51761       53066    10490445   83  Linux

 

Command (m for help): n

First cylinder (48365-65271, default 48365): 53067

Last cylinder, +cylinders or +size{K,M,G} (53067-65271, default 65271): +10G

 

Command (m for help): p

 

Disk /dev/sda: 536.9 GB, 536870912000 bytes

255 heads, 63 sectors/track, 65270 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000a968c

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64       13119   104857600   83  Linux

/dev/sda3           13119       26173   104857600   83  Linux

/dev/sda4           26173       65271   314059776    5  Extended

/dev/sda5           26173       39227   104857600   83  Linux

/dev/sda6           39227       44449    41943040   83  Linux

/dev/sda7           44449       46407    15728640   83  Linux

/dev/sda8           46407       48365    15728640   83  Linux

/dev/sda9           48366       49671    10485760   83  Linux

/dev/sda10          49671       50715     8388608   82  Linux swap / Solaris

/dev/sda11          50716       51760     8388608   83  Linux

/dev/sda12          51761       53066    10490445   83  Linux

/dev/sda13          53067       54372    10490413+  83  Linux

 

Command (m for help): n

First cylinder (48365-65271, default 48365): 54373

Last cylinder, +cylinders or +size{K,M,G} (54373-65271, default 65271): +10G

 

Command (m for help): p

 

Disk /dev/sda: 536.9 GB, 536870912000 bytes

255 heads, 63 sectors/track, 65270 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000a968c

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64       13119   104857600   83  Linux

/dev/sda3           13119       26173   104857600   83  Linux

/dev/sda4           26173       65271   314059776    5  Extended

/dev/sda5           26173       39227   104857600   83  Linux

/dev/sda6           39227       44449    41943040   83  Linux

/dev/sda7           44449       46407    15728640   83  Linux

/dev/sda8           46407       48365    15728640   83  Linux

/dev/sda9           48366       49671    10485760   83  Linux

/dev/sda10          49671       50715     8388608   82  Linux swap / Solaris

/dev/sda11          50716       51760     8388608   83  Linux

/dev/sda12          51761       53066    10490445   83  Linux

/dev/sda13          53067       54372    10490413+  83  Linux

/dev/sda14          54373       55678    10490413+  83  Linux

 

Command (m for help): n

First cylinder (48365-65271, default 48365): 55679

Last cylinder, +cylinders or +size{K,M,G} (55679-65271, default 65271): +10G

 

Command (m for help): p

 

Disk /dev/sda: 536.9 GB, 536870912000 bytes

255 heads, 63 sectors/track, 65270 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000a968c

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64       13119   104857600   83  Linux

/dev/sda3           13119       26173   104857600   83  Linux

/dev/sda4           26173       65271   314059776    5  Extended

/dev/sda5           26173       39227   104857600   83  Linux

/dev/sda6           39227       44449    41943040   83  Linux

/dev/sda7           44449       46407    15728640   83  Linux

/dev/sda8           46407       48365    15728640   83  Linux

/dev/sda9           48366       49671    10485760   83  Linux

/dev/sda10          49671       50715     8388608   82  Linux swap / Solaris

/dev/sda11          50716       51760     8388608   83  Linux

/dev/sda12          51761       53066    10490445   83  Linux

/dev/sda13          53067       54372    10490413+  83  Linux

/dev/sda14          54373       55678    10490413+  83  Linux

/dev/sda15          55679       56984    10490413+  83  Linux

 

Command (m for help): n

First cylinder (48365-65271, default 48365): 56985

Last cylinder, +cylinders or +size{K,M,G} (56985-65271, default 65271): +10G

 

Command (m for help): p

 

Disk /dev/sda: 536.9 GB, 536870912000 bytes

255 heads, 63 sectors/track, 65270 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000a968c

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64       13119   104857600   83  Linux

/dev/sda3           13119       26173   104857600   83  Linux

/dev/sda4           26173       65271   314059776    5  Extended

/dev/sda5           26173       39227   104857600   83  Linux

/dev/sda6           39227       44449    41943040   83  Linux

/dev/sda7           44449       46407    15728640   83  Linux

/dev/sda8           46407       48365    15728640   83  Linux

/dev/sda9           48366       49671    10485760   83  Linux

/dev/sda10          49671       50715     8388608   82  Linux swap / Solaris

/dev/sda11          50716       51760     8388608   83  Linux

/dev/sda12          51761       53066    10490445   83  Linux

/dev/sda13          53067       54372    10490413+  83  Linux

/dev/sda14          54373       55678    10490413+  83  Linux

/dev/sda15          55679       56984    10490413+  83  Linux

/dev/sda16          56985       58290    10490413+  83  Linux

 

Command (m for help): n

First cylinder (48365-65271, default 48365): 58291

Last cylinder, +cylinders or +size{K,M,G} (58291-65271, default 65271): +10G

 

Command (m for help): w

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 or after you run partprobe(8) or kpartx(8)

Syncing disks.

[root@storage Desktop]#

 

Finally you can see that 6 PARTITIONS has been created. The below RED BORDER Circle contains those 6 CREATED PARTITIONS informations.

six_partitioin.JPG

Installing ASMLib

ASMLib Installation is required if you are planning to configure and access ASM DISKS then Also Make sure to check your kernel version using the following command as the root user.


[root@storage ~]# uname -r

3.8.13-118.2.2.el6uek.x86_64

[root@storage ~]#

 

For ASMLib Installation following packages were required. I have ORACLE ENTERPRISE LINUX 6.5 therefore I will be downloading following package

 

    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

 

NOTE : I have downloaded ASMLib  software from the following url :

- oracleasm-support-2.0.1-1.i386.rpm ( already available inside PACKAGES folder)

- oracleasmlib-2.0.1-1.i386.rpm ( If you don't have then you can download from here wget http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el6.x86_64.rpm)

- oracleasm-2.6.9-34.ELsmp-2.0.1-1.i686.rpm ( If not availabe then you can get it from here wget http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel4/amd64/2.0.3/2.6.9-34.EL/oracleasm-2.6.9-34.ELsmp-2.0.3-1.x86_64.rpm)

 

[root@storage Packages]# cd /stage/Disk1/Packages

[root@storage Packages]# rpm -Uvh oracleasm-support-2.1.8-1.el6.x86_64.rpm oracleasmlib-2.0.12-1.el6.x86_64.rpm oracleasmlib-2.0.12-1.el6.x86_64.rpm

warning: package oracleasmlib = 2.0.12-1.el6 was already added, skipping oracleasmlib = 2.0.12-1.el6

Preparing...                ########################################### [100%]

   1:oracleasmlib           ########################################### [ 50%]

   2:oracleasm-support      ########################################### [100%]

[root@storage Packages]#

three_asm_rpm.JPG

 

3. After above three RPM is installed, Configure ASM KERNEL MODULE now

 

Configuring ASMLib

Since ASMLib software is already installed, following steps need to be implemented by the system administrator to make the ASM driver available. The ASM driver needs to be loaded, and the driver filesystem needs to be mounted. This is taken care of by the initialization script, /etc/init.d/oracleasm.

 

You need to run the /etc/init.d/oracleasm script with the 'configure' option. It will ask for the user and group that default to owning the ASM driver access point. If the database was running as the 'oracle' user and the 'dba' group, the output would look like this:

 

[root@storage Packages]# /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 <ENTER> 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

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  ]

[root@storage Packages]#

 

orclasm_configure.JPG

4. After KERNEL MODULE is loaded, Apply the earlier 6 Disk Created for ASM DISK

[root@storage Packages]# /etc/init.d/oracleasm createdisk VOL1 /dev/sda12

Marking disk "VOL1" as an ASM disk:                        [  OK  ]

[root@storage Packages]# /etc/init.d/oracleasm createdisk VOL2 /dev/sda13

Marking disk "VOL2" as an ASM disk:                        [  OK  ]

[root@storage Packages]# /etc/init.d/oracleasm createdisk VOL3 /dev/sda14

Marking disk "VOL3" as an ASM disk:                        [  OK  ]

[root@storage Packages]# /etc/init.d/oracleasm createdisk VOL4 /dev/sda15

Marking disk "VOL4" as an ASM disk:                        [  OK  ]

[root@storage Packages]# /etc/init.d/oracleasm createdisk VOL5 /dev/sda16

Marking disk "VOL5" as an ASM disk:                        [  OK  ]

[root@storage Packages]# /etc/init.d/oracleasm createdisk VOL6 /dev/sda17

Marking disk "VOL6" as an ASM disk:                        [  OK  ]

[root@storage Packages]#

create_disk.JPG

5.  Scan for the DISK

[root@storage Packages]# /etc/init.d/oracleasm scandisks

Scanning the system for Oracle ASMLib disks:               [  OK  ]

[root@storage Packages]#

scan_disk.JPG

 

6. List all the stamped disk

[root@storage Packages]# /etc/init.d/oracleasm listdisks

VOL1

VOL2

VOL3

VOL4

VOL5

VOL6

[root@storage Packages]#

listdisk.JPG

 

ASM DISK IS NOW READY TO USE