A Copy and Paste Binary Files Scripts

Oracle Fusion Middleware provides scripts that you can use to copy the Oracle Fusion Middleware binaries to another system.

You can use these scripts in conjunction with the chghost utility to change the network configuration of your Oracle Fusion Middleware installation or to move it to another system. See Changing Oracle Fusion Middleware Network Configurations for information about the chghost utility and procedures to change the network configuration or move your Oracle Fusion Middleware environment.

This appendix explains the scripts that you can use to copy the Oracle Fusion Middleware binaries to another system.

About the Copy and Paste Binary Files Scripts

The movement scripts copy the binary files of an Oracle home from a source environment and paste them at the target environment.

Use these scripts in conjunction with the procedures described in Changing the Host Name of Oracle Fusion Middleware.

Table A-1 shows the scripts you use to move the binary files in an Oracle home.

Table A-1 Copy and Paste Binary Files Scripts

TO: Script See:

Copy the binary files of the source Oracle home

(UNIX) ORACLE_HOME/oracle_common/bin/copyBinary.sh
(Windows) ORACLE_HOME\oracle_common\bin\copyBinary.cmd

copyBinary Script

Apply the copied Oracle home to the target

(UNIX) ORACLE_HOME/oracle_common/bin/pasteBinary.sh
(Windows) ORACLE_HOME\oracle_common\bin\pasteBinary.cmd

pasteBinary Script

To view the help on any of these scripts, use the -help option. For example:

./pasteBinary.sh -javaHome /scratch/oracle/jdk1.8.0_40 -help

Note that the help shows the UNIX version of the parameter values. For other platforms, such as Windows, change the parameter values for the platform.

Note:

  • For the temporary directory, do not provide a path that contains a space.

  • A Universal Uniform Naming Convention (UNC) path is not supported on Windows. For example, the following is not supported:

    \\host_name\oracle\java\win64\jdk8\jre\bin\java

Syntax for the Copy and Paste Binary Files Scripts

The following topics describe the syntax of the copyBinary and pasteBinary scripts. The options are described in the tables that follow the syntax.

Note:

The value of options must not contain a space. For example, on Windows, you cannot pass the following as a value to the -archiveLoc option:

C:\tmp\Archive Files

However, the value of the JavaHome option can contain a space.

copyBinary Script

Creates an archive file of the source Oracle home by copying the binary files of that Oracle home, including its WebLogic Server home, into the archive file.

The copyBinary script is located in:

(UNIX) ORACLE_HOME/oracle_common/bin/copyBinary.sh
(Windows) ORACLE_HOME\oracle_common\bin\copyBinary.cmd

The syntax is:

copyBinary  [-javaHome path_of_jdk]
            -sourceOracleHomeLoc ORACLE_HOME_location
            -archiveLoc archive_location 
            [-ignoreDiskWarning {true | false}]
            [-excludeFilesPattern regex1 [, regex2 ...]
            [-includeDirs dir1 [, dir2 ...]
            [-ignoreDefaultExcludes] 
            [-maxArchiveSize integer
            [-silent {true | false}]

The following example shows how to create an archive of an Oracle home on Linux:

copyBinary.sh -javaHome /scratch/oracle/jdk1.8.0_40
              -archiveLoc /tmp/oh_copy.jar
              -sourceOracleHomeLoc /scratch/oracle/Oracle_home1 
              -includeDirs cfgtoollogs,other 
              -excludeFilesPattern /inventory/Actions/.*,/inventory/Clone/.* 
              -maxArchiveSize 4096

Note:

When you execute the script, you must specify a matching Java home. That is, if the Oracle homes are 64 bit, you must specify a 64-bit Java home. If the Oracle homes are 32 bit, you must specify a 32-bit Java home.

Table A-2 describes the options for the copyBinary script.

Table A-2 Options for the copyBinary Script

Options Description Mandatory or Optional

-javaHome

The absolute path of the Java Developer's Kit.

The script detects if the operating system is 64 bit and passes the -d64 option to the scripts in the command line.

Optional

-sourceOracleHomeLoc

The absolute path of the Oracle home to be archived. You can only specify one Oracle home.

Mandatory

-archiveLoc

The absolute path of the archive location. Use this option to specify the location of the archive file to be created with the copyBinary script.

The archive location must not exist.

Ensure that the archive location is not within the Oracle home structure.

Mandatory

-ignoreDiskWarning

Specifies whether the operation ignores a warning that there is not enough free space available. The default is false.

You may need to use this flag if the target is NFS mounted or is on a different file system, such as Data ONTAP.

Optional

-excludeFilesPattern

Specifies files to be excluded from the archive. You can specify more than one file by separating them with commas. Use the following formats:

UNIX: -excludeFilesPattern /inventory/Actions/.*,/inventory/Clone/.* 
Windows: -excludeFilesPattern "\\inventory\\Actions\\.*,\\inventory\\Clone\\.*"

Optional

-includeDirs

Specifies the directories, besides the Oracle Home, to be included in the archive. You specify the top-level directory; subdirectories will also be included in the archive.

Optional

-ignoreDefaultExcludes

The flag specifies that default files are not excluded by default. If the same files are added to -excludeFilePatterns they will be excluded. (By default, some files, such as log files, are excluded.)

Optional

-maxArchiveSize

Specifies the maximum size of an archive file. As the script executes, if the jar file reaches the maximum size, it creates additional jar files, until it completes the process.

Optional

-silent

Specifies whether the operation operates silently. That is, it does not prompt for confirmation, which is the default.

To specify that it does prompt for confirmation, specify this option with the value of false. To continue, you must type yes, which is not case sensitive. Typing anything other than yes causes the script to abort.

Optional

pasteBinary Script

Applies the archive to the target destination, by pasting the binary files of the source Oracle home to the target environment. You can apply the archive to the same host or a different host.

The pasteBinary script is located in:

(UNIX) ORACLE_HOME/oracle_common/bin/pasteBinary.sh
(Windows) ORACLE_HOME\oracle_common\bin\pasteBinary.cmd

The syntax is:

pasteBinary [-javaHome path_of_jdk]
            -archiveLoc archive_location
            -targetOracleHomeLoc target_Oracle_Home_location
            [-targetOracleHomeName Oracle_home_name]
            [-ignoreDiskWarning {true | false}]
            [-ignoreJavaVersion {true | false}]
            [-ohAlreadyCloned {true | false}]
            [-prereqConfigLoc path_to_config_files]
            [-entryPoint entrypoint_name] 
            [-invPtrLoc Oracle_InventoryLocation]
            [-executeSysPrereqs {true | false}]
            [-silent {true | false}]

The following example shows how to apply the archive to the directory /scratch/oracle/Oracle_home_prod, on Linux:

pasteBinary.sh -javaHome /scratch/oracle/jdk1.8.0_40
               -archiveLoc  /tmp/oh_copy.jar 
               -targetOracleHomeLoc /scratch/oracle/Oracle_home_prod 
               -targetOracleHomeName Oracle_home_prod

Table A-3 describes the options for the pasteBinary script.

Table A-3 Options for the pasteBinary Script

Options Description Mandatory or Optional

-javaHome

The absolute path of the Java Developer's Kit.

The script detects if the operating system is 64 bit and passes the -d64 option to the scripts in the command line.

Optional

-archiveLoc

The absolute path of the archive location. Use this option to specify the location of the archive file created with the copyBinary script.

The location must exist.

This option is mutually exclusive with the -ohAlreadyCloned option.

Mandatory

-targetOracleHomeLoc

The absolute path of the target Oracle home.

Ensure that the Oracle home directory does not exist at that location, or if it does, it is an empty directory. Otherwise, the script returns an error message.

The -targetOracleHomeLoc cannot be inside another Oracle home.

Mandatory

-targetOracleHomeName

The name for the Oracle home. This name is used to register the Oracle home with Oracle Inventory. Spaces are not allowed in the name.

Optional

-ohAlreadyCloned

A flag specifying that the script reconfigure an already existing Oracle home that was created using a storage-level cloning tool. If this flag is set to true, then the target Oracle home should exist and it should contain Oracle home binaries.

Valid values are true and false. The default is false.

You cannot use this option when you use the -archiveLoc option.

Optional

-ignoreDiskWarning

A flag specifying whether the operation ignores a warning that there is not enough free space available. The default is false.

You may need to use this flag if the target is NFS mounted or is on a different file system, such as Data ONTAP.

Optional

-ignoreJavaVesion

A flag specifying whether the operation ignores the version of Java. The default is false.

Optional

-entryPoint

The name of the entry point.

Optional

-prereqConfigLoc

Specifies the path of the prerequisite configuration files.

Optional

-executeSysPrereqs

Specifies whether the pasteBinary operation checks the prerequisites of the Oracle home. The default is that it checks the prerequisites. To specify that it does not check the prerequisites, specify this option with the value false.

Optional

-invPtrLoc

On UNIX and Linux, the absolute path to the Oracle Inventory pointer. Use this option if the inventory location is not in the default location, so that the operation can register the Oracle homes with the central Oracle inventory specified in the Oracle Inventory pointer file.

If the oraInst.loc is not present at default location, you must create this file either at default location as a root user or at any other location as a root or normal user. The following shows an example of the contents of the file:

inventory_loc=/scratch/oraInventory
inst_group=dba

If the directory specified as the inventory_loc does not exist, the operation will create it.

You must have write permission to the inventory location.

On AIX and Linux, the default location is /etc/oraInst.loc. In other UNIX platforms, the default location is /var/opt/oracle/oraInst.loc

This parameter is only supported on UNIX. On Windows, if you specify this parameter, the script returns an error.

Optional, if the inventory is in the default location. Otherwise, it is mandatory on Linux.

-silent

Specifies whether the operation operates silently. That is, it does not prompt for confirmation, which is the default.

To specify that it does prompt for confirmation, specify this option with the value of false. To continue, you must type yes, which is not case sensitive. Typing anything other than yes causes the script to abort.

Optional

-ignoreDiskWarning

Specifies whether the operation ignores a warning that there is not enough free space available. The default is false.

You may need to use this flag if the target is NFS mounted or is on a different file system, such as Data ONTAP.

Optional

Executing the pasteBinary Script

When the source environment is on Host A and the target environment is on Host B, the copyBinary script is executed on Host A. However, when you are executing the pasteBinary script on Host B, the prerequisites and procedure may differ based on the scenario.

This section describes the steps to perform in the following scenarios:
  • When the Oracle home does not exist on Host B

    Use the java -jar option and execute the following command:

    (UNIX) <JAVA_HOME>/bin/java 
    -jar <archive_file> -targetOracleHomeLoc <>[-javaHome java_home] [-silent true|false] [-invPtrLoc orainst_loc_file] [optional arguments]
    (Windows) <JAVA_HOME>\bin\java.exe 
    -jar <archive_file> -targetOracleHomeLoc <> [-javaHome java_home] [-silent true|false] [optional arguments] 
  • When executing the pasteBinary script from an existing Oracle home on Host B

    Note:

    In this scenario, the Oracle home should be previously installed to allow the pasteBinary script to execute successfully. Do not install Oracle Fusion Middleware to create the Oracle home for the pasteBinary purpose only.
    1. Ensure that the following (pre-existing) files are available with the same permissions as in the original Oracle home, and in the same structure:

      %ORACLE_HOME%/oracle_common/bin/pasteBinary.*
      %ORACLE_HOME%/oracle_common/modules/*
      %ORACLE_HOME%/oui/bin/*
      %ORACLE_HOME%/oui/lib/* 
      %ORACLE_HOME%/oui/modules/*
      %ORACLE_HOME%/oui/oraparam.ini
    2. Execute the following command:

      (UNIX) ORACLE_HOME/oracle_common/bin/pasteBinary.sh
      -archiveLoc <> -targetOracleHomeLoc <> [-javaHome java_home] [-silent true|false] [-invPtrLoc orainst_loc_file] [optional arguments] 
      (Windows) ORACLE_HOME\oracle_common\bin\pasteBinary.cmd
      -archiveLoc <> -targetOracleHomeLoc <> [-javaHome java_home] [-silent true|false] [optional arguments]

Note:

The -invPtrLoc parameter is only supported on UNIX. If you specify this parameter on Windows, then the script returns an error.

See Moving Oracle Fusion Middleware to a New Host for information on how to move Oracle Fusion Middleware to a new host.