Skip to content

62. ASM Installation

Agnivo102 edited this page Oct 28, 2026 · 9 revisions

ASM Installation:

High Levels steps to install a Grid or ASM Database installation and how it is different from Normal database installation:

Normal DB Intallation:

  1. VM Creation
  2. OS Installation 7.9|9.5
  3. DB Software installation 19c
  4. DB Creation

ASM:

  1. VM Creatipn
  2. OS Installation 7.9|9.5
  3. Creation of disks & diskgroup
  4. Disk partition
  5. Grid software(GI)/ASM Installation
  6. DB Software installation 19c
  7. DB Creation

Step 1: Do the pre-requisites after creating VM and OS Installation.

1.1: Login as root and run : yum install -y oracle-database-preinstall-19c. We know yum is just a central Linux repository in internet which contains software in encrypted form so that we always get the genuine thing. So we are downloading the kernal changes and pre-requisites required to run the ASM Database like we did before when installing database.

Screenshot

1.2: That was just the database installation pre-requisite which we did before. For ASM we need to install this separately: Run yum install -y oracleasm*

Screenshot

Run yum install -y kmod-oracleasm*: This is just a package to manage and monitor the storage devices, when we add a file in ASM, it will help manage and monitor the things.

Screenshot

Note: A small note, to see or current OS installed use cat /etc/os-release.

Screenshot

Note 2: To check the current version of kernel use uname -r

Screenshot

Note 3: To check the current packages installed in our OS based on a name use rmp -qa | grep name

Screenshot

1.3: Add the ASM user and user groups.

groupadd -g 54327 asmdba groupadd -g 54328 asmoper groupadd -g 54329 asmadmin

These numbers are all specific permission for this groups. We need them like this. Also remember that downloading a pre-requisite package install all the user and user groups required automatically, but their permission will be different, so need to this manual step.


Screenshot

1.4: Add asmdba as a secondary group to oracle user.

usermod -a -G asmdba oracle


Screenshot

1.5: Add a grid user. Just like oracle user is the OS super user for oracle database, grid user is the super user for oracle ASM. Activities for database prompt use oracle user, for activities in oracle ASM use grid user

useradd -u 54331 -g oinstall -G dba, asmdba, asmoper, asmadmin, racdba, grid


Screenshot

1.6: Change the password of the grid user.

Screenshot

1.7: Create the directories for the software installation.

For Oracle home database without ASM:

These are the normal things we know. But remember one things, in prganization this location of Oracle Home and Oracle base will be completely different than this, some organization /u01 will be /opt or /u03, check the oratab file to know the Oracle home location, this generic location we use is not default. We can change it according to the requirement.

mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/19/db
chown -R oracle:oinstall /u01
Screenshot

For ASM: For ASM and grid we also have to make them separate from without ASM

mkdir -p /u01/app/grid/product/19/grid
chown -R grid:oinstall /u01/app/grid      //For ASM Binaries make grid user the owner.
chmod -R 755 /u01      //Inside u01 directory whose owner is oracle user, the grid directory inside u01, app , its owner will be grid. 
Screenshot

Step 2: Configure Oracle ASM. Run: oracleasm configure -i

This configure the Oracle ASM


Screenshot

There will be certain questions here which will detarmine this things: Default user to own the driver interface this means which user will manage the ASM Filesystem. The answer will be grid user.


Screenshot

Default group to own the driver interface this means which user group will manage the ASM Filesystem. The answer will be oinstall user group as it makes sense, both oracle user and grid user falls under oinstall user group.


Screenshot

Start Oracle ASM library driver on boot (y/n) [n]: y, means when the OS boots up this software or program will be run automatically, and the next option Scan for Oracle ASM disks on boot (y/n) [y]: y means that when the Oracle Linux OS boots up then this software will search for the storage disks configured with Oracle ASM File system.


Screenshot

Step 3: Load/ Initiate Oracle ASM. Run:

oracleasm init
OR
sync
shutdown -r now

This oracleasm init means it will do the changes in the OS Kernel Layer. Then you need to restart the OS like to make some changes reflect in the database we need to restart the database we need to reatart the OS too here, to reflect the changes made on the OS. Either run the 1st command or the bottom 2 commands. The 2nd option will restart the VM entirely and will take a large time. So run oracleasm init, will do this without restarting the entire VM.


Screenshot

After this shutdown the VM using init 0.

Step 4: Now up until now we were storing the database binary files in dev-mapper-ol-root Logical Volume which is mounted on the / mount point, this is the place which contain the OS files itself required to run the OS, and we were storing our application files inside the XFS Filesystem controlled storage. We need to put database files inside separate external storage which will be controlled by Oracle ASM Filesystem now. So add new storage in our VM.

Follow the same step we did before. Then start the VM again.

Step 5: Again login as root user to format the newly added disk for getting used by ASM, previously we let our OS take the extra space, now we will give it to ASM to use. Check the server uptime when it is started.

[root@localhost ~]# uptime
 19:54:19 up 4 min,  2 users,  load average: 0.29, 0.63, 0.33
[root@localhost ~]# 

Now see the available disks to our OS using fdisk -l


Screenshot

See /dev/sdb/ sdb(or storage device b) is our newly added disk.

Step 6: Now I want to divide this 20 GB disk into 2 parts of 10 GB each, into sdb1 and sdb2. Use fdisk /dev/sdb

Screenshot

Now n is for creating new partition so write n.


Screenshot

From there do that is everything default.

.......................................................................................................................................................

Note: Imagine your hard drive (/dev/sdb) as a massive, continuous highway of billions of tiny storage blocks called sectors (each typically 512 bytes), lined up one after another from sector 0 to the end of the disk.

The Physical Hardware Level (Sector 0) The very first sector on the hard drive (Sector 0) is called the Master Boot Record (MBR). Buried inside it is a tiny 64-byte table divided into exactly 4 slots. A slot is, like this:

slot 1 : sector 1 - sector 654, slot 2 : sector 655 - sector 879, slot 3 : sector 890 - sector 1654 , Slot 4 : sector 1655 - sector 2654

Now, sector 0 slots is not modern table what we see on excel or on a relational database, but its not, its actually some kind of physical hardware hardcoded table, where a piece of silicon, is divided into 4 parts and a very specific maths circuit is drawn on it, this stores the default data that slot 1 room walls will be from here to here etc, this is placed on the hard drive itself on the computer. This is absolute basic thing of a computer and cannot be changed.

Every OS whether its the hyper efficient and versatile Linux or corporate specific OS like windows, this logic is actually fitted in all their building block itself, that always search for this specific hardcoded table when it start working (this is written on the motherboard that look for this sector 0 when OS start working), this logic is completely if else level where 0 means not work and 1 means work, so if someone tries to change sector 0 then the entire OS will find 0 and not work, as if the building block collapses all of the building will collapse, anyone wants to change this fundamental thing or even create a copy of sector 0 hardware in a machine they literally have to create an OS from scratch to do this.

This is the primary partition p, the default option, the other extended option e, is this:

The Extended Partition Workaround (e): If you need 5 or more partitions, you sacrifice one of your 4 slots for an "extended partition." The last slot will be a linked list which will point to a spe, next partition slot one by one. Like this:

1. MBR Slot 1: Sector 2 to sector 8790
2. MBR Slot 2: Sector 8791 to sector 18790
3. MBR Slot 3: Sector 18791 to sector 28790
4. MBR Slot 4: Go to sector 28791

1. In sector 28791[EBR 1]: Sector 28798 to sector 38792, and go to sector 38793
2. In sector 38793[EBR 2]: Sector 38794 to sector 48792, and go to sector 48793
...............................................................................

When the Linux kernel boots up, it reads Sector 0, sees Slot 4 points to Sector 28791, reads that EBR(Extended Boot Record), finds Partition 5, follows the pointer to Sector 38793, reads that EBR, finds Partition 6, and keeps following the chain until the pointer says 0 (meaning: End of the list, no more partitions!).


Screenshot

Again give the default 1.


Screenshot

Now see, it is saying to give the size of the 1st sector, just enter here and it will take the default value


Screenshot

This 2048 is actually a gap between sector 0 and sector 1, this 2048 is exactly 1 MB gap, The "Guard Zone" (Sectors 0 to 2047) That 2048-sector gap equals exactly 1 megabyte of storage. Modern operating systems and partitioning tools automatically leave this space empty for very important reasons:

Sector 0 is Preserved: Sector 0 sits right at the very beginning, holding the MBR map (Master Boot Record). By starting your partition at 2048, fdisk guarantees you never accidentally overwrite the master map.

Now it says to give the size of the actual first partition:


Screenshot

We give it 10 GB, and see the 1st partition is created, see second time its showing partition 2,


Screenshot

By pressing enter the rest of the remaining space is taken by the OS to create the 2nd partiton, The press w and enter to save the changes on the disk (from the help m command, w is given to save the changes)


Screenshot

See the sdb got divided into 2 parts sdb1, sdb2.


Screenshot

Step 7: Now we have to create disk group. Use the command oracleasm createdisk DATA /dev/sdb1

Screenshot

DATA will be the name of the disk created on the first partition sdb1, this is the naming convention but we can give other names as per requirement, this will hold the data files, control files, redo log files, etc, that why the name.


Screenshot

With this command oracleasm listdisks will give the currently created disks.


Screenshot

We created a second disk group FRA on the 2nd partition sdb2, by the name we understood that we will keep the backups, archive log files, second control files inside this disk.

We can't create 2 disk group on the same physical partiton, so to create this 2 disk groups, we needed to create 2 partitions.

Disk group is a logical entity, the phyisical disk /dev/sdb, and its partitions are physical entities where the data will be present.

Step 8: Install the ASM or GRID Software. Unzip the grid software inside /u01/app/grid/product/19/grip/

Screenshot

Now we need to make the owner of this software to grid user from root user.


Screenshot

Step 9: Now login as grid user and go inside /u01/app/grid/product/19/grip/ and run ./gridSetup.sh

Screenshot

A graphical window will appear.

Step 10: Now follow the steps.

Screenshot

The first option is for setting up Oracle Real Application Cluster(RAC, the one with multiple instances for a single database), 3rd option is for upgaradation like from 12c to 19c, last option is only for setting up the software only. We will choose the second option, this will configure oracle grid infrastructure for a standalone server:

The core difference between these two options comes down to decoupling installation from configuration: "Software Only" just drops the application files onto the disk, while "Oracle Restart" drops the files and immediately builds the active background management engine for a standalone server.

10.1: If the disk group name, different from what you have given change it,

Screenshot

Now the second option, types of reducdancy, select extrnal.


Screenshot

Now see we can't see the physical disk /dev/sdb1 which we uses to create the disk group DATA is not showing anywhere. Because the location has been different. Click on change discovery path.


Screenshot
Screenshot

Change it to this path: /dev/oracleasm/disks/


Screenshot

Click on ok, see the disks are showing up now:


Screenshot

Now select on DATA disk. Click on Next.

Screenshot

10.3: Now as before give the passwords for sys. Then click on next.

Screenshot

10.4: Now again skip the option like we used to do before for oracle enterprise manager and dont select this and click on next.

Screenshot

10.5: See this were the user groups were created during pre-requisite package download. Click on next.

Screenshot

10.6: This is the grid base location just like Oracle Base. Click on next.

Screenshot

10.7: Skip this step or if you want you can select it, click on next.

Screenshot

10.8: Then a pre-requisite check is done. This warning is come, one is about physical memory and is showing not fixable, the another is about a package and it is flixable, as it is written under the fixable. Click on the fixable second option and click on fix and check again.

Screenshot

It is saying to run this script as a privileged user or root user on another terminal. Do it and click on ok. Click on ok.


Screenshot
Screenshot

See now that warning is gone. Now for the unfixable one, click on ignore all. And click on next. Again click on ok for the new window.


Screenshot

Click on Install.


Screenshot

10.9: Now that this error come.

Screenshot

It says no such file or directory, this means this directory is not there. So just create the directory.


Screenshot

Here we tried to create the oraInventory directory under /u01/app, it showed permission denied for grid user, so we login to oracle user create the directory and give all users of oinstall group (grid user also belongs to oinstall group) the permission set of read, write and execute so that grid user can access this one for installation.

As the error comes the GUI will exist itself. Again follow the earlier steps and it will be successful. See the installation is in progress.


Screenshot

They said to run this script as root user, so do this.


Screenshot
Screenshot

And click on Ok.


Screenshot
Screenshot

The Installation is done and successful.

After installing do a ps -ef | grep pmon


Screenshot

There is pmon running for +ASM.

Clone this wiki locally