5 Cloning Oracle Software

Cloning is the process of copying an existing Oracle installation to a different location and updating the copied bits to work in the new environment. The changes made by one-off patches, which are 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. During cloning, NG OUI replays the actions that were run to install the home. The cloning process is similar to the installation process except that it runs the actions in a special mode that is referred to as clone mode.

This chapter provides information about Oracle cloning using Oracle Universal Installer (OUI). This chapter contains the following topics:

5.1 Cloning Features and Benefits

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 that it hosts.

  • Preparing an Oracle home and deploying it to many hosts.

NG OUI Cloning is more beneficial than using the tarball approach because cloning configures the Central Inventory and the Oracle home inventory in the cloned home. Cloning also makes the home manageable and allows the paths in the cloned home and the target home to be different.

5.2 How Cloning Works

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 cloned installation behaves the same as the source installation. For example, the cloned Oracle home can be removed using NG OUI 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 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.

5.3 Cloning an NG Oracle Home

The cloning process uses the NG OUI cloning functionality. This operation is driven by a set of scripts and add-ons that are included in the respective Oracle software. The cloning process has two phases:

5.3.1 Phase 1: Preparing the Source Oracle Home

To prepare the source Oracle home to be cloned, 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. Regardless of your preferred method, you must make sure that it preserves the permissions and file timestamps.

The following example shows how to archive and compress the source for various UNIX platforms:

  • For Oracle Solaris or Linux systems:

    tar cpfX - excludeListFile . | compress -fv > temp_dir/archiveName.tar.Z
    
  • For AIX or HPUX systems:

    tar cpf - . | compress -fv > temp_dir/archiveName.tar.Z
    

5.3.2 Phase 2: Cloning the Destination Home

To clone the Oracle home:

  1. Create a new directory for the cloned Oracle home:

    mkdir Destination_oracle_homecd
    
  2. Unarchive the Oracle home on the destination system:

    • For Oracle Solaris or Linux systems:

      temp_dir/archiveName.tar.Z | tar xBpf
      
    • For AIX or HPUX systems:

      temp_dir/archiveName.tar.Z | tar xpf
      
  3. Use the -clone option to complete the cloning process:

    • For Oracle Solaris, Linux, and other UNIX systems:

      Destination_oracle_home/oui/bin/launch.sh -clone -silent ORACLE_HOME= <Destination_oracle_home>
      
    • For Windows systems:

      Destination_oracle_home\oui\bin\launch.cmd -clone -silent ORACLE_HOME= <Destination_oracle_home>
      

Optional parameters:

  • ORACLE_HOME_NAME= < Destination_oracle_home name>

  • -responseFile <response file location>

Note:

NG OUI supports all the parameters used during installation in cloning.

It also supports response file inputs.