Follow these steps to clone an Oracle home.
Note:
During cloning, Oracle Universal Installer (OUI) prompts you to run scripts that require root privileges.You can do this by reviewing the installActionsdate_time.log
file for the installation session, which is typically located in the /u01/app/oracle/oraInventory/logs
directory.
If you install patches, then check their status using the following:
$ cd $ORACLE_HOME/OPatch
Include $ORACLE_HOME/OPatch
in $PATH
$ opatch lsinventory
For example, if the source Oracle installation is in the path /u01/app/oracle/product/12.2.0/dbhome_1
, then you zip the dbhome_1
directory by using the following command:
# zip -r dbhome_1.zip /u01/app/oracle/product/12.2.0/dbhome_1
You can also use the TAR command. For example:
# tar -cvf dbhome_1.tar /u01/app/oracle/product/12.2.0/dbhome_1
Do not include the admin
, fast_recovery_area
, and oradata
directories that are under the Oracle base directory. These directories are created in the target installation later, when you create a new database there.
# unzip -d / dbhome_1.zip # tar -xvf dbhome_1.tar
.ora
(*.ora
) files present in the unzipped $ORACLE_HOME/network/admin
directory.The unzipped Oracle home directory contains files that are relevant only to the source Oracle home. The following example shows how to remove these unnecessary files from the unzipped Oracle home directory:
Remove the .ora
files from the network/admin
directory, and remove the old database entries from the dbs
directory.
# cd $ORACLE_HOME
# rm -rf network/admin/*.ora
# rm dbs/old_database_entries
$ORACLE_HOME/clone/bin
directory, run the clone.pl
file for the unzipped Oracle home.
Use the following syntax (you can also include one or more of the extended Oracle Database groups in the syntax):
$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/clone/bin/clone.plORACLE_BASE
="target_oracle_base" ORACLE_HOME
="target_oracle_home" OSDBA_GROUP
=OSDBA_privileged_group OSOPER_GROUP
=OSOPER_privileged_group OSBACKUPDBA_GROUP
=OSBACKUPDBA_privileged_group OSRACDBA_GROUP
=OSRACDBA_privileged_group -defaultHomeName
For example:
$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_BASE="/u01/app/oracle/" ORACLE_HOME="/u01/app/oracle/product/12.2.0/dbhome_1" OSDBA_GROUP=dba OSOPER_GROUP=oper OSBACKUPDBA_GROUP=backupdba OSRACDBA_GROUP=racdba -defaultHomeName
Note:
In this command, if you do not provide the parameters for the operating system groups, then clone.pl
uses the operating system group values from the source home.
Run the $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/clone/bin/clone.pl -help
command for more information about the command option flags.
cloneActionstimestamp.log
file. This log file is typically located in /u01/app/oracle/oraInventory/logs
directory.$ cd $ORACLE_HOME/bin $ ./netca
$ cd $ORACLE_HOME/bin $ ./dbca