clone_database_home

Clones the specified Oracle Home or S/W Library from the target host to specified destinations. If the isRac option is true, a RAC cluster is created. If the isRac option is true, the home name and location of the RAC cluster are needed.

Format

 emcli clone_database_home
       -input_file="dest_properties:file_path"
       -list_exclude_files="files_to_exclude"
       -isSwLib="true|false"
       -isRac="true|false"
       -tryftp_copy="true|false"
       -jobname="name_of_cloning_job"
       [-home_name="home_when_creating_RAC_cluster"]
       [-home_location="location_of_home_when_creating_RAC_cluster"]
       [-prescripts="script_name_to_execute"]
       [-run_prescripts_as_root="true|false"]
       [-postscripts="script_to_execute"]
       [-run_postscripts_as_root="true|false"]
       [-rootscripts="script_name_to_execute"]
       [-swlib_component ="path:path_to_component;version:rev"] 
       [-source_params="TargetName:name;HomeLoc:loc;HomeName:name;
         ScratchLoc:scratch_dir_location"
       [-jobdesc="description"]

[ ] indicates that the parameter is optional

Options

  • input_file=dest_properties

    File containing information regarding the targets. Each line in the file corresponds to information regarding one destination.

    Format if cloning a database (isRac is false):

    Destination Host Name1;Destination Home Loc; Home Name; Scratch Location;

    Format if cloning a RAC cluster (isRac is true):

    Host Name;Node Name;Scratch Location;

    For more information about the input_file option, see -input_file Syntax Guidelines.

  • list_exclude_files

    Comma-separated list of files to exclude. This is not required if the source is software lib. "*" can be used as a wild card.

  • isSwLib

    Specifies whether the source is an Oracle Home database or Software Library.

  • isRac

    Specifies whether cloning in RAC mode. If the isRac option is true, a RAC cluster is created. If the isRac option is true, the home name and location of the RAC cluster are needed.

  • tryftp_copy

    Try FTP to copy or not. You should set the FTP copy option to false when using EM CLI from the command line.

  • jobname

    Name of the cloning job.

  • home_name

    Name of the home to use when creating a RAC cluster.

  • home_location

    Location of the home to use when creating a RAC cluster.

  • prescripts

    Path of the script to execute.

    Note:

    Double-quoted options can be passed using an escape (\) sequence. For example:

    prescripts=" <some value here>=\"some value here\" " 
  • run_prescripts_as_root

    Run prescripts as "root". By default, it is false.

  • postscripts

    Path of the script to execute.

  • run_postscripts_as_root

    Run postscripts as "root". By default it is false.

  • rootscripts

    Path of the script to execute. You can use the job system environment variables (%oracle_home%, %perl_bin%) to specify script locations.

  • swlib_component

    Path to the Software Library to be cloned. "isSwLib" must be true in this case.

  • source_params

    Source Oracle home info. "isSwLib" must be false in this case.

  • jobdesc

    Description of the job. If not specified, it is automatically generated.

Example

emcli clone_database_home
      -input_file="dest_properties:clonedestinations"
      -list_exclude_files="*.log,*.dbf,sqlnet.ora,tnsnames.ora,listener.ora"
      -isSwLib="false"
      -isRac="false"
      -tryftp_copy="false"
      -jobname="clone database home"
      -prescripts="/home/joe/myScript"
      -run_prescripts_as_root="true"
      -rootscripts="%oracle_home%/root.sh"
      -source_params="TargetName:host.domain.com;HomeLoc=/oracle/database1; HomeName=OUIHome1;ScratchLoc=/tmp"

Passing Variables Through EM CLI

When working with variables such as %perlbin% or %oracle_home%, EM CLI passes variable values from the current local environment instead of the variables themselves. To pass variables through an EM CLI command, as might be the case when using the -prescripts or -postscripts options, you can place the EM CLI command in a batch file and replace all occurrences of % with %%.