Follow these steps to clone an Oracle home.
Note:During cloning, Oracle Universal Installer (OUI) prompts you to run scripts that require root privileges.
- Verify that the installation of Oracle Database to clone is successful.
You can do this by reviewing the
installActionsdate_time.logfile for the installation session, which is typically located in the
If you install patches, then check their status using the following:
$ cd $ORACLE_HOME/OPatch
$ opatch lsinventory
- Stop all processes related to the Oracle home.
- Create a ZIP or TAR file with the Oracle home (but not the Oracle base) directory.
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_1directory 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
oradatadirectories that are under the Oracle base directory. These directories are created in the target installation later, when you create a new database there.
- Copy the ZIP or TAR file to the root directory of the target computer. If you use File Transfer Protocol (FTP), then transfer the ZIP or TAR file in binary mode only.
- Extract the ZIP or TAR file content using the following command:
# unzip -d / dbhome_1.zip # tar -xvf dbhome_1.tar
- On the target computer, change the directory to the unzipped Oracle home directory, and remove all the
.ora) files present in the unzipped
- Delete unnecessary files from the unzipped Oracle home 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:
.orafiles from the
network/admindirectory, and remove the old database entries from the
# cd $ORACLE_HOME # rm -rf network/admin/*.ora # rm dbs/old_database_entries
- From the
$ORACLE_HOME/clone/bindirectory, run the
clone.plfile 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.pl
$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
OUI starts, and then records the cloning actions in the
In this command, if you do not provide the parameters for the operating system groups, then
clone.pluses the operating system group values from the source home.
$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/clone/bin/clone.pl -helpcommand for more information about the command option flags.
cloneActionstimestamp.logfile. This log file is typically located in
- Use the following commands to run Net Configuration Assistant to configure the connection information for the new database:
$ cd $ORACLE_HOME/bin $ ./netca
- Use the following commands to run Database Configuration Assistant to create a new Oracle Database for the newly-cloned oracle home:
$ cd $ORACLE_HOME/bin $ ./dbca