How to Remove an Oracle Home on Exadata Using DBAAS CLI

How to Remove an Oracle Home on Exadata Using DBAAS CLI

Managing Oracle Homes on Exadata is a common task for database administrators, and at times, it becomes necessary to remove an Oracle Home that is no longer required. This guide walks you through the process of removing an Oracle Home using the dbaascli utility on Exadata.

Prerequisites

Before proceeding, ensure the following:

  1. You have root or sufficient privileges to execute the commands on the Exadata node.
  2. No databases are actively using the Oracle Home to be removed.
  3. Backup the Oracle Inventory file to prevent accidental data loss:
    cp /etc/oraInst.loc /etc/oraInst.loc.bak
  4. Identify the Oracle Home name and location. For example:
  • Oracle Home Name: OraHome_DB192300_240425_3_p1
  • Path: /u02/app/oracle/product/19.0.0.0/dbhome_16

Step-by-Step Process

1. Verify the Oracle Home Details

Run the following command to confirm the details of the Oracle Home:

dbaascli dbHome getDetails --oracleHomeName OraHome_DB192300_240425_3_p1

This command provides information about the databases associated with the Oracle Home.

2. Execute the Deletion Command

Use the dbaascli dbHome delete command to remove the Oracle Home:

dbaascli dbHome delete --oracleHomeName OraHome_DB192300_240425_3_p1

This command initiates the deletion process and provides a session log for reference. For example:

DBAAS CLI version 24.3.1.0.0
Executing command dbHome delete --oracleHomeName OraHome_DB192300_240425_3_p1
Job id: 24d7e6e7-002c-4dc1-8b56-19e3c834329b
Session log: /var/opt/oracle/log/dbHome/delete/dbaastools_2024-12-22_10-33-45-PM_110119.log

3. Monitor the Progress

The deletion process involves multiple steps, including pre-checks, detaching the Oracle Home, removing directories, and post-deletion cleanup. You can monitor the progress by following the session log:

tail -f /var/opt/oracle/log/dbHome/delete/dbaastools_2024-12-22_10-33-45-PM_110119.log

4. Verify the Deletion

Once the process completes, confirm that the Oracle Home has been removed:

1. Check the Oracle Inventory to ensure the entry is no longer present:
cat /etc/oraInst.loc | grep OraHome_DB192300_240425_3_p1

2. Verify that the Oracle Home directory has been deleted from the file system:
ls -ld /u02/app/oracle/product/19.0.0.0/dbhome_16

5. Clean Up (Optional)

If the Oracle Home directory still exists, remove it manually:

rm -rf /u02/app/oracle/product/19.0.0.0/dbhome_16

Troubleshooting

If the dbaascli command fails, consider the following:

  • Issue: Oracle Home is still listed in the inventory after deletion.
  • Solution: Manually detach the Oracle Home using the following command:
    /u02/app/oracle/product/19.0.0.0/dbhome_16/oui/bin/runInstaller -silent -detachHome \ ORACLE_HOME=/u02/app/oracle/product/19.0.0.0/dbhome_16
  • Issue: Directory is not removed automatically.
  • Solution: Manually remove the directory using the rm command.
  • Issue: Logs indicate a failure during OH_detach.
  • Solution: Review the session logs for errors and reattempt the command after addressing the issue.

Conclusion

The dbaascli utility simplifies the process of managing Oracle Homes on Exadata. By following this guide, you can efficiently remove an Oracle Home while ensuring proper cleanup and minimal disruption to the system. Always verify that the Oracle Home is not actively used before initiating the deletion process.

Author: Rohit Mishri

Leave a Reply

Your email address will not be published. Required fields are marked *