Configure logical partitions for oracle asm

Use fdisk to list the physical disks available to create logical sectors on the device.Here we have external disks added with persistent storage.

[root@RACFLEX1 oracle]# fdisk -l

Disk /dev/sda: 5472 MB, 5472104448 bytes
255 heads, 63 sectors/track, 665 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: 0x1195760c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         665     5341581   83  Linux

Disk /dev/sdc: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 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: 0x4699c8c4

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         261     2096451   83  Linux

Disk /dev/sdb: 5472 MB, 5472104448 bytes
255 heads, 63 sectors/track, 665 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: 0x96f39711

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         665     5341581   83  Linux

Disk /dev/sdd: 5472 MB, 5472104448 bytes
255 heads, 63 sectors/track, 665 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: 0x00000000


Disk /dev/sde: 5472 MB, 5472104448 bytes
255 heads, 63 sectors/track, 665 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: 0x00000000


Disk /dev/sdg: 55.1 GB, 55053647872 bytes
255 heads, 63 sectors/track, 6693 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: 0x00031e11

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1   *           1        2550    20480000   83  Linux
/dev/sdg2            2550        4463    15360000   83  Linux
/dev/sdg3            4463        4724     2097152   82  Linux swap / Solaris
/dev/sdg4            4724        6694    15824896    5  Extended
/dev/sdg5            4724        6694    15823872   83  Linux

Disk /dev/sdf: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 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: 0x00000000

We add primary partitions for all the devices /dev/sda , /dev/sdb, /dev/sdc, /dev/sdd

[root@RACFLEX1 oracle]# fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x0b5c3711.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-665, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-665, default 665):
Using default value 665

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@RACFLEX1 oracle]# fdisk /dev/sde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xc148f4a1.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-665, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-665, default 665):
Using default value 665

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@RACFLEX1 oracle]# fdisk /dev/sdg

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): n
No free sectors available

Command (m for help): ^Z
[1]+  Stopped                 fdisk /dev/sdg
[root@RACFLEX1 oracle]# ^C
[root@RACFLEX1 oracle]# fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xa10fefb6.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261):
Using default value 261

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

Calling ioctl() to re-read partition table.
Syncing disks.

Download oracleasmlib and oracleasmsupport rpms using yum or download from support website to use oracleasm utility !

[root@RACFLEX1 oracle]# yum install oracleasm-support
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracleasm-support.x86_64 0:2.1.11-2.el6 will be installed
--> Finished Dependency Resolution
[root@RACFLEX1 oracle]# yum install kmod-oracleasm -y
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kmod-oracleasm.x86_64 0:2.0.8-16.1.el6_10 will be installed
--> Processing Dependency: kernel(__x86_indirect_thunk_rax) = 0x2ea2c95c for package: kmod-oracleasm-2.0.8-16.1.el6_10.x86_64
--> Processing Dependency: kernel >= 2.6.32-754.el6 for package: kmod-oracleasm-2.0.8-16.1.el6_10.x86_64
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-754.35.1.el6 will be installed
--> Processing Dependency: dracut-kernel >= 004-408.el6 for package: kernel-2.6.32-754.35.1.el6.x86_64
--> Running transaction check
---> Package dracut-kernel.noarch 0:004-388.0.1.el6 will be updated
---> Package dracut-kernel.noarch 0:004-411.0.9.el6 will be an update
--> Processing Dependency: dracut = 004-411.0.9.el6 for package: dracut-kernel-004-411.0.9.el6.noarch
--> Running transaction check
---> Package dracut.noarch 0:004-388.0.1.el6 will be updated
---> Package dracut.noarch 0:004-411.0.9.el6 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch      Version                 Repository            Size
================================================================================
Installing:
 kmod-oracleasm    x86_64    2.0.8-16.1.el6_10       public_ol6_latest     36 k
Installing for dependencies:
 kernel            x86_64    2.6.32-754.35.1.el6     public_ol6_latest     32 M
Updating for dependencies:
 dracut            noarch    004-411.0.9.el6         public_ol6_latest    130 k
 dracut-kernel     noarch    004-411.0.9.el6         public_ol6_latest     29 k

Transaction Summary
================================================================================
Install       2 Package(s)
Upgrade       2 Package(s)

Total download size: 33 M
Downloading Packages:
(1/4): dracut-004-411.0.9.el6.noarch.rpm                 | 130 kB     00:00
(2/4): dracut-kernel-004-411.0.9.el6.noarch.rpm          |  29 kB     00:00
(3/4): kernel-2.6.32-754.35.1.el6.x86_64.rpm             |  32 MB     00:50
(4/4): kmod-oracleasm-2.0.8-16.1.el6_10.x86_64.rpm       |  36 kB     00:00
--------------------------------------------------------------------------------
Total                                           654 kB/s |  33 MB     00:51
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : dracut-004-411.0.9.el6.noarch                                1/6
  Updating   : dracut-kernel-004-411.0.9.el6.noarch                         2/6
  Installing : kernel-2.6.32-754.35.1.el6.x86_64                            3/6
  Installing : kmod-oracleasm-2.0.8-16.1.el6_10.x86_64                      4/6
  Cleanup    : dracut-kernel-004-388.0.1.el6.noarch                         5/6
  Cleanup    : dracut-004-388.0.1.el6.noarch                                6/6
  Verifying  : kernel-2.6.32-754.35.1.el6.x86_64                            1/6
  Verifying  : dracut-004-411.0.9.el6.noarch                                2/6
  Verifying  : dracut-kernel-004-411.0.9.el6.noarch                         3/6
  Verifying  : kmod-oracleasm-2.0.8-16.1.el6_10.x86_64                      4/6
  Verifying  : dracut-kernel-004-388.0.1.el6.noarch                         5/6
  Verifying  : dracut-004-388.0.1.el6.noarch                                6/6

Installed:
  kmod-oracleasm.x86_64 0:2.0.8-16.1.el6_10

Dependency Installed:
  kernel.x86_64 0:2.6.32-754.35.1.el6

Dependency Updated:
  dracut.noarch 0:004-411.0.9.el6     dracut-kernel.noarch 0:004-411.0.9.el6

Complete!

[root@RACFLEX1 oracle]# rpm -qa|grep oracleasm
oracleasm-support-2.1.11-2.el7.x86_64
oracleasmlib-2.0.12-1.el7.x86_64

First configure oracleasm

[root@RACFLEX1 oracle]# 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 []: 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

Then initialize oracleasm

[root@RACFLEX1 oracle]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

Create the logical disks on top of partitions for the ASM diskgroups

[root@RACFLEX1 oracle]# oracleasm createdisk DATA1 /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@RACFLEX1 oracle]# oracleasm createdisk FRA1 /dev/sde1
Writing disk header: done
Instantiating disk: done
[root@RACFLEX1 oracle]# oracleasm createdisk CRS1 /dev/sdf1
Writing disk header: done
Instantiating disk: done

Scan to verify stale or corrupted disks and list each ASM disks

[root@RACFLEX1 oracle]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@RACFLEX1 oracle]# oracleasm listdisks
CRS
CRS1
DATA
DATA1
FRA
FRA1
[root@RACFLEX1 oracle]#

while installing a database ,we can specify these disks to create ASM diskgroups

Published by kishan

You will know about me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: