Question: I need to know how clone
my ORACLE_HOME directory. Is there a checklist for
cloning my Oracle home?
Answer: Cloning the Oracle Home is
done through simple tools: cp if you are cloning on the same
server, tar (or other tools) and scp to go to a new server,
and the vanilla runinstaller package from Oracle
conveniently located in $ORACLE_HOME/oui/bin.
[oracle@orahost ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1
[oracle@orahost ~]$ cd /u01/app/oracle/product/11.2.0
[oracle@orahost 11.2.0]$ cp -rp db_1 db_2
cp: cannot open `db_1/bin/nmhs' for reading: Permission denied
cp: cannot open `db_1/bin/nmb' for reading: Permission denied
cp: cannot open `db_1/bin/nmo' for reading: Permission denied
In the steps above, we copied the ORACLE_HOME located at
/u01/app/oracle/product/11.2.0/db_1 to another directory (/u01/app/oracle/product/11.2.0/db_2).
If you use the cp command, make sure you use the -rp flags;
-r copies directories recursively, and -p preserves file
attributes. You may also notice that a few files could not
be copied. Don't worry about these, when we run the
installer it will take care of that.
Once the copy (or tar/untar between servers) is complete,
the rest is simple. We will run the runInstaller command in
the new Oracle Home and provide the information it requires.
This is done silently, so no X Windows server is required at
all.
[oracle@orahost 11.2.0]$ cd db_2/oui/bin
[oracle@orahost bin]$ ./runInstaller -silent -clone ORACLE_BASE="/u01/app/oracle" ORACLE_HOME="/u01/app/oracle/product/11.2.0/db_2" ORACLE_HOME_NAME="OraHome2"
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 3960 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-03-12_09-46-15AM. Please wait ...[oracle@orahost bin]$ Oracle Universal Installer, Version 11.2.0.1.0 Production
Copyright (C) 1999, 2015, Oracle. All rights reserved.
You can find the log of this install session at:
/u01/app/oraInventory/logs/cloneActions2013-03-12_09-46-15AM.log
.................................................................................................... 100% Done.
Installation in progress (Tuesday, March 12, 2013 9:46:35 AM EDT)
............................................................................. 77% Done.
Install successful
Linking in progress (Tuesday, March 12, 2013 9:46:43 AM EDT)
Link successful
Setup in progress (Tuesday, March 12, 2013 9:48:14 AM EDT)
Setup successful
End of install phases.(Tuesday, March 12, 2013 9:50:31 AM EDT)
WARNING:
The following configuration scripts need to be executed as the "root" user.
/u01/app/oracle/product/11.2.0/db_2/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
The cloning of OraHome2 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2013-03-12_09-46-15AM.log' for more details.
The actual command we used was:
./runInstaller -silent -clone
ORACLE_BASE="/u01/app/oracle"
ORACLE_HOME="/u01/app/oracle/product/11.2.0/db_2″
ORACLE_HOME_NAME="OraHome2″
These flags defined:
- -silent: specifies that the command should be done
without interaction
- -clone: specifies that the home is a clone of
another location
- ORACLE_BASE: the base directory for Oracle products
as per the
OFA
- ORACLE_HOME: the new directory location
- ORACLE_HOME_NAME: a unique name for the Oracle Home
for the server you have cloned to
Once you have finished running the command and have
confirmed success, the standard root.sh (and orainstRoot.sh
if this is the first Oracle install on the server) execution
by the root user applies.