Oracle ASM DiskGroup Adding and Removing Disks

YouTube video

In this article, we will discuss how to add and remove disks from ASM’s (Automatic Storage Management) group in Oracle. We will specifically focus on a stand-alone database scenario and use ASM as the storage option. By following the steps mentioned here, you will be able to add and remove disks from ASM’s group effectively.

Before we proceed, let’s quickly recap the setup we will be working with. We have a stand-alone database known as the OEM database. You might remember this from a previous video where we demonstrated the installation of OEM (Oracle Enterprise Manager) 13c. The OEM database is running on a standalone grid with only one database.

To begin, let’s check the ASM’s group in the current environment. We can switch to the grid user and run the command asmcmd -sdg to view the ASM’s group. We will see that there are two ASM’s groups named dg_data and dg_fre. Under the dg_data group, we have 30GB of free space available.

Now, we will proceed with adding and removing disks from the dg_data group. The first step is to stop the virtual machine. To do this, we need to perform a clean shutdown of the Oracle restart using crsctl stop has command, followed by init 0 to stop the virtual machine.

Once the virtual machine is stopped, we can go to the settings in Oracle VirtualBox and navigate to Storage. Here, we will attach new disks to the virtual machine. We will create two 15GB disks named oem_data_disk and oem_fre_disk. After attaching the disks, we can start the virtual machine.

Next, we need to create partitions on the newly added disks. We can verify the availability of the disks by running the command lsblk. We will see the newly added disks as sdd and sdc. To create partitions, we use the command fdisk and select the disk with the sdd and sdc names. Once the partitions are created, we can run lsblk again to verify the partition creation.

After creating the partitions, we need to create ASM disks. We will use the command oracleasm create disk followed by the name and path of the disk. In our case, we will create asm_data_disk02 and asm_fre_disk02. These disks will be added to the dg_data and dg_fre groups respectively.

Now, let’s add the newly created disks to the ASM’s group. To do this, we need to log in as asmcmd user. We can use the command alter diskgroup dg_data add disk followed by the path of the disk and the rebalance power. The rebalance power determines how many CPUs will be used for the rebalancing operation. We can monitor the progress of the adding operation by querying the table asm_operations.

After successfully adding the disks, we can check the ASM disks to verify the addition. We will see that the candidate count has decreased, indicating that the new disks have been added.

Next, we need to remove the old disks from the ASM’s group. To do this, we log in as asmcmd user and use the command alter diskgroup dg_data drop disk followed by the disk name. We can monitor the progress of the dropping operation by querying the table asm_operations.

Once the dropping operation is completed, we can verify the ASM disks again to see that the old disks have been removed.

In conclusion, adding and removing disks from the ASM’s group is an essential task in Oracle databases, especially in scenarios where storage requirements change over time. By following the steps mentioned in this article, you can effectively add and remove disks from the ASM’s group in Oracle. Ensure to monitor the progress of the operations and verify the changes in the ASM disks.

Remember, proper planning and caution should be exercised while performing these operations to avoid any data loss or system downtime. It is recommended to perform these tasks in a test or development environment before implementing them in a production environment.