Advertisement

Friday, March 3, 2017

Oracle Database - Grid Infrastructure / RAC 12c Installation - Part 4 - Disk Configuration (OEL 7.1)

 

In this blog we will discuss installation of Oracle ASM Lib and Shared Disks Configuration

ASM Lib Configuration
From
http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/index.html
download below
There are versions of kmod-oracleasm as per Kernel version (I am running on kernel version - 3.10.0-229)

  1. kmod-oracleasm-2.0.8-8.el7.x86_64.rpm
  2. oracleasm-support-2.1.8-3.1.el7.x86_64.rpm 



[root@rac1 rpm]# rpm -Uvh kmod-oracleasm-2.0.8-8.el7.x86_64.rpm 
warning: kmod-oracleasm-2.0.8-8.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:kmod-oracleasm-2.0.8-8.el7       ################################# [100%]


[root@rac1 rpm]# rpm -Uvh oracleasm-support-2.1.8-3.1.el7.x86_64.rpm 
warning: oracleasm-support-2.1.8-3.1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:oracleasm-support-2.1.8-3.1.el7  ################################# [100%]

Oracle ASM Configuration

[root@rac1 rpm]# /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 []: grid
Default group to own the driver interface []: asmdba
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@rac1 rpm]# oracleasm init
[root@rac1 rpm]# service oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

Note: Forwarding request to 'systemctl enable oracleasm.service'.
ln -s '/usr/lib/systemd/system/oracleasm.service' '/etc/systemd/system/multi-user.target.wants/oracleasm.service'


Create Shared Disks
I am using Windows as base machine and I will be creating disks on my Desktop which will be used as shared disks

"C:\Program Files\Oracle\VirtualBox\VBoxManage" createhd --filename asm1_disk.vdi --size 5120 --format VDI --variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage" createhd --filename asm2_disk.vdi --size 5120 --format VDI --variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage" createhd --filename asm3_disk.vdi --size 5120 --format VDI --variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage" createhd --filename asm4_disk.vdi --size 5120 --format VDI --variant Fixed






Shutdown the machine if you haven not here

"C:\Program Files\Oracle\VirtualBox\VBoxManage" storageattach OEL_71_Node1 --storagectl "SATA" --port 1 --device 0 --type hdd --medium asm1_disk.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage" storageattach OEL_71_Node1 --storagectl "SATA" --port 2 --device 0 --type hdd --medium asm2_disk.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage" storageattach OEL_71_Node1 --storagectl "SATA" --port 3 --device 0 --type hdd --medium asm3_disk.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage" storageattach OEL_71_Node1 --storagectl "SATA" --port 4 --device 0 --type hdd --medium asm4_disk.vdi --mtype shareable


"C:\Program Files\Oracle\VirtualBox\VBoxManage" modifyhd asm1_disk.vdi --type shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage" modifyhd asm2_disk.vdi --type shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage" modifyhd asm3_disk.vdi --type shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage" modifyhd asm4_disk.vdi --type shareable








Restart Your Machine

ASM Disks Creation and Formatting
4 new Disks are now visible, but they are still unpartitioned

[root@rac1 ~]# fdisk -l

Disk /dev/sdd: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sde: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 37.6 GB, 37580963840 bytes, 73400320 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00090565

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    73400319    36187136   8e  Linux LVM

Disk /dev/sdc: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Partition the disks

[root@rac1 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xd9d721ea.

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
   g   create a new empty GPT partition table
   G   create an IRIX (SGI) partition table
   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): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-10485759, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759): 
Using default value 10485759
Partition 1 of type Linux and of size 5 GiB is set

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

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

[root@rac1 ~]# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xf5f3dcfa.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-10485759, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759): 
Using default value 10485759
Partition 1 of type Linux and of size 5 GiB is set

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 ~]# fdisk /dev/sdd
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x2d5dcb82.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-10485759, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759): 
Using default value 10485759
Partition 1 of type Linux and of size 5 GiB is set

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 ~]# fdisk /dev/sde
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xacbb430c.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-10485759, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759): 
Using default value 10485759
Partition 1 of type Linux and of size 5 GiB is set

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 ~]# 

Verify Disk Partitions

[root@rac1 ~]# fdisk -l /dev/sde

Disk /dev/sde: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xacbb430c

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1            2048    10485759     5241856   83  Linux
[root@rac1 ~]# fdisk -l /dev/sdd

Disk /dev/sdd: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x2d5dcb82

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048    10485759     5241856   83  Linux
[root@rac1 ~]# fdisk -l /dev/sdc

Disk /dev/sdc: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xf5f3dcfa

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048    10485759     5241856   83  Linux
[root@rac1 ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xd9d721ea

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10485759     5241856   83  Linux

Create ASM disks

[root@rac1 ~]# /etc/init.d/oracleasm createdisk DISK1 /dev/sdb1
Marking disk "DISK1" as an ASM disk:                       [  OK  ]
[root@rac1 ~]# /etc/init.d/oracleasm createdisk DISK2 /dev/sdc1
Marking disk "DISK2" as an ASM disk:                       [  OK  ]
[root@rac1 ~]# /etc/init.d/oracleasm createdisk DISK3 /dev/sdd1
Marking disk "DISK3" as an ASM disk:                       [  OK  ]
[root@rac1 ~]# /etc/init.d/oracleasm createdisk DISK4 /dev/sde1
Marking disk "DISK4" as an ASM disk:                       [  OK  ]


[root@rac1 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@rac1 ~]# oracleasm listdisks
DISK1
DISK2
DISK3
DISK4

No comments:
Write comments