Removing Inactive Oracle Homes on ZDLRA with racli

In Oracle Zero Data Loss Recovery Appliance upgrades, Oracle has begun applying patches out-of-place and keeping the old Oracle Homes in the Oracle Home directory.

This can lead to a full disk and unnecessary space usage, so in this article I will show how to safely clean up these old, inactive Oracle Homes.

First, we need to run some checks before actually removing the Oracle Homes, as stated in KB699072. This is necessary to make sure we are not removing an Oracle Home that libra.so is pointing to in the replication server configuration.

Connected as rasys to the ZDLRA database, run the following queries:

SQL> set linesize 200 pagesize 100
SQL> SELECT replication_server_name, sbt_library_name, sbt_library_parms FROM ra_replication_config;

REPLICATION_SERVER_NAME
--------------------------------------------------------------------------------------------------------------------------------
SBT_LIBRARY_NAME
--------------------------------------------------------------------------------------------------------------------------------
SBT_LIBRARY_PARMS
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ZDLDB01_REP
REP$LIB_16006_ZDLRA01_REP
SBT_LIBRARY=libra.so, SBT_PARMS=(RA_WALLET="LOCATION=file:/raacfs/raadmin/replication CREDENTIAL_ALIAS=zdl01repl-scan1.example.com:1537/zdldb01", RA_REPLICATION=TRUE)


SQL> SELECT lib_key, lib_name, parms FROM sbt_lib_desc;

   LIB_KEY LIB_NAME
---------- --------------------------------------------------------------------------------------------------------------------
PARMS
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     16006 REP$LIB_16006_ZDLDB01_REP
SBT_LIBRARY=libra.so, SBT_PARMS=(RA_WALLET="LOCATION=file:/raacfs/raadmin/replication CREDENTIAL_ALIAS=zdl01repl-scan1.example.com:1537/zdldb01", RA_REPLICATION=TRUE)

SQL>

OK, so now, as the root user, check for inactive Oracle Homes:

[root@zdl01dbadm01 ~]$ racli list oracle_home --inactive
Fri Dec  4 08:08:45 2026: Start: List Oracle Home
Oracle Home Name: OraDB19Home1
        PATH:   /u01/app/oracle/product/19/dbhome_1
        INDEX:  2
        STATUS: inactive
Oracle Home Name: OraDB19Home3
        PATH:   /u01/app/oracle/product/19/dbhome_11000200_1
        INDEX:  8
        STATUS: inactive
Oracle Home Name: OraDB19Home4
        PATH:   /u01/app/oracle/product/19/dbhome_11000300_1
        INDEX:  11
        STATUS: inactive
Oracle Home Name: OraDB19Home5
        PATH:   /u01/app/oracle/product/19/dbhome_11000400_1
        INDEX:  13
        STATUS: inactive
Oracle Home Name: OraDB19Home6
        PATH:   /u01/app/oracle/product/19/dbhome_11000500_1
        INDEX:  15
        STATUS: inactive
Fri Dec  4 08:08:45 2026: End: List Oracle Home

Choose the Oracle Home that you want to remove and run the following command:

[root@zdl01dbadm01 ~]$ racli remove oracle_home --oracle_home=/u01/app/oracle/product/19/dbhome_11000200_1
Fri Dec  4 08:20:30 2026: Start: Remove Oracle Home
Note:
    The inactive oracle home /u01/app/oracle/product/19/dbhome_11000200_1
    will be removed with all files under its directory.
    Rollback is not feasible after removal action.
    Do you want to continue (y|n):  y
Fri Dec  4 08:22:10 2026: End: Remove Oracle Home

In my case, I chose to remove the oldest out-of-place Oracle Home, keeping the latest three and the first Oracle Home.

Let’s check the result:

[root@zdl01dbadm01 ~]$ racli list oracle_home --inactive
Fri Dec  4 08:32:37 2026: Start: List Oracle Home
Oracle Home Name: OraDB19Home1
        PATH:   /u01/app/oracle/product/19/dbhome_1
        INDEX:  2
        STATUS: inactive
Oracle Home Name: OraDB19Home4
        PATH:   /u01/app/oracle/product/19/dbhome_11000300_1
        INDEX:  11
        STATUS: inactive
Oracle Home Name: OraDB19Home5
        PATH:   /u01/app/oracle/product/19/dbhome_11000400_1
        INDEX:  13
        STATUS: inactive
Oracle Home Name: OraDB19Home6
        PATH:   /u01/app/oracle/product/19/dbhome_11000500_1
        INDEX:  15
        STATUS: inactive
Fri Dec  4 08:32:37 2026: End: List Oracle Home

Also, check filesystem:

[root@zdl01dbadm01 ~]$ ls -ld /u01/app/oracle/product/19/dbhome*
drwxr-xr-x 73 oracle oinstall 4096 Dec  1 15:33 /u01/app/oracle/product/19/dbhome_1
drwxr-xr-x 73 oracle oinstall 4096 May 2  2026 /u01/app/oracle/product/19/dbhome_11000300_1
drwxr-xr-x 73 oracle oinstall 4096 Dec  1 22:18 /u01/app/oracle/product/19/dbhome_11000400_1
drwxr-xr-x 73 oracle oinstall 4096 Dec  1 23:00 /u01/app/oracle/product/19/dbhome_11000500_1

Next article I will show how to remove grid homes.

Referece: My Oracle Support article KB699072.


Deixe um comentário