Oracle Clone
To Different Server
On source system (as 'root')...
export ORACLE_HOME=/u01/app/oracle/product/121020
cd $ORACLE_HOME
gtar -czvf /u01/out/OraHomeClone.tgz .
Transfer zip file to target system (/u01/in).
On target system (as 'root')...
export ORACLE_HOME=/u01/app/oracle/product/121020
mkdir -p $ORACLE_HOME
cd $ORACLE_HOME
gtar -xzvf /u01/in/OraHomeClone.tgz
On target system as 'oracle'...
export ORACLE_HOME=/u01/app/oracle/product/121020
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME_NAME=OraDB12Home
cd $ORACLE_HOME/oui/bin
./runInstaller -clone -silent -ignorePrereq \
ORACLE_HOME=$ORACLE_HOME \
ORACLE_HOME_NAME=$ORACLE_HOME_NAME \
ORACLE_BASE=$ORACLE_BASE
On target system (as 'root')... Run root.sh as prompted.
Update entries in these directories to reflect the new server...
$ORACLE_HOME/network/admin
$ORACLE_HOME/mgw/admin
$ORACLE_HOME/dbs
To Same Server
As 'oracle'...
export ORACLE_HOME_ORIG=/u01/app/oracle/product/12.1.0.2
export ORACLE_HOME_CLONE=/u01/app/oracle/product/12.1.0.2CLONE
mkdir $ORACLE_HOME_CLONE
cd $ORACLE_HOME_ORIG
tar cvfp - . -exclude=*.log -exclude=*.trc | ( cd $ORACLE_HOME_CLONE; tar xvf - )
$ORACLE_HOME_ORIG/oui/bin/runInstaller -clone -silent -noconfig -defaultHomeName \
ORACLE_BASE=$ORACLE_BASE \
ORACLE_HOME=$ORACLE_HOME_CLONE \
oracle_install_OSDBA=dba \
oracle_install_OSOPER=oper
As 'root'...
export ORACLE_HOME_CLONE=/u01/app/oracle/product/12.1.0.2CLONE
$ORACLE_HOME_CLONE/root.sh
Bibliography
https://support.oracle.comMaster Note For Cloning Oracle Database Server ORACLE_HOME's Using the Oracle Universal Installer (OUI) (Doc ID 1154613.1)How to Clone an Existing RDBMS / Client Installation Using OUI (Doc ID 300062.1)
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/axdbi/cloning-oracle-database.html