Skip Headers
Oracle® Real Application Clusters Administration and Deployment Guide
11g Release 2 (11.2)

Part Number E10718-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

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

6 Cloning Oracle RAC to Nodes in a Cluster

This chapter describes how to clone the grid infrastructure and Oracle Real Application Clusters (Oracle RAC) database homes on Linux and UNIX systems to nodes in a new cluster. To extend Oracle RAC to nodes in an existing cluster, see Chapter 8, "Using Cloning to Extend Oracle RAC to Nodes in the Same Cluster".

This chapter describes a noninteractive cloning technique that you implement through the use of scripts. The cloning techniques described in this chapter are best suited for performing multiple simultaneous cluster installations. Creating the scripts is a manual process and can be error prone. If you only have one cluster to install, then you should use the traditional automated and interactive installation methods, such as Oracle Universal Installer, or the Provisioning Pack feature of Oracle Enterprise Manager.

Note:

Cloning is not a replacement for Oracle Enterprise Manager cloning that is a part of the Provisioning Pack. During Oracle Enterprise Manager cloning, the provisioning process interactively asks you the details about the Oracle home (such as the location to which you want to deploy the clone, the name of the Oracle Database home, a list of the nodes in the cluster, and so on).

The Provisioning Pack feature of Oracle Enterprise Manager Grid Control provides a framework to make it easy for you to automate the provisioning of new nodes and clusters. For data centers with many Oracle RAC clusters, the investment in creating a cloning procedure to easily provision new clusters and new nodes to existing clusters is worth the effort.

This chapter includes the following topics:

Introduction to Cloning Oracle RAC

Cloning is the process of copying an existing Oracle RAC installation to a different location and updating the copied bits to work in the new environment. The changes made by one-off patches applied on the source Oracle home, would also be present after the clone operation. The source and the destination path (host to be cloned) need not be the same.

Some situations in which cloning is useful are:

The cloned installation behaves the same as the source installation. For example, the cloned Oracle home can be removed using Oracle Universal Installer or patched using OPatch. You can also use the cloned Oracle home 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 cloning, for example, to specify custom port assignments, or to preserve custom settings.

The cloning process works by copying all of the files from the source Oracle home to the destination Oracle home. Thus, 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 because these are relinked as 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 because several files copied from the source, specifically those being instantiated, are backed up as part of the clone operation.

Preparing to Clone Oracle RAC

In the preparation phase, you create a copy of an Oracle home that you then use to perform the cloning procedure on one or more nodes, and you install Oracle Clusterware.

Step 1   Install Oracle RAC

Use the detailed instructions in the Oracle Real Application Clusters Installation Guide to install the Oracle RAC software and patches:

  1. Install Oracle RAC and choose the Software only installation option.

  2. Patch the release to the required level (for example, 11.2.0.n).

  3. Apply one-off patches, if necessary.

Step 2   Create a backup of the source home

Create a copy of the Oracle RAC home. You will use this file to copy the Oracle RAC home to each node in the cluster (as described in "Cloning Oracle RAC to Nodes in a Cluster").

When creating the backup (tar) file, the best practice is to include the release number in the name of the file. For example:

# cd /opt/oracle/product/11g/db_1# tar –zcvf /pathname/db1120.tgz .
Step 3   Install and start Oracle Clusterware

Before you can use cloning to create a new Oracle RAC home, you must first install and start Oracle Clusterware on the node on which you want to copy a cloned Oracle RAC home. In other words, you configure an Oracle RAC home that you cloned from a source cluster onto the nodes in a target cluster in the same order that you installed the Oracle Clusterware and Oracle RAC software components on the original nodes.

See Also:

Oracle Clusterware Administration and Deployment Guide for information about cloning Oracle Clusterware homes to create new clusters, and starting Oracle Clusterware by issuing the crsctl start crs command

Cloning Oracle RAC to Nodes in a Cluster

After you complete the prerequisite tasks described in "Preparing to Clone Oracle RAC", you can deploy cloned Oracle homes.

Deploying Oracle RAC Database Homes

Deploying the Oracle RAC database home to a cluster is a multiple-step process.

This section provides step-by-step instructions that describe how to:

  1. Prepare the new cluster nodes

  2. Deploy the Oracle RAC database software

  3. Run the clone.pl script on each node

  4. Run the $ORACLE_HOME/root.sh script on each node

  5. Run DBCA to create the Oracle RAC instances on each node

Step 1   Prepare the new cluster nodes

Perform the Oracle RAC preinstallation steps, including such things as:

  • Specify the kernel parameters.

  • Use short, nondomain-qualified names for all names in the Hosts file.

  • Verify that you can ping the public and interconnect names.

  • Ensure Oracle Clusterware is active.

  • Ensure that Oracle ASM is active and there at least one Oracle ASM disk group exists and is mounted.

See your platform-specific Oracle RAC installation guide for a complete preinstallation checklist.

Step 2   Deploy the Oracle RAC database software

To deploy the Oracle RAC software, you need to:

  1. Restore the Oracle home to all nodes. For example:

    [root@node1 root]# mkdir -p /opt/oracle/product/11g/db
    [root@node1 root]# cd /opt/oracle/product/11g/db
    [root@node1 db]# tar –zxvf /path_name/db1120.tgz
    

    When providing the home location and path_name, the home location can be in the same directory path or in a different directory path from the source home that you used to create the tar.

  2. Change the ownership of all files to the oracle and oinstall group. For example:

    [root@node1 db]# chown –R oracle:oinstall /opt/oracle/product/11g/db
    

Note:

You can perform this step at the same time you perform steps 3 and 4 to run the clone.pl and ORACLE_HOME/root.sh scripts on each cluster node.
Step 3   Run the clone.pl script on each node

To run the clone.pl script, which performs the main Oracle RAC cloning tasks, you must:

  • Supply the environment variables and cloning parameters in the start.sh script, as described in Table 6-2 and Table 6-3. Because the clone.pl script is sensitive to the parameters being passed to it, you must be accurate in your use of brackets, single quotation marks, and double quotation marks.

  • Run the script as the oracle operating system user.

Table 6-1 lists and describes the clone.pl script parameters.

Table 6-1 clone.pl Script Parameters

Parameter Description
ORACLE_HOME=Oracle_home

The complete path to the Oracle home you want to clone. If you specify an invalid path, then the script exits. This parameter is required.

ORACLE_BASE=ORACLE_BASE

The complete path to the Oracle base you want to clone. If you specify an invalid path, then the script exits. This parameter is required.

ORACLE_HOME_NAME=
Oracle_home_name |
-defaultHomeName

The Oracle home name of the home you want to clone. Optionally, you can specify the -defaultHomeName flag. This parameter is not required.

OSDBA_GROUP=group_name

Specify the operating system group you want to use as the OSDBA privileged group.

OSOPER_GROUP=group_name

Specify the operating system group you want to use as the OSOPER privileged group.

OSASM_GROUP=group_name

Specify the operating system group you want to use as the OSASM privileged group.

-O

The clone.pl script passes anything following this flag to the Oracle Universal Installer command line.

-debug

Specify this option to run the clone.pl script in debug mode

-help

Specify this option to obtain help for the clone.pl script.


Example 6-1 shows an excerpt from the start.sh script that calls the clone.pl script.

Example 6-1 Excerpt From the start.sh Script to Clone Oracle RAC for Linux and UNIX

ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/11g/db
cd $ORACLE_HOME/clone
THISNODE=`hostname -s`

E01=ORACLE_HOME=/opt/oracle/product/11g/db
E02=ORACLE_HOME_NAME=OraDBRAC
E03=ORACLE_BASE=/opt/oracle
C01="-O'CLUSTER_NODES={node1, node2}'"
C02="-O'LOCAL_NODE=$THISNODE'"

perl $ORACLE_HOME/clone/bin/clone.pl $E01 $E02 $E03 $C01 $C02

Example 6-2 shows an excerpt from the start.bat script that the user must create that calls the clone.pl script.

Example 6-2 Excerpt From the start.bat Script to Clone Oracle RAC for Windows

set ORACLE_home=Oracle_home
cd %ORACLE_home%\clone\bin
set THISNODE=%hostname%
set E01=ORACLE_HOME=%ORACLE_home%
set E02=ORACLE_HOME_NAME=OraDBRAC
set E03=ORACLE_BASE=Oracle_Base
set C01="-O'CLUSTER_NODES={node1,node2}'"
set C02="-O'LOCAL_NODE=%THISNODE%'"
perl clone.pl %E01% %E02% %E03% %C01% %C02%

Table 6-2 describes the environment variables E01, E02, and E03 that are shown in bold typeface in Example 6-1.

Table 6-2 Environment Variables Passed to the clone.pl Script

Symbol Variable Description

E01

ORACLE_HOME

The location of the Oracle RAC database home. This directory location must exist and must be owned by the Oracle operating system group: oinstall.

E02

ORACLE_HOME_NAME

The name of the Oracle home for the Oracle RAC database. This is stored in the Oracle Inventory.

E03

ORACLE_BASE

The location of the Oracle Base directory.


Table 6-3 describes the cloning parameters C01 and C02, that are shown in bold typeface in Example 6-1.

Table 6-3 Cloning Parameters Passed to the clone.pl Script.

Variable Name Parameter Description

C01

Cluster Nodes

CLUSTER_NODES

Lists the nodes in the cluster.

C02

Local Node

LOCAL_NODE

The name of the local node.


Step 4   Run the $ORACLE_HOME/root.sh script on each node

Note:

This step applies to Linux and UNIX installations, only.

Run the $ORACLE_HOME/root.sh as the root operating system user as soon as the clone.pl procedure completes on the node.

[root@node1 root]# /opt/oracle/product/11g/db/root.sh -silent

Note that you can run the script on each node simultaneously:

[root@node2 root]# /opt/oracle/product/11g/db/root.sh -silent

Ensure the script has completed on each node before proceeding to the next step.

Step 5   Run DBCA to create the Oracle RAC instances on each node

This step shows how to run the DBCA in silent mode and provide response file input to create the Oracle RAC instances.

The following example creates Oracle RAC instances on each node, registers the instances in the OCR, creates the database files in the Oracle ASM disk group called DATA, and creates sample schemas. It also sets the sys, system, sysman and dbsnmp passwords to password which is the password for each:

[oracle@node1 oracle]$ export ORACLE_HOME=/opt/oracle/product/11g/db
[oracle@node1 oracle]$ cd $ORACLE_HOME/bin/
[oracle@node1 bin]$./dbca -silent -createDatabase -templateName General_Purpose.dbc\
-gdbName ERI -sid ERI 
-sysPassword password -systemPassword password \
-sysmanPassword password -dbsnmpPassword password \
-emConfiguration LOCAL \
-storageType ASM -diskGroupName DATA \
-datafileJarLocation $ORACLE_HOME/assistants/dbca/templates \
-nodeinfo node1,node2 -characterset WE8ISO8859P1 \
-obfuscatedPasswords false -sampleSchema true \
-oratabLocation /etc/oratab

See Also:

Oracle Database 2 Day DBA for information about using DBCA to create and configure a database

Locating and Viewing Log Files Generated During Cloning

The cloning script runs multiple tools, each of which may generate its own log files. After the clone.pl script finishes running, you can view log files to obtain more information about the cloning process.

The following log files that are generated during cloning are the key log files of interest for diagnostic purposes:

Table 6-4 describes how to find the location of the Oracle inventory directory.

Table 6-4 Finding the Location of the Oracle Inventory Directory

Type of System... Location of the Oracle Inventory Directory

All UNIX computers except Linux and IBM AIX

/var/opt/oracle/oraInst.loc

IBM AIX and Linux

/etc/oraInst.loc file.

Windows

Obtain the location from the Windows Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\INST_LOC