In this Document
| Purpose |
| Questions and Answers |
| What is cloning and how does it work? |
| What are the different phases of cloning? |
| Why is cloning required? |
| Advantages and disadvantages of cloning? |
| Where to find the cloning log files? |
| Is cloning faster than the actual installation? |
| Is it required to copy the Central Inventory for cloning the Oracle Home? |
| Do you need Perl in your environment for cloning to work? |
| What is the difference between cloning and copying an Oracle Home ? |
| What are the different options available for clone.pl ? |
| What are the mandatory parameters for cloning (clone.pl)? |
| Why do you require cloner stage patches for 9.2? |
| Can you use jar utility for archiving and compressing the Oracle Home ? |
| Do the source and the destination path (of the Oracle Home to be cloned) need to be the same ? |
| Are the changes made by applying one-off patches on the source Oracle Home also present after the clone operation? |
| Can you use the cloned Oracle Home as the source for another cloning operation ? |
| Does the size of the binaries at the source and the destination differ ? |
| Is it necessary to shutdown database(s) and stop all processes running out of the Oracle Home before copying it for cloning? |
| What is the significance of the inventory pointer file (oraInst.loc) while cloning? |
| Can you clone the Oracle Home across platforms? |
| Can you clone with a different operating system user and group? |
| What is the difference between attachhome and cloning? |
| Is the preparation phase ($ORACLE_HOME/clone/bin/prepare_clone.pl) required for Database and CRS Oracle Home cloning ? |
| What is the $ORACLE_HOME/clone/config/cs.properties file used for ? |
| Is it required to run root.sh after cloning? |
| The following error(s) occurred when doing a cloning . What is the reason/solution ? |
| References |
Applies to:
Oracle Server - Enterprise Edition - Version 9.2.0.1 and later
Information in this document applies to any platform.
***Checked for relevance on 7-FEB-2010 ***
***Checked for relevance on 18-JUL-2012 ***
Purpose
This note explains about the frequently asked questions related to cloning RDBMS Oracle Home using OUI.
Questions and Answers
What is cloning and how does it work?
- Cloning is the process of copying an existing Oracle installation to a different location and updating the copied Oracle Home to work in the new environment.
- During cloning, OUI replays the actions that were performed during the actual installation of the home.
- Cloning is similar to installation except that OUI runs the actions in a special mode that is referred to as clone mode.
What are the different phases of cloning?
The cloning process has two phases:
1. Source Preparation Phase
- During this phase, prepare_clone.pl parses files in the source Oracle Home to extract and store the required values.
- At the source, run a script called prepare_clone.pl.
- This is a Perl script that prepares the source for cloning by recording the information required for cloning.
- This script is generally found in the following location:
$ORACLE_HOME/clone/bin/prepare_clone.pl
NOTE: The need to perform the preparation phase depends on the Oracle product you are installing. This script needs to be executed only for the Application Server Cloning. Database and CRS Oracle Home cloning do not require this. - Archive and compress the source Oracle Home using your preferred archiving tool.
For example:
You can use WinZip on Microsoft Windows system computers and tar or gzip on UNIX. Make sure that the tool that you use preserves the permissions and file timestamps. - When archiving the home, also ensure that you skip the *.log, *.dbf, listener.ora, sqlnet.ora, and tnsnames.ora for archiving.
2. Cloning Phase
- On the destination system, you unarchive the Oracle Home and run the clone.pl script.
- This Perl script performs all parts of the cloning operation automatically by running OUI and various other utilities.
- This script uses the cloning functionality in OUI. When you run the clone.pl script, it handles the specifics that OUI may have missed.
- The Central Inventory of the box where the home is being cloned is
updated as is the Oracle Home inventory ($ORACLE_HOME/inventory).
Note: The cloned home and source home will not be identical in size, because the cloned home will have additional files created during the cloning operation.
Why is cloning required?
Cloning is required when you want to deploy multiple Oracle Home(s) from an existing Oracle Home.
Advantages and disadvantages of cloning?
Advantages
- Creating an installation that is a copy of a production, test, or development installation.
- Cloning enables you to create a new installation with all patches applied to it in a single step. This contrasts with going through the installation process by performing separate steps to install, configure, and patch the installation.
- Rapidly deploying an instance and the applications that it hosts.
- Preparing an Oracle Home and deploying it to many hosts.
- You can also customize various aspects of cloning, for example, to specify custom port assignments, or to preserve custom settings.
Disadvantages
- The cloning process copies all of the files from the source Oracle Home to the
destination Oracle Home. Thus, any files used by the source instance located outside
the source Oracle Home's directory structure are not copied to the destination location. - Cloning is not possible across platforms
Where to find the cloning log files?
All the logs can be found in <Central_Inventory>/logs folder and <ORACLE_HOME>/clone/logs.
For more detailed information refer the Note 403212.1 (Location Of Logs For Patch And OUI) which contains detailed information about the location of the log files for each command.
Is cloning faster than the actual installation?
Yes, cloning is much faster than the actual installation. When cloning a source Oracle Home, all source home patches and settings are seamlessly cloned to the new home. Cloning is much faster than manually creating new homes and applying all source home patches and settings.
Is it required to copy the Central Inventory for cloning the Oracle Home?
Copying Central Inventory is not required because:
- If it is not the first Oracle Home on the target Server:
Cloning will update the central inventory with the information regarding the new home. - If it is the first oracle home on the target Server:
Cloning will create a central inventory with the information regarding the new home.
Do you need Perl in your environment for cloning to work?
Yes, Perl is required. Since cloning is done using the clone.pl script, which is a Perl script.
NOTE : Perl 5.6 or higher is required for cloning and should be set in the environment.
What is the difference between cloning and copying an Oracle Home ?
- Cloning re-plays all the actions that were performed during the installation of the Oracle Home like relinking, updating the inventory, etc., and hence the cloned home can be patched using OPatch, patchsets can be installed to it, etc., other than extracting files from the software kit.
- By copying the Oracle Home from one server to another, all the above mentioned actions are not performed and also it is not possible to apply patches or patchsets to copied Oracle Home.
- Simply copying the Oracle Home is not supported.
- If the Oracle Home has to be deployed to multiple destinations with the same configuration, cloning is the only supported method.
What are the different options available for clone.pl ?
-O : If you use this argument, anything following
it is passed to the OUI clone command line. For example, you can use
this option to pass the location of the oraparam.ini file to be used by
OUI:
Eg: -O -paramFile C:\OraHome_1\oui\oraparam.ini
-debug : If you use this argument, the script runs in debug mode.
-help : If you use this argument, the script prints the help for the clone script.
What are the mandatory parameters for cloning (clone.pl)?
ORACLE_HOME_NAME="<Oracle_Home_Name for the Oracle_Home being cloned>"
ORACLE_BASE="<Path _to _the _Oracle_Base>" (Only applicable to 11g)
Eg:
Windows :
perl <Oracle_Home>\clone\bin\clone.pl ORACLE_HOME="C:\u01\app\product\oracle\clone_home" ORACLE_HOME_NAME="CLONE"Linux-based and UNIX-based systems:
perl <Oracle_Home>/clone/bin/clone.pl ORACLE_HOME="/u01/app/product/oracle/clone_home" ORACLE_HOME_NAME="CLONE"
Why do you require cloner stage patches for 9.2?
Cloner stage patches are required while cloning 9iR2 installations because in 9iR2 certain products were installed outside the Oracle Home, for example, oui, jre etc., as opposed to 10g where everything is installed inside the Oracle Home.
Can you use jar utility for archiving and compressing the Oracle Home ?
Do not use the jar utility for archiving and compressing the Oracle Home, as this causes the file permissions to become lost.
Do the source and the destination path (of the Oracle Home to be cloned) need to be the same ?
The source and the destination path (of the Oracle Home to be cloned) need not be the same.
Are the changes made by applying one-off patches on the source Oracle Home also present after the clone operation?
Yes, all the changes made by applying one-off patches on the source Oracle Home are also present after the clone operation.
Can you use the cloned Oracle Home as the source for another cloning operation ?
Yes, you can also use the cloned Oracle Home as the source for another cloning operation. The cloned installation behaves the same as the source installation. For example, the cloned Oracle Home can be removed using OUI or patched using OPatch.
Does the size of the binaries at the source and the destination differ ?
Yes, the size of the binaries at the source and the destination may differ because these are relinked as part of the clone operation, and the operating system patch levels may also differ between these two source and destination servers. Additionally, the number of files in the cloned home would increase because several files copied from the source, specifically those being instantiated, are backed up as part of the clone operation.
Is it necessary to shutdown database(s) and stop all processes running out of the Oracle Home before copying it for cloning?
Yes, it is recommended that the database(s), listeners and any processes in the source home are shutdown so that we have a clean backup of the installation to create the target home.
What is the significance of the inventory pointer file (oraInst.loc) while cloning?
If the oraInst.loc file is present in a non-default location (default
location is /var/opt/oracle/oraInst.loc or /etc/oraInst.loc) then edit
the cs.properties file and add the following to the clone_command_line
and preclone_command_line:
-ignoreSysPrereqs -invPtrLoc <path_to_oraInst.loc>/oraInst.loc
Can you clone the Oracle Home across platforms?
No, cloning across platforms is not possible because the binaries across platforms are different
Eg : Binary for Solaris cannot be used on Linux.
Can you clone with a different operating system user and group?
Yes, you can clone with a different operating system user and group.
Refer Metalink Note 558478.1 Cloning A Database Home And Changing The User/Group That Owns It
What is the difference between attachhome and cloning?
During cloning OUI replays the actions that are performed during the actual installation of the home, whereas attachhome attaches an Oracle Home to the Central Inventory or to register an existing Oracle Home with the Central Inventory when it is lost or corrupted.
Is the preparation phase ($ORACLE_HOME/clone/bin/prepare_clone.pl) required for Database and CRS Oracle Home cloning ?
No, database and CRS Oracle Home cloning does not require the script ($ORACLE_HOME/clone/bin/prepare_clone.pl) during preparation phase.
What is the $ORACLE_HOME/clone/config/cs.properties file used for ?
$ORACLE_HOME/clone/config/cs.properties file can be used for passing values in the command line to OUI for cloning.
You can enter values in the line
clone_command_line=<value>.The values entered here are appended to the OUI command line, which
is run to perform the clone operation. For example, to specify a
non-default location for the Oracle Inventory file on
UNIX system computers, you can add the following line to the cs.properties file:
clone_command_line= -invptrloc /private/oracle/oraInst.locNote: To specify multiple arguements, separate each arguement with a space.
Is it required to run root.sh after cloning?
Yes, on UNIX/Linux installations, after the cloning operation is completed, it is mandatory to run root.sh (as root) in the cloned Oracle Home.
The following error(s) occurred when doing a cloning . What is the reason/solution ?
Values for the following variables could not be obtained from the command line or response file(s):
ORACLE_BASE
Cloning cannot continue
Reason: ORACLE_BASE is a mandatory variable for 11g cloning. As the variable ORACLE_BASE is not set, OUI throws the above error.
Solution:
Option 1: Specify the variable when invoking the OUI or clone.pl.
perl <Oracle_Home>\clone\bin\clone.pl ORACLE_HOME="<Path to the
Oracle_Home being_cloned>" ORACLE_HOME_NAME="<Oracle_Home_Name
for the Oracle_Home being cloned>" ORACLE_BASE="<Path to the
Oracle_Base>"
setup.exe -clone -silent -noconfig ORACLE_HOME="<Path to the
Oracle_Home being_cloned>" ORACLE_HOME_NAME="<Oracle_Home_Name for
the Oracle_Home being cloned>" ORACLE_BASE="<Path to the
Oracle_Base>"
./runInstaller -clone -silent -noconfig ORACLE_HOME="<Path to the
Oracle_Home being_cloned>" ORACLE_HOME_NAME="<Oracle_Home_Name for
the Oracle_Home being cloned>" ORACLE_BASE="<Path to the
Oracle_Base>"
For more details On ORACLE_BASE in 11g :
Refer Metalink Note 454442.1 11g Install : Understanding about Oracle Base, Oracle Home and Oracle Inventory locations
Option 2: Set the variable ORACLE_BASE in the environment:
set ORACLE_BASE=<Path to the Oracle_Base> ( Windows )
export ORACLE_BASE=<Path to the Oracle_Base> ( Unix )
Then restart the cloning
The home at <ORACLE_HOME_path>is invalid or corrupt. Unable to continue cloning
Reason: The target ORACLE_HOME variable supplied/passed for cloning
Solution: Pass a valid target ORACLE_HOME variable for cloning
ERROR: Values for the following variables could not be obtained from the command line or response file(s):
ORACLE_HOME_NAME
Cloning cannot continue
Reason: The mandatory variables required (passed) for cloning are:
ORACLE_HOME
ORACLE_HOME_NAME
If any of the above variables are not passed, then OUI throws the above error.
Solution: Pass the mandatory variables ORACLE_HOME & ORACLE_HOME_NAME
(In 11g ORACLE_BASE is also mandatory)
Eg:
./runInstaller -clone -silent -noconfig ORACLE_HOME="<Path to the
Oracle_Home being_cloned>" ORACLE_HOME_NAME="<Oracle_Home_Name for
the Oracle_Home being cloned>"
OUI-10198: Unable to create a new Oracle Home with name <home_name>. An Oracle Home with this name already exists. Please select another name.
SEVERE:OUI-10198: Unable to create a new Oracle Home with name <home_name>. An Oracle Home with this name already exists. Please select another name.
java.io.IOException: OUI-10198: Unable to create a new Oracle Home with name <home_name>. An Oracle Home with this name already exists. Please select another name.
Reason:
The ORACLE_HOME_NAME is the name of the Oracle Home directory in which
Oracle products are installed. This should be unique in a server/node.
Cloning requires an ORACLE_HOME_NAME (for the new Oracle Home) which is not present in the server already.
The above error mentions that the value of the variable passed by the ORACLE_HOME_NAME is already existing on the server.
Solution: Specify another ORACLE_HOME_NAME which is not present already.
The ORACLE_HOME_NAME can be found in the file patch to central inventory/ContentsXML/inventory.xml
Windows : "C:\Program Files\Oracle\Inventory\ContentsXML\inventory.xml ( by default)
Unix : Locate the oraInst.loc file (/var/opt/oracle or /etc) and hence the location of Central Inventory
For example the entry will be :
<HOME NAME="OraDb10g_home1" LOC="D:\10GR2\db_1" TYPE="O" IDX="1" />
Here ORACLE_HOME_NAME will be OraDb10g_home1References
NOTE:300062.1 - How To Clone An Existing RDBMS Installation Using OUI
NOTE:403212.1 - Location Of Logs For Opatch And OUI
NOTE:454442.1 - 11g Install : Understanding about Oracle Base, Oracle Home and Oracle Central/Global Inventory locations
NOTE:558478.1 - Cloning A Database Home And Changing The User/Group That Owns It
浙公网安备 33010602011771号