Oracle® Universal Installer and OPatch User's Guide 10g Release 2 (10.2) for Windows and UNIX Part Number B16227-01 |
|
|
View PDF |
This chapter provides information on Oracle Cloning using Oracle Universal Installer.
This chapter is organized into the following sections:
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:
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 is in contrast with going through the installation process by performing separate steps to install, configure, and patch the installation.
Rapidly deploying an instance and the applications it hosts.
Preparing an Oracle home and deploying it to many hosts.
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.
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:
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. |
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. |
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:
Central_Inventory/logs/cloneActions timestamp.log: Contains a detailed log of the actions that occur during the Oracle Universal Installer part of the cloning.
Central_Inventory/logs/oraInstall timestamp.err: Contains information about errors that occur when Oracle Universal Installer is running.
Central_Inventory/logs/oraInstall timestamp.out: Contains other miscellaneous messages generated by Oracle Universal Installer.
$ORACLE_HOME/clone/logs/clone timestamp.log: Contains a detailed log of the actions that occur during the pre-cloning and cloning operations.
$ORACLE_HOME/clone/logs/error timestamp.log: Contains information about errors that occur during the pre-cloning and cloning operations.
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.
There are two steps involved in cloning an Oracle Database 10.2 Oracle home:
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. |
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: Theclone.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.
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".
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:
Archive the Real Application Clusters home from node A and copy it to node B and node C. ($ORACLE_HOME
)
Unarchive the home on the nodes B and C. In case of shared home, unarchive the home only once on either of the nodes.
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 theLOCAL_NODE to the node on which you execute the runInstaller command. |
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
.
Run Net Configuration Assistant on node B.
Run Database Configuration Assistant on node B.
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.
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:
Archive the Oracle Clusterware home from node A and copy it to node B and node C. ($CRS_HOME
)
Unarchive the home on the nodes B and C. In case of shared home, unarchive the home only once on either of the nodes.
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}"'
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.
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>
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
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
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 .......]
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.