Cloning an Oracle AI Database Home Using clone.pl
Learn how to clone an Oracle home using the clone.pl script.
Note:
- This procedure using the
clone.plscript is deprecated starting Oracle Database 19c and can be removed in a future release. Hence, Oracle recommends that you use the software-only installation option, available in the database installer, instead ofclone.plto clone your database. - During cloning, Oracle Universal Installer (OUI) prompts you to run scripts that require
rootprivileges.
- Verify that the installation of Oracle AI Database that you want clone is successful.
You can do this by reviewing the
installActionsdate_time.logfile for the installation session, which is typically located in the/u01/app/oracle/oraInventory/logsdirectory.If you install patches, then check their status using the following:
$ cd $ORACLE_HOME/OPatchInclude
$ORACLE_HOME/OPatchin$PATH$ opatch lsinventoryThe use of OPatch and OPatchAuto for out-of-place patching continues to be deprecated.
- 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/23.0.0/dbhome_1, then you zip thedbhome_1directory by using the following command:# zip -r dbhome_1.zip /u01/app/oracle/product/23.0.0/dbhome_1You can also use the TAR command. For example:
# tar -cvf dbhome_1.tar /u01/app/oracle/product/23.0.0/dbhome_1Do not include the
admin,fast_recovery_area, andoradatadirectories 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.tarIf necessary, change the ownership of the Oracle AI Database home to the Oracle AI Database installation owner user (
oracle) belonging to the Oracle Inventory group (oinstall).# chown -R oracle:oinstall /u01/app/oracle/product/23.0.0/dbhome_1On the target computer, change the directory to the unzipped Oracle base home directory, and remove all the
.ora(*.ora) files present in the unzippedORACLE_BASE_HOME/network/admindirectory.To print the ORACLE_BASE_HOME path, run:
$ setenv ORACLE_HOME /u01/app/oracle/product/23.0.0/dbhome_1 $ cd $ORACLE_HOME/bin $ ./orabasehomeDelete unnecessary files from the unzipped Oracle base home directory.
The unzipped Oracle base 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 base home directory:
Remove the
.orafiles from theORACLE_HOME/network/admindirectory, and remove the old database entries from theORACLE_HOME/dbsdirectory.# cd /u01/app/oracle/product/23.0.0/dbhome_1/ # rm -rf network/admin/*.ora # rm dbs/old_database_entries- From the
$ORACLE_HOME/clone/bindirectory, run theclone.plfile for the unzipped Oracle home.Use the following syntax (you can also include one or more of the extended Oracle AI Database groups in the syntax):
$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_BASE="target_oracle_base" ORACLE_HOME="target_oracle_home" OSDBA_GROUP=OSDBA_privileged_group OSOPER_GROUP=OSOPER_privileged_group OSBACKUPDBA_GROUP=OSBACKUPDBA_privileged_group OSDGDBA_GROUP=OSDGDBA_privileged_group OSKMDBA_GROUP=OSKMDBA_privileged_group OSRACDBA_GROUP=OSRACDBA_privileged_group-defaultHomeNameExample:
$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_BASE="/u01/app/oracle" ORACLE_HOME="/u01/app/oracle/product/23.0.0/dbhome_1" OSDBA_GROUP=dba OSOPER_GROUP=oper OSBACKUPDBA_GROUP=backupdba OSDGDBA_GROUP=dgdba OSKMDBA_GROUP=kmdba OSRACDBA_GROUP=racdba -defaultHomeNameNote:
- 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. - Run the
$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/clone/bin/clone.pl -helpcommand for more information about the command option flags.
OUI starts, and then records the cloning actions in the
cloneActionstimestamp.logfile. This log file is typically located in/u01/app/oracle/oraInventory/logsdirectory. - In this command, if you do not provide the parameters for the operating system groups, then
Use the following commands to run Oracle Net Configuration Assistant to configure the connection information for the new database:
$ cd $ORACLE_HOME/bin $ ./netcaUse the following commands to run Oracle Database Configuration Assistant to create a new Oracle AI Database for the newly-cloned oracle home:
$ cd $ORACLE_HOME/bin $ ./dbca
Related Topics