Skip Headers
Oracle® Universal Installer and OPatch User's Guide
10g Release 2 (10.2) for Windows and UNIX

Part Number B16227-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

7 Oracle Software Cloning Using Oracle Universal Installer

This chapter provides information on Oracle Cloning using Oracle Universal Installer.

This chapter is organized into the following sections:

7.1 About Cloning

Cloning is the process of copying an existing installation to a different location while preserving its configuration. The source and the destination path (host to be cloned) need not be the same. During cloning, Oracle Universal Installer replays all actions that have been executed to install the home. It is very similar to installation except that Oracle Universal Installer will run the actions in a special mode called the clone mode.

Some situations in which cloning is useful are:

The cloned installation behaves the same as the source installation. For example, the cloned instance can be removed using Oracle Universal Installer or patched using OPatch. It can also be used as the source for another cloning operation. You can create a cloned copy of a test, development, or production installation by using the command-line cloning scripts. The default cloning procedure is adequate for most usage cases. However, you can also customize various aspects of the cloning process, for example, to specify custom port assignments, or preserve custom settings.

The cloning process works by copying all files from the source Oracle home to the destination Oracle home. Hence, any files used by the source instance that are located outside the source Oracle home's directory structure are not copied to the destination location.

The size of the binaries at the source and the destination may differ as these are relinked as a part of the clone operation and the operating system patch levels may also differ between these two locations. Additionally, the number of files in the cloned home would increase as several files copied from the source (specifically those being instantiated) are backed up as part of the clone operation.

Oracle Universal Installer Cloning is more beneficial over tarball approach as it sets up the Central Inventory and the Oracle home inventory in the cloned home and makes the home manageable and allows the paths in the cloned home and the target home to be different.

7.2 Overview of the Cloning Process

The cloning process makes use of the cloning functionality of Oracle Universal Installer. This operation is driven by a set of scripts and add-ons that are included in the respective Oracle software.

There are two phases in the cloning process:

7.2.1 Source Preparation Phase

To prepare the source Oracle home to be cloned, perform the following steps:

  • At the source, you run a script called prepare_clone.pl. This is a Perl script that prepares the source for cloning. It takes a snapshot of the information required for cloning. This is generally located in the following location:

    $ORACLE_HOME/clone/bin/prepare_clone.pl
    
    

    During this phase, prepare_clone.pl parses files in the source Oracle home to extract and store the required values. For more information on the parameters to be passed, refer to the respective product documentation.


    Note:

    This step is optional, and will depend on the Oracle product you are installing.

  • Archive and compress the source Oracle home, using your preferred tool for archiving. For example, you can use WinZip on Windows and tar and gzip on UNIX. Make sure that the tool you are using preserves the permissions and timestamps of the files. The following example shows how to archive and compress the source on UNIX.

    cd Source_Oracle_Home
    tar cf - * | gzip > oracleas.tar.gz
    

    Note:

    You should not use the jar utility to archive and compress the Oracle home.

7.2.2 Cloning Phase

At the destination, you unarchive the Oracle home. Then, execute clone.pl. This is a Perl script that performs all parts of the cloning operation automatically, calling Oracle Universal Installer and various other utilities, as needed. This script makes use of the cloning functionality in Oracle Universal Installer. When you invoke the clone.pl script, it takes care of the specifics that Oracle Universal Installer may have missed. The Central Inventory of the box where the home is being cloned is updated. Also the Oracle home inventory ($ORACLE_HOME/inventory) is updated. You need Perl 5.6 or higher for cloning. Also ensure that you set the path environment variable to the correct perl executable.


Note:

The cloned home and source home will not be identical in size, as the cloned home will have additional files created during the cloning operation.

7.3 Locating and Viewing Log Files

The cloning script invokes multiple tools, each of which may generate its own log files. However, the following log files, which are generated by Oracle Universal Installer and the cloning scripts, are the key ones of interest for diagnostic purposes:

To find the location of the Oracle inventory directory:On UNIX systems, look in /var/opt/oracle/oraInst.loc and on Linux systems, look in /etc/oraInst.loc.

On Windows systems, the location can be obtained from the registry key: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\INST_LOC.

After the clone.pl script finishes running, consult these log files to get more information about the cloning process.

7.4 Cloning an Oracle Database 10.2 Oracle Home

There are two steps involved in cloning an Oracle Database 10.2 Oracle home:

7.4.1 Preparing the Oracle Database 10.2 Source

To prepare the source Oracle home to be cloned, perform the following steps:

  • Archive and compress the source Oracle home, using your preferred tool for archiving. For example, you can use WinZip on Windows and tar and gzip on UNIX. Make sure that the tool you are using preserves the permissions and timestamps of the files. When archiving the home ensure that you skip the *.log, *.dbf, listerner.ora, sqlnet.ora, and tnsnames.ora from archiving. Also ensure that you do not archive the following folders:

    $ORACLE_HOME/<Hostname>_<SID>
    $ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_<Hostname>_<SID>
    
    

    The following example shows how to archive and compress the source on UNIX.

    cd $ORACLE_HOME
    tar cpfX - <exclude_file_list>
    

    Note:

    Do not use the jar utility to archive and compress Oracle home.

7.4.2 Cloning the Oracle Database 10.2

At the destination, you unarchive the Oracle home. Then, execute clone.pl. This is a Perl script that performs all parts of the cloning operation automatically, calling various other utilities and Oracle Universal Installer, as needed. This script makes use of the cloning functionality in Oracle Universal Installer. This script is located in $ORACLE_HOME/clone/bin directory.


Note:

The clone.pl script clones the software only and not the database instance.

The following command shows the syntax for clone.pl script:

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> 
[-command_line_arguments]

The preceding command uses the <command_line_arguments> variable. The following table describes the same:

Table 7-1 Command-line arguments in clone.pl script

Command-line Argument Description
-O If you use this argument, then anything following it is passed to the Oracle Universal Installer clone command line. For example, you can use this option to pass the location of the oraparam.ini file to be used by Oracle Universal Installer:
-O -paramFile C:\OraHome_1\oui\oraparam.ini
-debug If you use this argument, then the script is run in debug mode.
-help If you use this argument, then the script prints the help for the clone script.

You can also pass values in the command line by using the $ORACLE_HOME/clone/config/cs.properties file. You can enter values in the line clone_command_line=<value>. The values entered here are appended to the Oracle Universal Installer command line, which is invoked to perform the clone operation.

For example, to specify a non default location for the Oracle inventory file on UNIX, you can add the following line to the cs.properties file:

clone_command_line= -invptrloc /private/oracle/oraInst.loc

Note:

To specify multiple arguments, separate each argument with a space.

After the clone operation is complete you may execute the Net Configuration Assistant and the Database Configuration Assistant. You can basically do all operations on the cloned home as would be possible at the source.

7.4.2.1 Viewing Log and Error Files

After cloning, you can view the status of the clone operation by navigating to the $ORACLE_HOME/clone/log directory and by reviewing the *.log and *.err files. For more information, refer to the section "Locating and Viewing Log Files".

7.5 Cloning Real Application Clusters

The following section lists the process for cloning the nodes of a Real Application Clusters with an example.


Note:

Real Application Clusters Cloning can only be performed in silent mode.

Consider a scenario where there are three nodes — A, B, and C. You want to clone a Real Application Clusters home on node A to node B and node C. The nodes B and C should be the members of the cluster. To do this, perform the following steps:

  1. Archive the Real Application Clusters home from node A and copy it to node B and node C. ($ORACLE_HOME)

  2. Unarchive the home on the nodes B and C. In case of shared home, unarchive the home only once on either of the nodes.

  3. On nodes B and C go to $ORACLE_HOME/oui/bin and execute the following command:

    For UNIX
    
    perl clone.pl ORACLE_HOME=<Path to the Oracle_Home being cloned> ORACLE_HOME
    _NAME=<Oracle_Home_Name for the Oracle_Home being cloned> '-O"CLUSTER_
    NODES={<node B>,<node C>}"' '-OLOCAL_NODE=node_B"
    
    For Windows
    
    perl clone.pl ORACLE_HOME=<Path to the Oracle_Home being cloned> ORACLE_HOME
    _NAME=<Oracle_Home_Name for the Oracle_Home being cloned> '-O"CLUSTER_
    NODES={<node B>,<node C>}"' '-OLOCAL_NODE=node_B"
    

    Note:

    Set the LOCAL_NODE to the node on which you execute the runInstaller command.

  4. For UNIX, perform the following additional steps:

    • On node B, go to $ORACLE_HOME and run root.sh. Repeat this step on node C.On node B, set the environment variable to ORACLE_HOME. Also add $ORACLE_HOME/lib to LD_LIBRARY_PATH.

  5. Run Net Configuration Assistant on node B.

  6. Run Database Configuration Assistant on node B.

7.5.1 Important Considerations when Cloning Real Application Clusters

When cloning for Real Application Clusters, the following points should be noted:

  • The order of nodes specified should always be the same on all hosts.

  • Oracle Clusterware should be installed on the cluster nodes prior to starting Real Application Clusters installation.

  • The nodes for Real Application Clusters installation would be a subset of the nodes for Oracle Clusterware installation.

  • For a shared home you need to also pass -cfs parameter on the command line.

7.6 Cloning Oracle Clusterware

The following section lists the process for cloning the nodes of an Oracle Clusterware with an example.


Note:

Oracle Clusterware Cloning can only be performed in silent mode.

Consider a scenario where there are three nodes — A, B, and C. You want to clone an Oracle Clusterware home on node A to node B and node C such that the member nodes of the new cluster are node B and node C. To do this, perform the following steps:

  1. Archive the Oracle Clusterware home from node A and copy it to node B and node C. ($CRS_HOME)

  2. Unarchive the home on the nodes B and C. In case of shared home, unarchive the home only once on either of the nodes.

  3. On nodes B and C go to $CRS_HOME/oui/bin and execute the following command:

    For UNIX
    
    perl clone.pl ORACLE_HOME=<Path to the Oracle_Home being cloned> ORACLE_HOME_
    NAME=<Oracle_Home_Name for the Oracle_Home being cloned> '-On_
    storageTypeVDSK=2' '-On_storageTypeOCR=2' '-O"sl_tableList={node_B:node_B_
    priv:node_B-vip, node_C:node_C_priv:node_C-vip}"' 
    '-OINVENTORY_LOCATION=<central inventory location>'
    
    For Windows
    
    perl clone.pl ORACLE_HOME=<Path to the Oracle_Home being cloned> ORACLE_HOME_
    NAME=<Oracle_Home_Name for the Oracle_Home being cloned> '-On_
    storageTypeVDSK=2' '-On_storageTypeOCR=2' '-O"sl_tableList={node_B:node_B_
    priv:node_B-vip, node_C:node_C_priv:node_C-vip}"'
    
    
  4. On UNIX, navigate to the <central_inventory> directory and run orainstRoot.sh on the nodes B and C. This populates /etc/oraInst.loc with the location of the Central Inventory. On nodes B and C, go to $CRS_HOME and run root.sh. This will bring the Oracle Clusterware stack on node B. Repeat this step on node C.

  5. On node B, execute the following from $CRS_HOME/bin:

    For UNIX
    
    ./racgons add_config node B:<Remote_Port> node C:<Remote_Port>
    
    For Windows
    
    racgons add_config node B:<Remote_Port> node C:<Remote_Port>
    
    
  6. To get the remote port information, execute the following command from the $CRS_HOME/opmn/conf directory:

    For UNIX
    
    ./ons.config
    
    For Windows
    
    ons.config
    
    
  7. Execute the following command to get the interconnect information. You can use this information in the next step.

    For UNIX and Windows
    
    $CRS_HOME/bin/oifcfg iflist –p
    
    
  8. Execute oifcfg command as follows:

    For UNIX and Windows
    
    oifcfg setif -global <interface_name>/<subnet>:public <inteface_
    name>/<subnet>:cluster_interconnect [<interface_name>/<subnet>:public
     <inteface_name>/<subnet>:cluster_interconnect .......]
    

7.6.1 Important Considerations when Cloning Oracle Clusterware

When cloning for Oracle Clusterware, the following points should be noted:

  • You should have an existing home on the remote node and it should be writable.

  • You should have executed root.sh and should have run other configuration tools on the source node.

  • You can also use a response file instead of passing these parameters through the command line.

  • The tar operation need not be performed as root.

  • For a shared home you need to also pass -cfs parameter on the command line.

  • Never pass the CLUSTER_NODES and LOCAL_NODE parameters through the command line.