For a basic overview of the RAC architecture, working and installation, you can refer to
Once the RAC grid and database are installed, you can add a new ASM disk as per the steps below.
The RAC system used is as per the configuration shared in the post above.
It is a 2 node RAC having existing ASM and shared disks on Oracle OS Linux 5.1.19.6
RAC Node 1 - Alpha
RAC Node 2 - Omega
Existing setup includes the following ASM libraries
- oracleasm-support-2.1.7-1.el5.x86_64.rpm
- oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
- oracleasmlib-2.0.4-1.el5.x86_64.rpm
ASMLib is an interface between block devices in linux and the Oracle ASM software.
ASMLib handles device permissions, marks devices for use with ASM and can scan for new devices being added.
The ASM libraries can be added with the following command
rpm -ivh {name of the rpm file}
The ASMLib driver can be configured using the configure option
/etc/init.d/oracleasm configure
Here we will set the ASMLib to be owned by oracle user, dba group, and to load on boot.
The driver can now be started using the command
/etc/init.d/oracleasm start
We can now add additional shared disks to our existing 2 node RAC.
Make sure both the VMs are shut down.
On alpha go to VM -> settings
- Click on the [ADD] button
- Select Hard Disk and [Next]
- SCSI recommended [Next]
- Create a new vitrual disk [Next]
- Maximum disk size (in GB) : 5
- Click on [Allocate disk space now]
- Store virtual disk as a single file [Next]
Specify a path and a filename on the machine where you want the shared storage to be created.
say the
path : /u01/rac/SharedDiskFileName : asm_disk_3.vmdk
In Advanced settings, we move this Hard Disk to a new
SCSI Controller and device. Say controller 1 and device 0. And in Mode option, select Independent and Persistent and click on [
Save]
In VMWare, a SCSI (Small Computer System Interface) controller acts as a bridge between the guest operating system and the virtual storage, facilitating communication and data transfer. It is a virtualized version of a physical SCSI controller, offering various benefits like improved performance, increased device support, bus sharing, making it suitable for demanding workloads.
Now navigate to the path where the VM files for Alpha node are stored. Here you will find a file Alpha.vmx.
In Alpha.vmx make sure the following lines are present
scsi1:0.fileName = "/u01/rac/SharedDisk FileName /asm_disk_3.vmdk"
scsi1:0.mode = "independent-persistent"
scsi1:0.present = "TRUE"
scsi1:0.redo = ""
Now both the nodes Alpha and Omega can be started.
When Alpha is booted up we should be able to create a partition table on the new shared disk.
#ls –l /dev/sd*
This command should share the new shared disk /dev/sdb
We create a partition on the new shared disk as follows
As root user
#fdisk /dev/sdb
Command (m for help): u
Changing display/entry units to sectors
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First sector (63-10485759, default 63):
Last sector or +size or +sizeM or +sizeK (2048-10485759, default 10485759):
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Once the partition is created we can stamp it for use by ASM as follows
#oracleasm createdisk DATA1 /dev/sdb1
To list the newly created disk we can use the command
#oracleasm listdisks
DATA
DATA1
Now if we login into Omega and print the partition table we should be able to see the partition we created on the new shared disk.
# fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 5368 MB, 5368709120 bytes
181 heads, 40 sectors/track, 1448 cylinders
Units = cylinders of 7240 * 512 = 3706880 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1449 5242848+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Now we can use ASMLib on Omega to scan the devices for any ASM stamped disks
oracleasm scandisks
If we do a listdisk we should be able to see the new shared disk.
#oracleasm listdisks
DATA
DATA1
To create a new diskgroup in ASMCA
$ export ORACLE_SID=+ASM1
$ asmca
In diskgroups tab click on [
Create]
Give a diskgroup name : DATA1
In redundancy section
Select External (none)
In [Select Member Disks section] click on
ORCL : DATA1
Click ok. You will get the following pop up.
Disk group DATA1 created successfully.
The diskgroup can also be manually created from the cmd prompt as follows.
$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid
$ export PATH=/u01/app/oracle/product/11.2.0/grid/bin
$ export ORACLE_SID=+ASM1
$sqlplus sys as sysasm
#CREATE DISKGROUP DATA1 EXTERNAL REDUNDANCY DISK 'ORCL:DATA1';
Adding disks to a diskgroup.
Create a new shared disk and partition the disk using fdisk from the steps mentioned above.
We can now stamp it for use by ASM as follows.
oracleasm createdisk DATA2 /dev/sdc1
We now add this newly created asm disk to the existing diskgroup DATA1 as follows
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid
export PATH=/u01/app/oracle/product/11.2.0/grid/bin
export ORACLE_SID=+ASM1
sqlplus / as sysasm
Alter diskgroup DATA1 add disk ‘ORCL:DATA2’ rebalance power 6;
We can list the diskgroups created with the folowing command
select * from v$asm_diskgroup where name='DATA1';
In asmcmd list details of the diskgroup
# ls -l
# ls -l DATA
# ls -l DATA1
We can list the asm disks created from v$asm_disk
Sql$ select group_number, disk_number, path from v$asm_disk;
God's Word for the day
The beginning of human pride is to forsake the Lord
The heart has withdrawn from its maker.
For the beginning of pride is sin,
And the one who clings to it pours out abominations.
Therefore the Lord brings upon them unheard of calamities.
And destroys them completely.
Sirach 10:12-13