RAC to Single Instance Cloning :
In this blog post, I will provide the detailed steps for cloning an Oracle Database Home (Oracle Database Software) from an already running Oracle Home to another database server. This approach is commonly used to standardize environments, deploy identical patch levels, and significantly reduce installation time. It applies to both Oracle RAC Database Homes and Single Instance Database Homes. You may ask why we need to do this instead of simply creating a brand-new Oracle Database Home.
The answer is simple:
The world ain’t all sunshine and rainbows.
Even though Oracle 26ai is on its way to on-premise environments, many organizations are still running dozens of old-version Oracle Homes that continue to serve critical applications. And in real life, there are solid reasons for cloning instead of reinstalling. Some of the most common scenarios are:
- You can’t find the installation setups anymore for your specific PSUs or one-off patches. They may have been archived or removed from internal repositories and may be password protected on Oracle Support.
- In ExaCC environments, you don’t have the option to provision old 12c releases through the GUI, and
dbaasclicannot deploy a legacy Oracle Home either.
In my case, we had a 12c database running in a RAC environment with lots of one-off patches applied. The requirement was to create a Data Guard environment for that database , but there was no setups.
For 18c and above, the recommended approach is to use Gold Images. Refer to Daniel’s post (How to Clone Oracle Home Without Using Clone.pl ) for more information, but for those still running on old versions the solution is using clone.pl.
Although the required commands are quite straightforward, I could not find any clear information in the official Oracle documentation about whether it is supported to clone an Oracle Home from RAC to Single Instance or from Single Instance to RAC. Because this creates uncertainty , I decided to write a dedicated blog post to demonstrate the exact steps and considerations for both directions.
Step 1: Install preinstall package
Because the 12c preinstall package is not available in the Oracle Linux 8 repository, we will proceed with the 19c preinstall package.
[root@oratargetserver /]# yum install -y oracle-database-preinstall-19c
Step 2: Create a ZIP or TAR file with the Oracle home (but not the Oracle base) directory.
One important point worth mentioning is this: when you clone an already-used Oracle Database Home, you are also copying all the “mess” that accumulated over the years. This includes installation logs, audit files, network configuration files (tnsnames.ora, sqlnet.ora, listener.ora), and anything else living under that home.
For this reason, clean up the source Oracle Home as much as possible before creating the tar archive. Remove unnecessary log files, old patching logs, temporary files, backups of listener configurations, and anything else that doesn’t need to travel with you. Also consider cleaning up the .patch_storage files, you may use Opatch to clean up inactive patches. (opatch util deleteinactivepatches)
Also be extremely careful with password files under the dbs directory. These files will be copied into the new home as well, which may not be what you want.
On the source Oracle Home, create a tar file.
[oracle@exadb01 12.1.0.2]$ tar -zcf dbhome_5.tar dbhome_5
[oracle@exadb01 12.1.0.2]$ scp dbhome_5.tar oratargetserver:/home/oracle/Setups/
Step 3: Prepare target database home.
Create the target home directories.
[root@oratargetserver /]# mkdir -p /u01/app/oracle
[root@oratargetserver /]# mkdir /u01/app/Setup
[root@oratargetserver /]# chown -R oracle:oinstall /u01
[root@oratargetserver /]# chmod -R 775 /u01
[oracle@oratargetserver ~]$ mkdir -p /u01/app/oracle/product/12.1.0/dbhome_5
[oracle@oratargetserver ~]$ mv /home/oracle/Setups/dbhome_5.tar /u01/app/oracle/product/12.1.0/dbhome_5/
[oracle@oratargetserver ~]$ cd /u01/app/oracle/product/12.1.0/dbhome_5
[oracle@oratargetserver ~]$ tar -xf dbhome_5.tar
Step 4: Run clone.pl
If you don’t have any installed Oracle software on the target server, be careful about the central inventory location, use INVENTORY_LOCATION option, otherwise you central inventory will be /home/oracle which we will not prefer.
First, we will define the ORACLE_BASE and ORACLE_HOME variables. Additionally, if this is the first Oracle product installed on the server, we must also define INVENTORY_LOCATION. If it is not explicitly defined, Oracle will default to using /home/oracle as the central inventory location.
[oracle@oratargetserver ~]$ ORACLE_BASE=/orahome/app/oracle
[oracle@oratargetserver ~]$ ORACLE_HOME=/orahome/app/oracle/product/12.1.0/dbhome_5
[oracle@oratargetserver ~]$ ORAINST=/etc/oraInst.loc
[oracle@oratargetserver ~]$ echo inventory_loc=/orahome/app/oraInventory > /etc/oraInst.loc
[oracle@oratargetserver ~]$ echo inst_group=oinstall
[oracle@oratargetserver ~]$ cd $ORACLE_HOME/clone
[oracle@oratargetserver clone]$ E01=ORACLE_HOME=/orahome/app/oracle/product/12.1.0/dbhome_5
[oracle@oratargetserver clone]$ E02=ORACLE_HOME_NAME=OraDB12Home
[oracle@oratargetserver clone]$ E03=ORACLE_BASE=/orahome/app/oracle
[oracle@oratargetserver clone]$ perl $ORACLE_HOME/clone/bin/clone.pl $E01 $E02 $E03 OSDBA_GROUP=dba INVENTORY_LOCATION=/orahome/app/oraInventory
./runInstaller -clone -waitForCompletion "ORACLE_HOME=/orahome/app/oracle/product/12.1.0/dbhome_5" "ORACLE_HOME_NAME=OraDB12Home" "ORACLE_BASE=/orahome/app/oracle" "oracle_install_OSDBA=dba" "INVENTORY_LOCATION=/orahome/app/oraInventory" -silent -paramFile /orahome/app/oracle/product/12.1.0/dbhome_5/clone/clone_oraparam.ini
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB. Actual 36581 MB Passed
Checking swap space: must be greater than 500 MB. Actual 5119 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2025-11-26_03-39-23PM. Please wait ...You can find the log of this install session at:
/orahome/app/oracle/oraInventory/logs/cloneActions2025-11-26_03-39-23PM.log
.................................................. 5% Done.
.................................................. 10% Done.
.................................................. 15% Done.
.................................................. 20% Done.
.................................................. 25% Done.
.................................................. 30% Done.
.................................................. 35% Done.
.................................................. 40% Done.
.................................................. 45% Done.
.................................................. 50% Done.
.................................................. 55% Done.
.................................................. 60% Done.
.................................................. 65% Done.
.................................................. 70% Done.
.................................................. 75% Done.
.................................................. 80% Done.
.................................................. 85% Done.
..........
Copy files in progress.
Copy files successful.
Link binaries in progress.
Link binaries successful.
Setup files in progress.
Setup files successful.
Setup Inventory in progress.
Setup Inventory successful.
Finish Setup successful.
The cloning of OraDB12Home was successful.
Please check '/orahome/app/oraInventory/logs/cloneActions2025-11-26_03-39-23PM.log' for more details.
Setup Oracle Base in progress.
Setup Oracle Base successful.
.................................................. 95% Done.
As a root user, execute the following script(s):
1. /orahome/app/oracle/product/12.1.0/dbhome_5/root.sh
.................................................. 100% Done.
Step 5: Run root.sh
[root@oratargetserver /]# /orahome/app/oracle/product/12.1.0/dbhome_5/root.sh
Check /orahome/app/oracle/product/12.1.0/dbhome_5/install/root_oratargetserver_2025-11-26_15-40-59.log for the output of root script
Step 6: Verify the Patch Level of the Cloned Oracle Home
After the cloning process is completed, verify that the patch level of the cloned Oracle Home matches the source home.
[oracle@oratargetserver dbhome_5]$ OPatch/opatch lspatches
33568947;
33566041;
19239846;
21322448;
19472320;
27051384;
22747454;
21321429;
24007737;
22731026;
22828765;
21967332;
21864513;
32327201;
31335037;
30432084;
32327208;
31858428;UPDATE PERL IN 12.1.0.2 DATABASE ORACLE HOME TO V5.32
33192628;Database PSU 12.1.0.2.211019,Oracle JavaVM Component (OCT2021)
33197468;JDK BUNDLE PATCH 12.1.0.2.211019
21923026;
31413047;
33114885;Database Bundle Patch : 12.1.0.2.211019 (33114885)
32758932;OCW PATCH SET UPDATE 12.1.0.2.210720 (32758932)
OPatch succeeded.
If you encounter any issues at this stage, you should check the local inventory file (oraInst.loc under the new ORACLE_HOME) and verify that it points to the correct central inventory location. Otherwise, you may encounter the error shown below.
[oracle@oratargetserver dbhome_5]$ OPatch/opatch lspatches
Inventory load failed... LsPatchesSession::loadAndPrintInstalledPatch()
LsPatchesSession failed: OPatch failed to locate Central Inventory.
Possible causes are:
The Central Inventory is corrupted
The oraInst.loc file specified is not valid.
OPatch failed with error code 2
Step 7: Validating Oracle Home binaries
Now, we will validate the Oracle Home binaries to ensure that they are functioning correctly. At this stage, while invoking sqlplus, I encountered the error shown below.
[oracle@oratargetserver bin]$ ./sqlplus as / sysdba
./sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
Since the error was related to missing libraries, I set the LD_LIBRARY_PATH variable and checked again.
[oracle@oratargetserver bin]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
[oracle@oratargetserver bin]$ ./sqlplus as / sysdba
./sqlplus: error while loading shared libraries: /orahome/app/oracle/product/12.1.0/dbhome_5/lib/libclntshcore.so.12.1: file too short
Step 8: Run relink if you encounter any issues.
The error changed but was not resolved; relinking the Oracle Home binaries looks like a good fix.
[oracle@oratargetserver bin]$ /orahome/app/oracle/product/12.1.0/dbhome_5/bin/relink all
writing relink log to: /orahome/app/oracle/product/12.1.0/dbhome_5/install/relink.log
After investigating the relink.log file and the log files located under the install directory, I identified the root cause of the error.
INFO: /orahome/app/oracle/product/12.1.0/dbhome_5/bin/orald: line 31: exec: gcc not found.
According to the log files, since we used the 19c preinstall package, the package dependencies for 19c and 12c are not the same. As a result, we need to install two additional RPM packages to ensure that everything works properly.
[root@oratargetserver ~]# yum install -y gcc
[root@oratargetserver ~]# yum install -y gcc-c++
After the required packages are installed, we will run the relink command again. This time, everything works smoothly.
[oracle@oratargetserver bin]$ /orahome/app/oracle/product/12.1.0/dbhome_5/bin/relink all
writing relink log to: /orahome/app/oracle/product/12.1.0/dbhome_5/install/relink.log
Single Instance to RAC Cloning :
The steps are essentially the same and the overall process is very similar. The only difference is that the clone command flags are slightly different. In this case, we must specify the CLUSTER_NODES and LOCAL_NODE parameters. Additionally, all relevant steps must be executed on all RAC nodes.
You can use the olsnodes command under $GRID_HOME to determine the cluster nodes.
[grid@oratargetserver1 ~$ /orahome/app/19.0.0.0/grid/bin/olsnodes
oratargetserver1
oratargetserver2
On server 1:
[oracle@oratargetserver1 ~]$ ORACLE_BASE=/orahome/app/oracle
[oracle@oratargetserver1 ~]$ ORACLE_HOME=/orahome/app/oracle/product/12.1.0/dbhome_5
[oracle@oratargetserver1 ~]$ THISNODE='oratargetserver1'
[oracle@oratargetserver1 ~]$ cd $ORACLE_HOME/clone
[oracle@oratargetserver1 clone]$ E01=ORACLE_HOME=/orahome/app/oracle/product/12.1.0/dbhome_5
[oracle@oratargetserver1 clone]$ E02=ORACLE_HOME_NAME=OraDB12Home
[oracle@oratargetserver1 clone]$ E03=ORACLE_BASE=/orahome/app/oracle
[oracle@oratargetserver1 clone]$ C01="-O CLUSTER_NODES={oratargetserver1,oratargetserver2}"
[oracle@oratargetserver1 clone]$ C02="-O LOCAL_NODE=$THISNODE"
[oracle@oratargetserver1 clone]$ perl $ORACLE_HOME/clone/bin/clone.pl $E01 $E02 $E03 $C01 $C02
On server 2:
[oracle@oratargetserver2 ~]$ ORACLE_BASE=/orahome/app/oracle
[oracle@oratargetserver2 ~]$ ORACLE_HOME=/orahome/app/oracle/product/12.1.0/dbhome_5
[oracle@oratargetserver2 ~]$ THISNODE='oratargetserver2'
[oracle@oratargetserver2 ~]$ cd $ORACLE_HOME/clone
[oracle@oratargetserver2 clone]$ E01=ORACLE_HOME=/orahome/app/oracle/product/12.1.0/dbhome_5
[oracle@oratargetserver2 clone]$ E02=ORACLE_HOME_NAME=OraDB12Home
[oracle@oratargetserver2 clone]$ E03=ORACLE_BASE=/orahome/app/oracle
[oracle@oratargetserver2 clone]$ C01="-O CLUSTER_NODES={oratargetserver1,oratargetserver2}"
[oracle@oratargetserver2 clone]$ C02="-O LOCAL_NODE=$THISNODE"
[oracle@oratargetserver2 clone]$ perl $ORACLE_HOME/clone/bin/clone.pl $E01 $E02 $E03 $C01 $C02
Run root.sh on both nodes.
[root@oratargetserver1 /]# /orahome/app/oracle/product/12.1.0/dbhome_5/root.sh
[root@oratargetserver2 /]# /orahome/app/oracle/product/12.1.0/dbhome_5/root.sh
Conclusion :
Cloning an Oracle Database Home is a practical and reliable solution when reinstalling is not possible especially in environments running legacy Oracle versions with numerous one-off patches. As demonstrated, Oracle Home cloning works successfully in both directions: RAC to Single Instance and Single Instance to RAC, as long as inventory configuration, OS dependencies, and relinking steps are handled carefully.
Hope it helps.


Leave your comment