7 Oracle Site Guard Command-Line Interface

Oracle Site Guard uses the Enterprise Manager Command Line Interface (EMCLI) to manage Oracle Site Guard configuration directly from the command line, or from batch programs or scripts. This chapter lists all of the EM CLI verbs used for configuring Oracle Site Guard:

Note:

EMCLI commands are case-sensitive. Ensure that you use the correct EMCLI verb, and enter the correct input.

Note:

7.1 add_siteguard_aux_hosts

Associates new auxiliary hosts with a Site Guard system.

An auxiliary host can be any host that is not part of the system but is managed by Enterprise Manager Cloud Control. These hosts can be used to execute any script. Any other targets running on this host will not be part of Site Guard operation plan(s).

Format

emcli add_siteguard_aux_hosts 
          -system_name="system_name" 
          -host_name="host_name" 

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the system on which you are performing the operation.
-host_name One or more names of the host. This host must be managed by Enterprise Manager Cloud Control.

Example 7-1 Adding Auxiliary Hosts

emcli add_siteguard_aux_hosts 
       -system_name="austin-system
       -host_name="host1.domain.com"

emcli add_siteguard_aux_hosts 
       -system_name="austin-system"
       -host_name="host2.domain.com"
       -host_name="host3.domain.com"

7.2 add_siteguard_script_credential_params

Adds a named credential as a parameter for an Oracle Site Guard script. Values of user name and password of this credential can be accessed within the script.

Format

emcli add_siteguard_script_credential_params
        -script_id="id_associated_with_the_script" 
        -credential_name="name_of_the_credential" 
        [-credential_owner="credential_owner"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-script_id Specify the script ID.
-credential_name Specify the name of the credential.
-credential_owner Specify the credential owner details. You need not specify the values of this parameter if the owner of the credential is same as that of the logged-in user.

Example 7-2 Adding Site Guard Script Credential Parameters

emcli add_siteguard_script_credential_params 
       -script_id="1" 
       -credential_name="NAMED_CREDENTIAL_X"  

emcli add_siteguard_script_credential_params 
       -script_id="2" 
       -credential_name="NAMED_CREDENTIAL_Y" 
       -credential_owner="SG_ADMIN" 

7.3 add_siteguard_script_hosts

Adds a host to the Oracle Site Guard configuration scripts. You can add more than one host.

Format

emcli add_siteguard_script_hosts
         -script_id="script_id"
         -host_name="host_name" 

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-script_id Specify the identification associated with the script.
-host_name Specify the host that you want to associate with the script. You can specify more than one host name.

Example 7-3 Adding Hosts

emcli add_siteguard_script_hosts 
         -script_id="10" 
         -host_name ="host1.domain.com"

7.4 configure_siteguard_lag

Configures limit for Apply Lag and Transport Lag for all or selected databases of the system.

Format

emcli configure_siteguard_lag
        -system_name="system_name"
        [-target_name="database_target_name"]
        -property_name="ApplyLag" or "TransportLag"
        -value="maximum_lag_limit_in_seconds"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the system on which you want to configure the threshold limit.
-target_name Specify the database target name for which the threshold limit is configured. If this parameter is not specified, then the threshold value is applied to all databases of the system.
-property_name Specify the property name. Valid values are ApplyLag and TransportLag.
-value Specify the threshold value to be configured (in seconds).

Example 7-4 Configuring Values of Apply Lag and Transport Lag

emcli configure_siteguard_lag 
       -system_name="example-system"
       -property_name="ApplyLag"
       -value="1000"
 
emcli configure_siteguard_lag 
       -system_name="example-system"
       -target_name="OID_db"
       -property_name="TransportLag"
       -value="2500"

7.5 create_operation_plan

Creates an operational plan for Oracle Site Guard operations.

Format

emcli create_operation_plan
         [-primary_system_name="name_of_primary_system"]
         [-standby_system_name="name_of_standby_system"]
         [-system_name="name_of_the_system"]
         [-operation="name_of_the_operation"]
         [-name="name_of_the_operation_plan"]
         [-role="role_associated_with_the_system"]
         [-like="name_of_the_operation_plan_from_which_the_steps_are_to_be_copied"
         

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-primary_system_name Specify the name of your system associated with the primary site. This option is used for switchover or failover operations.
-standby_system_name Specify the name of your system associated with the standby site. This option is used for switchover or failover operations.
-system_name Specify the name of the system. This option is used for start or stop operations.
-operation Specify the function of the operation. Example: switchover, failover, start or stop.
-name Specify the name of the operation plan.
-role Specify the role associated with a system, when you run an operation (start or stop).
-like Name of the operation plan from which the steps are to be copied. If this option is specified, system name, operation, and role are ignored.

Example 7-5 Creating Operation Plan

emcli create_operation_plan 
         -primary_system_name="austin" 
         -standby_system_name="austin2" 
         -operation="switchover" 
         -name="austin-switchover-plan" 


emcli create_operation_plan 
         -system_name="austin" 
         -operation="start" 
         -name="austin-start-plan" 
         -role="Primary"

emcli create_operation_plan 
         -like="austin-start-plan" 
         -name="austin-start-plan-copy"

7.6 create_siteguard_configuration

Creates a site configuration for Oracle Site Guard.

Format

emcli create_siteguard_configuration
         -primary_system_name="name_of_primary_system"
         -standby_system_name="name_of_standby_system"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-primary_system_name Specify the name of the system that is associated with the primary site.
-standby_system_name Specify the name of the system that is associated with the standby system. You can specify more than one option and one system name.

Example 7-6 Creating Site Guard Configuration

emcli create_siteguard_configuration 
         -primary_system_name="example1"

emcli create_siteguard_configuration 
         -primary_system_name="example1"
         -standby_system_name="example2"

7.7 create_siteguard_credential_association

Associates the credentials with the targets in a site.

Format

emcli create_siteguard_credential_association
         -system_name="name_of_the_system"
         [-target_name="name_of_the_target"]
         -credential_type="type_of_credential"
         [-credential_name="name"]
         [–use_preferred_credential="true_or_false"]
         -credential_owner="owner"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the name of the system.
-target_name Specify the name of the target. This parameter is optional.
-credential_type Specify the type of the credential. Example: HostNormal, HostPrivileged, NodeManager, WLSAdmin, or DatabaseSysdba.

Note: For Node Manager credential, specify the NodeManager credential_type, and specify the values for target_name, but use HostNormal credential for credential_name.

-credential_name Specify the name of the credential.

If credential_name is not specified, then use_preferred_credential has to be set to true.

-credential_owner Specify the owner of the credential.
–use_preferred_credential If you are using Preferred Credentials, then specify true. The default value is false. If you use the default value, then you must specify the -credential_name parameter to use named credentials.

Example 7-7 Creating Site Guard Credential Association

emcli create_siteguard_credential_association 
         -system_name="austin-system"
         -credential_type="HostNormal"
         -credential_name="HOST-SGCRED"
         -credential_owner="sysman"            

emcli create_siteguard_credential_association 
         -system_name="austin-system" 
         -credential_type="HostPrivileged" 
         -use_preferred_credential="true" 
         -credential_owner="sysman" 

emcli create_siteguard_credential_association
         -system_name="austin-system"
         -credential_type="HostNormal"
         -credential_owner="sysman"

emcli create_siteguard_credential_association 
          -system_name="austin-system" 
          -target_name="austin-database-instance" 
          -credential_type="DatabaseSysdba" 
          -credential_name="HOST-DBCRED" 
          -credential_owner="sysman"

7.8 create_siteguard_script

Create scripts (Pre Script, Post Script and storage script) for the Oracle Site Guard configuration.

Format

emcli create_siteguard_script
         -system_name=name_of_the_system
         -operation=name_of_the_operation
         -script_type=type_of_the_script
         [-host_name=name_of_the_host_where_the_scripts_are_run]
         -path=path_of_the_script
         [-component="path_of_the_entity_in_software_library"] 
         [-runtime_script="flag_to_specify_if_prechecks_to_check_availability_of_this_script"]
         [-run_on=flag_specifying_the_host]
         [-all_hosts=flag_to_run_script_on_all_the_hosts_in_the_system]
         [-role=role_associated_with_the_system]
         [-credential_type=type_of_the_credential]
         [-credential_name="name_of_the_credential"] 
         [-target_storage_credential_name=target_storage_credential]
         [-source_storage_credential_name=source_storage_credential] 
         [-credential_owner=credential_owner]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the name of the system.
-operation Specify the name of the operation. Name of the operation:

Switchover, Failover, Start, or Stop.

-script_type Specify the type of the script. It can be Mount, UnMount, Global-Pre-Script, Global-Post-Script, Pre Script, Post-Script, Storage-Failover, or Storage-Switchover.
-host_name Specify the name of the host where this script will be executed.

This parameter is optional and can be specified more than once.

-path Specify the path to the script.
-component Specify the path to the entity in the software library. If component is specified, path should contain only the file name and its parameters.

This parameter is optional.

-runtime_script Specify the value as true or false. If the script is designated as a runtime script, Precheck will not verify the existence of script. This parameter is used when the script is dynamically mounted or generated as part of execution of operation plan.

By default, all scripts staged from the software library are designated as runtime scripts. The default value for scripts that are not staged from software library is false.

This parameter is optional.

-run_on Specify whether the script needs to be executed on only one of the available hosts (enter any) or on all hosts (enter all).

This parameter is optional and default value is all.

-all_hosts Optional flag to allow the script to run on all the hosts in the system. This parameter overrides the host_name. Enter true or false.
-role Optional flag to configure script based on the system role. By default, the script is configured for both primary and standby roles for a given system. For example: Primary or Standby.
–credential_type Specify HostNormal or HostPrivileged if you have root privileges.
-credential_name Specify the name of the credential that is used to execute this script.

If the value for the parameter credential_name is not specified, then the value for the parameter credential_type needs to be specified.

-target_storage_credential_name Specify the named credential for target storage. If target_storage_credential_name is specified then source_storage_credential_name and credential_owner must be specified.
-source_storage_credential_name Specify the named credential for source storage. If source_storage_credential_name is specified then target_storage_credential_name and credential_owner must be specified.
-credential_owner Specify the owner of the credential. If target_storage_credential_name and source_storage_credential_name are specified then the attribute credential_owner must be specified.

Example 7-8 Creating Site Guard Script

emcli create_siteguard_script 
          -system_name="austin-system" 
          -operation="Switchover" 
          -script_type="Precheck-Script" 
          -role="Primary"  
          -credential_type="HostNormal" 
          -path="/tmp/precheckscript" 
          -all_hosts="true" 

emcli create_siteguard_script 
          -system_name="austin-system" 
          -operation="Failover" 
          -script_type="Post-Script" 
          -role="Standby"  
          -credential_name="MY_NAMED_HOST_CREDENTIAL" 
          -path="/tmp/postscript" 
          -host_name="host1.domain.com" 
          -host_name="host2.domain.com" 
          -run_on="any" 
          -runtime_script="true" 

emcli create_siteguard_script 
          -system_name="austin-system" 
          -operation="Switchover" 
          -script_type="Pre-Script" 
          -credential_type="HostNormal"           -path="stop_mycomponent.sh" 
          -component="/Components/MyScripts/LCM_Operations" 
          -all_hosts="true" 
          -role="Primary" 

emcli create_siteguard_script 
          -system_name="austin-system" 
          -operation="Switchover" 
          -script_type="Global-Pre-Script" 
          -credential_type="HostNormal" 
          -path="/tmp/prescript" 
          -all_hosts="true" 
          -target_storage_credential_name="SGCRED-TARGET-STORAGE" 
          -source_storage_credential_name="SGCRED-SOURCE-STORAGE" 
          -credential_owner="sysman"

7.9 delete_operation_plan

Deletes the specified operation plan from an Oracle Site Guard configuration.

Format

emcli delete_operation_plan
         -name="name_of_operation_plan"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-name Specify the name of the operation plan you want to delete.

Example 7-9 Deleting an Operation Plan

emcli delete_operation_plan 
         -name="austin-switchover"

7.10 delete_siteguard_aux_host

Delete any auxiliary host associated with the system.

Format

emcli delete_siteguard_aux_host
        -system_name="system_name"
        [-host_name="name_of_the_host"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the system on which you are performing the operation.
-host_name The name of the host where the script will be run. This is an optional parameter. If it is not specified, then all auxiliary hosts associated with the system will be deleted.

Note: Ensure that the host name is part of the system specified in system_name.


Example 7-10 Deleting Auxiliary Hosts

emcli delete_siteguard_aux_host 
       -system_name="austin-system"
 
emcli delete_siteguard_aux_host 
       -system_name="austin-system"
       -host_name="example-host1.domain.com"
 
emcli delete_siteguard_aux_host 
       -system_name="austin-system"
       -host_name="example-host2.domain.com"

7.11 delete_siteguard_configuration

Deletes the Oracle Site Guard configuration. The entire configuration (scripts, credential associations, site associations, operation plans) pertaining to the specified system and all of the associated standby systems are deleted.

Format

emcli delete_siteguard_configuration
        -primary_system_name="name_of_the_primary_system"
        -standby_system_name="name_of_the_standby_system"
        [-force="flag_specifying_whether_old_configurations_to_be_deleted"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-primary_system_name Specify the name of the primary system.
-standby_system_name Specify the name of the standby system. This parameter is optional. However, if you do not specify this parameter, the Oracle Site Guard configuration of the specified primary system and all its standby system are deleted.
-force Specify whether old configuration(s) need to be deleted. Enter either true or false.

This parameter is optional.


Example 7-11 Deleting Site Guard Configuration

emcli delete_siteguard_configuartion 
         -primary_system_name="austin-system1"

emcli delete_siteguard_configuration
         -standby_system_name="austin2-system2"

 emcli delete_siteguard_configuration 
         -force="true"

7.12 delete_siteguard_credential_association

Deletes the credential association from the Oracle Site Guard configuration.

Format

emcli delete_siteguard_credential_association
         -system_name="name"
         [-target_name=["name"]
         -credential_type="type"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the system on which the service resides.
-credential_type Specify the credential type. It can be HostNormal, HostPrivileged, NodeManager, WLSAdmin, or DatabaseSysdba.
-target_name Specify the name of the target. This parameter is optional.

Example 7-12 Deleting Site Guard Credential Association

emcli delete_siteguard_credential_association
         -system_name="austin-system"
         -credential_type="HostNormal"

emcli delete_siteguard_credential_association 
         -system_name="austin-system"
         -target_name="austin-database-instance"
         -credential_type="DatabaseSysdba"

7.13 delete_siteguard_lag

Deletes values of Apply Lag and Transport Lag threshold configured for one or more Data Guard enabled databases of the system.

Format

emcli delete_siteguard_lag
         -system_name="system_name"
         [-target_name="database_target_name"]
         -property_name="lag_type"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the system for which you want to configure the threshold limit.
-target_name Specify the database target name for which the threshold limit is configured. If this parameter is not specified, then the threshold value is applied to all databases of the system. This parameter is optional.
-property_name Specify the property name. Valid values are ApplyLag and TransportLag.

Example 7-13 Deleting Values of Apply Lag and Transport Lag

emcli delete_siteguard_lag 
       -system_name="austin-system"
       -property_name="ApplyLag"
 
emcli delete_siteguard_lag 
       -system_name="austin-system"
       -target_name="OID_db"
       -property_name="TransportLag"

7.14 delete_siteguard_script

Deletes the specified script from the Oracle Site Guard configuration.

Format

emcli delete_siteguard_script
         -script_id="script id"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-script_id Specify the ID associated with the script.

Example 7-14 Deleting Site Guard Script

emcli delete_siteguard_script 
         -script_id="10"

7.15 delete_siteguard_script_credential_params

Deletes a named credential that is a parameter to a Oracle Site Guard script. Values of the user name and password of this credential can be accessed within the script.

Format

emcli delete_siteguard_script_credential_params
        -script_id="Id associated with the script" 
        [-credential_name="name of the credential"] 
        [-credential_owner="credential owner"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-script_id Specify the ID associated with the script.
-credential_name Specify the name of the credential. If this argument is not specified, all credentials associated with the script will be deleted.

This parameter is optional.

-credential_owner Specify the owner of the credential. This parameter need not be specified if the owner of the credential is the same as the logged-in user.

Example 7-15 Deleting Site Guard Script Credential Parameters

emcli delete_siteguard_script_credential_params 
        -script_id="1" 
        -credential_name="NAMED_CREDENTIAL_X" 

emcli delete_siteguard_script_credential_params 
        -script_id="2" 
        -credential_name="NAMED_CREDENTIAL_Y" 
        -credential_owner="SG_ADMIN"

emcli delete_siteguard_script_credential_params 
        -script_id="3"

7.16 delete_siteguard_script_hosts

Deletes the host or hosts associated with a given script.

Format

emcli delete_siteguard_script_hosts
         -script_id="script id"
         -host_name="host_name"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-script_id Specify the ID associated with the script.
-host_name Specify the name of the host where this script will be executed.

This parameter can be specified more than once.


Example 7-16 Deleting Site Guard Script Hosts

emcli delete_siteguard_script_hosts 
         -script_id="10"
         -host_name="example-host.domain.com"

Output Columns

Step Number, Operation name, Target Name, Target Host, Error Mode

7.17 get_operation_plan_details

Provides the detailed step-by-step information about the specified operation plan.

Format

emcli get_operation_plan_details
         -name="plan_name"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-name Specify the name of the operation plan.

Example 7-17 Obtaining Operation Plan Details

emcli get_operation_plan_details 
         -name="austin-switchover"

7.18 get_operation_plans

Lists all configured operation plans.

Format

emcli get_operation_plans        [-name="name_of_the_operation_plan"] 
        [-operation="type_of_operation"] 
        [-system_name="name_of_the_system"] 
        [-primary_system_name="name_of_the_primary_system"] 
        [-standby_system_name="name_of_the_standby_system"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-name Specify the name of the operation plan.
-operation Specify the name of the operation. For example, switchover, failover, start, or stop.

This is an optional parameter. If you do not specify this parameter, then all the operation plans will be listed.

-system_name Specify the name of system used in the operation plan. If you specify these values, then the values for -primary_system_name and -standby_system_name need not be specified.
-primary_system_name Specify the name of primary system used in the operation plan. You can specify the values of this parameter instead of the values of -system_name. The -standby_system_name parameter can also be additionally used for better filtering.
-standby_system_name Specify the name of the standby system used in the operation plan. You can specify the values of this parameter instead of the values of -system_name. The -primary_system_name parameter can also be additionally used for better filtering.

Example 7-18 Obtaining Operation Plans

emcli get_operation_plans 
        -operation="switchover"         -system_name="austin-system" 

emcli get_operation_plans 
        -operation="switchover" 
        -primary_system_name="austin-system"

emcli get_operation_plans 
        -operation="failover" 
        -standby_system_name="austin2-system" 

emcli get_operation_plans 
        -name="austin-switchover-plan" 
        -system_name="austin-system"

Output Columns

Plan name, Operation name, Primary System Name, Standby System Name, Created On

7.19 get_siteguard_aux_hosts

Get a list of all auxiliary hosts associated with the system.

Format

emcli get_siteguard_aux_hosts
       -system_name="system_name"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the system on which you are performing the operation.

Example 7-19 Listing Auxiliary Targets

emcli get_siteguard_supported_targets 
       -system_name="example-system"

7.20 get_siteguard_configuration

Provides the Oracle Site Guard configuration.

Format

emcli get_siteguard_configuration
         [-primary_system_name="name_of_the_primary_system"]
         [-standby_system_name="name_of_the_standby_system"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-primary_system_name Specify the name of the primary system.
-standby_system_name Specify the name of the standby system.

Output Columns

Primary System, Standby System(s)

Example 7-20 Obtaining Site Guard Configuration

emcli get_siteguard_configuartion 
         -primary_system_name="austin-system"
         -standby_system_name="austin2-system"

7.21 get_siteguard_credential_association

Lists the credential associations configured for a system.

Format

emcli get_siteguard_credential_association
         -system_name="name_of_the_system"
         [-target_name="name_of_the_target"]
         [-credential_type="type_of_the_credential"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the name of the system.
-target_name Specify the name of the target. This parameter is optional.
-credential_type Specify the type of the credential. It can be HostNormal, HostPrivileged, NodeManager, WLSAdmin, or DatabaseSysdba.

Note: For Node Manager credential type, specify the NodeManager as the credential_type, and specify the values of target_name, but use a HostNormal credential for the parameter credential_name.

This parameter is optional.


Output Columns

Target Name, Credential Name, Credential Type

Example 7-21 Obtaining Site Guard Credential Association

emcli get_siteguard_credential_association 
         -system_name="austin-system"
         -credential_type="HostNormal"

emcli create_siteguard_credential_association 
         -system_name="austin-system"
         -target_name="austin-database-instance"
         -credential_type="DatabaseSysdba"

7.22 get_siteguard_health_checks

Displays schedule of health checks for an operation plan.

Format

emcli get_siteguard_health_checks
         -operation_plan="name_of_the_operation_plan"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-operation_plan Specify the name of the operation plan for which schedule of health checks has to be displayed.

Example 7-22 Obtaining Site Guard Health Checks

emcli get_siteguard_health_checks 
         -operation_plan="austin-switchover"

7.23 get_siteguard_lag

Retrieves and shows configured limit for ApplyLag and TransportLag for all or selected databases of the system.

Format

emcli get_siteguard_lag
         -system_name="name_of_the_system"
         [-target_name="database_target_name"]
         -property_name="lag_type"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the name of the system.
-target_name Specify the name of the database.
-property_name Specify the name of the property. Valid values are ApplyLag and TransportLag.

Example 7-23 Obtaining Site Guard Lag

emcli get_siteguard_lag
         [-system_name="austin-system"]
         [-property_name="ApplyLag"]

emcli get_siteguard_lag
         [-system_name="austin-system"]
         [-target_name="OID_db"]
         [-property_name="TransportLag"]

7.24 get_siteguard_script_credential_params

Provides all the credential parameters for a Site Guard script.

Format

emcli get_siteguard_script_credential_params        -script_id="Id_associated_with_the_script"         [-credential_name="name_of_the_credential"]         [-credential_owner="credential_owner"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-script_id Specify the ID associated with the script.
-credential_name Specify the name of the credential. If this argument is not specified, all credentials associated with the script will be deleted.

This parameter is optional.

-credential_owner Specify the owner of the credential. This parameter need not be specified if the owner of the credential is the same as the logged-in user.

Example 7-24 Getting Oracle Site Guard Script Credential Parameters

emcli get_siteguard_script_credential_params 
        -script_id="1" 
        -credential_name="NAMED_CREDENTIAL_X" 

emcli get_siteguard_script_credential_params 
        -script_id="3"  

emcli get_siteguard_script_credential_params 
        -script_id="3"  
        -credential_owner="SG_ADMIN" 

7.25 get_siteguard_script_hosts

Lists the hosts associated with any script where the script is designated to run.

Format

emcli get_siteguard_script_hosts
         -script_id="script_id"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-script_id Specify the ID associated with the script.

Output Columns

Host Name

Example 7-25 Obtaining Site Guard Script Hosts

emcli get_siteguard_script_hosts 
         -script_id="10"

7.26 get_siteguard_scripts

Obtains the Oracle Site Guard scripts associated with the specified system.

Format

emcli get_siteguard_scripts
         -system_name="system_name"
         -operation="operation_name"
         -script_type="type_of_the_script"
         [-role="role_of_the_system"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the name of the system.
-operation Specify the name of the operation. For example, switchover, failover, start, or stop.
-script_type Specify the type of the script. For example: mount, unmount, pre-script, post-script, global pre-script, global post-script, storage-failover, or storage-switchover.
-role Optional parameter to filter the scripts based on the role associated with the system. For example: Primary or Standby.

Output Columns

Script ID, Type, Operation, Path, Role

Example 7-26 Obtaining Site Guard Scripts

emcli get_siteguard_scripts
         -system_name="austin-system"
         -operation="Switchover"
         -script_type="Pre-Script"

emcli get_siteguard_scripts
         -system_name="austin-system"
         -operation="Switchover"
         -script_type="Pre-Script"
         -role="Primary"

7.27 get_siteguard_supported_targets

Get the list of all Oracle Site Guard supported targets of the system.

Format

emcli get_siteguard_supported_targets
       -system_name={system name} 
       [-target_type={target type}]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the name of the system.
-target_type Specify the type of the target. This is an optional parameter.

Example 7-27

emcli get_siteguard_supported_targets 
          -system_name="austin-system"

emcli get_siteguard_supported_targets 
          -system_name="austin-system" 
          -target_type="weblogic"

emcli get_siteguard_supported_targets 
          -system_name="austin-system" 
          -target_type="database"

7.28 run_prechecks

Run the Oracle Site Guard Prechecks for any given operation plan.

Format

emcli run_prechecks
         -operation_plan="name_operation_plan"
         [-database_lag_checks="true"|"false"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-operation_plan Specify the name of the operation plan.
-database_lag_checks Run database lag checks as part of Prechecks for all Data Guard configured databases. Enter value true or false.

This parameter is optional.


Example 7-28 Running Prechecks

emcli run_prechecks 
          -operation_plan="austin-switchover"
         
emcli run_prechecks 
          -operation_plan="austin-switchover"
          -database_lag_checks="false"

7.29 schedule_siteguard_health_checks

Schedules health checks for an operation plan.

Format

emcli schedule_siteguard_health_checks
-operation_plan={name of the operation plan}
        -schedule=
           {
             start_time:yyyy/MM/dd HH:mm;
             [tz:{java timezone ID};
             [frequency:interval/weekly/monthly/yearly;]
             [repeat:tx;]
             [end_time:yyyy/MM/dd HH:mm;]
             [grace_period:xxx;]
           }
             [-notify="flag_specifying_whether_email_notifications_to_be_sent"] 
             [-email="email_address_to_be_notified"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-operation_plan Specify the name of the operation plan for which health checks have to be scheduled.
-schedule Specify schedules at which health checks have to be scheduled.

start_time - Specify the time when health checks have to start executing.

tz - Specify the time-zone ID (optional).

frequency - Valid values are once/interval/weekly/monthly/yearly (optional)

If frequency is set to interval, then repeat has to be specified.

If frequency is set to weekly or monthly, days has to specified.

If frequency is set to yearly, both days and months have to specified.

repeat - Specify the frequency with which health checks have to be repeated. This is mandatory only if frequency is set to interval.

days - Specify the list of days separated by commas. This is required only if frequency is weekly, monthly, or yearly).If frequency is weekly, then valid range is 1 to 7. If frequency is monthly or yearly, then valid range is 1 to 30.

months - Specify the list of months separated by commas. This is required only if frequency is yearly. Valid range is 1 to 12.

end_time - Specify the end time for health check executions (optional).

If not specified, health checks will run indefinitely.

grace_period - Specify the grace period in minutes (optional).

If the value are set to false, Prechecks will not be executed.

-database_lag_checks Run database lag checks as part of Prechecks for all Data Guard configured databases. This parameter is optional.

The default value is true.

-notify Specify whether you want to be notified about the health-check report.

If set to true, health check execution report are sent to the specified email address.

This parameter is optional.

-email Specify the email address that needs to be used for notification of health-check report. This email address must be a configured email address for the current user.

This parameter is optional.


Example 7-29 Scheduling Oracle Site Guard Health Checks

emcli schedule_siteguard_health_checks 
           -operation_plan="austin-switchover"
           -schedule="start_time:2014/06/10 15:45"                                             
emcli schedule_siteguard_health_checks 
           -operation_plan="austin-switchover" 
           -schedule="start_time:2014/10/29 2:00;frequency:interval;repeat:1d"

emcli schedule_siteguard_health_checks 
           -operation_plan="austin-failover" 
           -schedule="start_time:2014/08/10 01:00;frequency:interval;repeat:1w"
                                             emcli schedule_siteguard_health_checks 
           -operation_plan="austin-failover"
           -schedule="start_time:2014/08/10
                      1:00;frequency:weekly;days:6,7;grace period:60;tz:America/New_York" 

7.30 stop_siteguard_health_checks

Stops all future health check executions of an operation plan.

Format

emcli stop_siteguard_health_checks
        -operation_plan="name_of_the_operation_plan"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-operation_plan Specify the name of the operation plan for which health check executions has to be stopped.

Example 7-30 Stopping Oracle Site Guard Health Checks

emcli stop_siteguard_health_checks 
         -operation_plan="austin-switchover" 

7.31 submit_operation_plan

Submits the specified operation plan for execution.

Format

emcli submit_operation_plan
         -name="name_of_operation_plan"
         [-run_prechecks="true | false"]
         [-stop_primary="flag_specifying_whether_primary_site_to_be_stopped_during_failover"]
         [-database_lag_checks="true"|"false"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-name Specify the name of the operation plan.
-run_prechecks Specify the run_prechecks value (true or false).

By default, the value of this parameter is true.

If you set the value to false, Prechecks will not be executed.

-stop_primary Specify whether to stop targets on primary site during a Failover operation. Set value true or false.
-database_lag_checks Run database lag checks as part of Prechecks for all Data Guard configured databases. This parameter is optional.

The default value is true.


Example 7-31 Submitting Operation Plan

emcli submit_operation_plan 
         -name="example-switchover"
         -database_lag_checks="false"

emcli submit_operation_plan 
         -name="example-switchover"
         -run_prechecks="false"

7.32 update_operation_plan

Updates the Error Mode and Run Mode for any step in the given operation plan.

Format

emcli update_operation_plan
         -name="operation_plan_name"
         -step_number="step_number"
         -target_host="host_name"
         -target_name="target_name"
         [error_mode="error_mode"]
         [enabled="true" or "false"]
         [-execution_mode="Serial" or "Parallel"]
         [-move="up"or"down"]
         [-delete="true" or "false"]  

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-name Specify the name of the operation plan.
-step_number Specify the number of the step that should be updated.
-target_host Specify the name of the system. Specifying this will update all the steps related to this target host.
-target_name Specify the database target name.
-error_mode The function of the operation. For example: stop or continue.
-enabled Enter true or false.
-execution_mode Specify the execution mode. For example: Serial or Parallel
-move Change the order by specifying Up or Down.
-delete Specify whether you want to delete steps. Specify true or false.

Example 7-32 Updating an Operation Plan

emcli update_operation_plan
         -name="austin-switchover"
         -step_number="1"
         -error_mode="Continue"
         -enabled="true"
         -execution_mode="Serial" 

emcli update_operation_plan 
         -name="austin-switchover" 
         -step_number="5" 
         -move="Up" 

emcli update_operation_plan
         -name="austin-switchover"
         -target_host="myhost.domain.com"
         -error_mode="Continue"
         -enabled="true"

emcli update_operation_plan
         -name="example-switchover"
         -target_name="/Farm1/MyDomain"
         -delete="true"

7.33 update_siteguard_configuration

Updates the Oracle Site Guard configuration to add additional standby systems. One primary system can be associated with one or more standby systems.

Format

emcli update_siteguard_configuration
         -primary_system_name="primary_system_name"]
         -standby_system_name="standby_system_name"]
         [-reverse_role="flag_specifying_whether_system_roles_to_be_reversed"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-primary_system_name Specify the name of the primary system.
-standby_system_name Specify the name of the standby system. This parameter can be specified more than once.
-reverse_role Specify whether to reverse role of site from standby to primary. Enter true or false.

If this option is specified, only one standby system name can be submitted using parameter -standby_system_name. The default value is false.


Example 7-33 Updating Site Guard Configuration

emcli update_siteguard_configuartion 
         -primary_system_name="austin-system"
         -standby_system_name="austin2-system"

emcli update_siteguard_configuration 
         -primary_system_name="austin-system" 
         -standby_system_name="austin2-system" 
         -reverse_role 

7.34 update_siteguard_credential_association

Updates the credential association.

Format

emcli update_siteguard_credential_association
         -system_name="name_of_the_system"
         [-target_name="name_of_the_target"]
         -credential_type="type_of_the_credential"
         [-credential_name="name_of_the_credential"]
         [–use_preferred_credential="true_or_false"]
         -credential_owner="credential_owner"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the name of the system.
-target_name Specify the name of the target. This parameter is optional.
-credential_type Specify the type of the credential. It can be HostNormal, HostPrivileged, WLSAdmin, or DatabaseSysdba.
-credential_name Specify the name of the credential.
–use_preferred_credential If you are using Preferred Credentials, then specify true. The default value is false. If you specify the default value, then you must specify the -credential_name parameter to use named credentials.
-credential_owner Specify the owner of the credential.

Example 7-34 Updating Site Guard Credential Association

emcli update_siteguard_credential_association
         -credential_type="HostNormal"
         -credential_name="HOST-SGCRED"
         -credential_owner="sysman"

emcli update_siteguard_credential_association
         -credential_type="HostPrivileged"
         -use_preferred_credential="true"
         -credential_owner="sysman"
         
emcli update_siteguard_credential_association
         -target_name="austin-database-instance"
         -credential_type="DatabaseSysdba"
         -credential_name="HOST-DBCRED"
         -credential_owner="sysman"

7.35 update_siteguard_lag

Updates the values of Apply Lag and Transport Lag threshold for one or more Data Guard enabled databases of the system.

Format

emcli update_siteguard_lag
        -system_name="system_name"
        [-target_name="database_target_name"]
        -property_name="lag_type"
        -value="max_limit"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name Specify the system for which you want to configure the threshold limit.
-target_name Specify the database target name for which the threshold limit is configured. If this parameter is not specified, then the threshold value is applied to all databases of the system.
-property_name Specify the property name. Valid values are ApplyLag and TransportLag.
-value Specify the threshold value to be updated (in seconds).

Example 7-35 Updating Values of Apply Lag and Transport Lag

emcli update_siteguard_lag 
       -system_name="example-system"
       -property_name="ApplyLag"
       -value="1000"
 
emcli update_siteguard_lag 
       -system_name="example-system"
       -target_name="OID_db"
       -property_name="TransportLag"
       -value="2500"

7.36 update_siteguard_script

Updates the path and the all_hosts flag associated with any script.

Format

emcli update_siteguard_script
         -script_id="ID_associated_with_the_script"
         -path="path_of_the_script"
         [-component="path of the entity in Software library"]
         -runtime_script="flag_to_specify_if_prechecks_to_check_availability_of_the_script"
         –credential_type="type_of_credential"
         [-host_name="name_of_the_host_where_this_script_will_run"]
         [-run_on="flag_specifying_the_host"]
         [-all_hosts="true" or "false"]
         [-target_storage_credential_name="target_storage_credential"]         [-source_storage_credential_name="source_storage_credential"]         [-credential_owner="credential_owner"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-script_id Specify the script ID.
-path Specify the path to the script.
-component Specify the path to the entity in the software library. If the values for this parameter are specified, the path should contain only the file name and its parameters.
-runtime_script Specify whether the script is a runtime script. If a script is designated as a runtime script, Precheck does not verify the script. This option can be used when the script is dynamically mounted or generated as part of execution of an operation plan.

By default, all scripts staged from the software library are designated as runtime scripts.

The default value for scripts that are not staged from the software library, is false.

–credential_type Specify HostNormal or HostPrivileged if you have root privileges.
-credential_name Specify the name of the credential. If no value is specified, then the values for the parameter credential_type must be specified.
-host_name Name of the host where this script will be run.

This parameter is optional and can be specified more than once.

-run_on Specify whether the script needs to be executed on only one of the available hosts (any) or on all hosts (all).

This parameter is optional and default value is all.

-all_hosts Optional flag to allow the script to run on all the hosts in the system. For example: true or false.
-target_storage_credential_name Specify named credential for target storage.

If target_storage_credential_name is specified then source_storage_credential_name and credential_owner must be specified.

-source_storage_credential_name Specify named credential for source storage.

If source_storage_credential_name is specified then target_storage_credential_name and credential_owner must be specified.

-credential_owner Specify owner of the credential.

If target_storage_credential_name and source_storage_credential_name are specified, then credential_owner must be specified.


Example 7-36 Updating Site Guard Script

emcli update_siteguard_script 
             -script_id="10"
             -path="/tmp/script"
             -all_hosts="true"
 
emcli update_siteguard_script 
             -script_id="10"
             -path="stop_mycomponent.sh"
             -component="/Components/MyScripts/LCM_Operations"              -all_hosts="true"

emcli update_siteguard_script 
          -script_id="10" 
          -host_name="host1.domain.com" 
          -host_name="host2.domain.com" 
          -run_on="any" 
                                                 emcli update_siteguard_script 
          -script_id="10" 
          -all_hosts="false" 
          -credential_name="MY_NAMED_HOST_CREDENTIAL" 
          -host_name="host1.domain.com" 
                                                 emcli update_siteguard_script 
          -script_id="16" 
          -path="/tmp/script" 
          -credential_type="HostPrivileged" 
          -runtime_script="true" 
                                                 emcli update_siteguard_script 
          -script_id="20" 
          -path="/tmp/script" 
          -all_hosts="true" 
          -target_storage_credential_name="SGCRED-TARGET-STORAGE" 
          -source_storage_credential_name="SGCRED-SOURCE-STORAGE" 
          -credential_owner="sysman"