7 Oracle Site Guard Command-Line Interface

Oracle Site Guard uses the Enterprise Manager Command Line Interface (EMCLI) to manage Site Guard configuration from the command line, or from batch programs or scripts.

This chapter lists the following EM CLI commands used for configuring Site Guard:

Note:

EMCLI commands are case-sensitive.

For more information about EMCLI, see Oracle Enterprise Manager Command Line Interface.

7.1 add_operation_plan_tags

Adds tags to the operation plan.

A tag allows grouping and searching operation plans across sites.

Format

emcli add_operation_plan_tags
          -plan_name="Name of the operation plan"
          -tags="names of the tags separated by ;"
Parameter Description
-plan_name Name of the operation plan
-tags Semicolon-separated list of tags to be added to the operation plan. The comma (,) is an invalid character.

Example 7-1 Adding Operation Plan Tags

emcli add_operation_plan_tags -plan_name="austin-switchover-plan" -tags="rack1_austin;created_by_john" 

emcli add_operation_plan_tags -plan_name="austin-switchover-plan" -tags="created_by_john"

7.2 add_siteguard_aux_hosts

Associates new auxiliary hosts to 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

add_siteguard_aux_hosts 
          -system_name="sytem name"
          -host_name="host name"
Parameter Description
-system_name Name of the system.
-host_name Name of the host.

Example 7-2 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.3 add_siteguard_script_credential_params

Adds a named credential as a parameter for a 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 The script ID.
-credential_name The name of the credential.
-credential_owner The credential owner details. You need not The values of this parameter if the owner of the credential is same as that of the logged in user.

Example 7-3 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.4 add_siteguard_script_hosts

Adds a host to the 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 The identification associated with the script.
-host_name The host that you want to associate with the script. You can specify more than one host name.

Example 7-4 Adding Hosts

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

7.5 configure_siteguard_lag

Configures limit for Apply Lag and Transport Lag for one or all databases in a Site Guard system.

Format

emcli configure_siteguard_lag
        -system_name="system_name"
        -property_name="apply_lag or transport_lag"
        -value="maximum_lag_limit_in_seconds"
        [-target_name="database_target_name"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name The system on which you want to configure the threshold limit.
-property_name The property name. Valid values are apply_lag and transport_lag.
-value The threshold value to be configured (in seconds).
-target_name 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.

Example 7-5 Configuring Apply Lag and Transport Lag

emcli configure_siteguard_lag 
       -system_name="example-system"
       -property_name="apply_lag"
       -value="1000"
 
emcli configure_siteguard_lag 
       -system_name="example-system"
       -target_name="OID_db"
       -property_name="transport_lag"
       -value="2500"

7.6 create_operation_plan

Creates a new Site Guard operation plan.

Format

emcli create_operation_plan
         -system_name="name_of_the_system"
         [-primary_system_name="name_of_primary_system"]
         [-standby_system_name="name_of_standby_system"]
         [-operation="name_of_the_operation"]
         [-plan_name="name_of_the_operation_plan"]
         [-like="name_of_the_operation_plan_from_which_the_steps_are_to_be_copied"]
                 [-tags=list of tags separated by ; ]
         

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name The name of the system. This option is used for start or stop operations.
-primary_system_name The name of your system associated with the primary site. This option is used for switchover or failover operations.
-standby_system_name The name of your system associated with the standby site. This option is used for switchover or failover operations.
-operation The function of the operation. Example: switchover, failover, start or stop.
-plan_name The name of the operation plan.
-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.
-tags A semicolon-separated list of tags to delete from the operation plan. The comma (,) is an invalid character.

Example 7-6 Creating Operation Plans

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.7 create_siteguard_configuration

Creates a Site Guard configuration.

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 The name of the primary site system.
-standby_system_name The name of the standby system. May be specified more than once.

Example 7-7 Creating Site Guard Configurations

emcli create_siteguard_configuration 
         -primary_system_name="example1"

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

7.8 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"
         -credential_type="type_of_credential"
         -credential_owner="owner"
         [-target_name="name_of_the_target"]
         [-credential_name="name"]
         [–use_preferred_credential="true_or_false"]

Note:

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

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

–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 The -credential_name parameter to use named credentials.

Example 7-8 Creating Site Guard Credential Associations

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.9 create_siteguard_script

Create scripts (Pre Script, Post Script and storage script) for the 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"
         -path="path_of_the_script"
         -role="role_associated_with_the_system"
         [-host_name="name_of_the_host_where_the_scripts_are_run"]
         [-component="path_of_the_entity_in_software_library"] 
         [-runtime_script="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"]
         [-credential_type="type_of_the_credential"]
         [-credential_name="name_of_the_credential"] 
         [-credential_owner="credential_owner"]

Note:

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

Switchover, Failover, Start, or Stop.

-script_type 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.
-path The path to the script.
-role 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.
-host_name The name of the host where this script will be executed. Can be specified more than once.
-component The path to the entity in the software library. If component is specified, path should contain only the file name and its parameters.
-runtime_script The value is 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.

-run_on Whether the script needs to be executed on only one of the available hosts (enter any) or on all hosts (enter all). Default value is all.
-all_hosts Flag to allow the script to run on all the hosts in the system. This parameter overrides the host_name. Enter true or false.
–credential_type Specify HostNormal or HostPrivileged if you have root privileges.
-credential_name 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.

-credential_owner 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-9 Creating Site Guard Scripts

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.10 delete_operation_plan

Deletes a Site Guard operation plan.

Format

emcli delete_operation_plan
         -plan_name="name_of_operation_plan"
Parameter Description
-plan_name The operation plan to delete.

Example 7-10 Deleting Operation Plans

emcli delete_operation_plan 
         -plan_name="austin-switchover"

7.11 delete_operation_plan_tags

Deletes tags to the operation plan. A tag allows grouping and searching of operation plans across sites.

Format

emcli delete_operation_plan_tags        -plan_name="Name of the operation plan"        [-tags="names of the tags separated by ;"]        [-all="names of the tags separated by ;"]
Parameter Description
-plan_name The name of the operation plan.
-tags A semicolon-separated list of tags to delete from the operation plan. The comma (,) is an invalid character.
-all If specified, all tags of the operation plan are deleted. This value overrides any choices passed to the tags argument.

Example 7-11 Deleting Operation Plan Tags

emcli delete_operation_plan_tags -plan_name="austin-switchover-plan" -tags="rack1_austin;created_by_john"

emcli delete_operation_plan_tags -plan_name="austin-switchover-plan" -all

7.12 delete_siteguard_aux_host

Deletes an auxiliary host associated with a Site Guard 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 The system on which you are performing the operation.
-host_name The name of the auxiliary host to delete. If it is not specified, then all auxiliary hosts associated with the system are deleted.

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


Example 7-12 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.13 delete_siteguard_configuration

Deletes a 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.

Formata

emcli delete_siteguard_configuration
        [-primary_system_name="name_of_the_primary_system"]
        [-standby_system_name="name_of_the_standby_system"]
        [-force="delete all Site Guard stale configurations"]

Note:

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

Example 7-13 Deleting Site Guard Configurations

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.14 delete_siteguard_credential_association

Deletes a credential association from the Site Guard configuration.

Format

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

Note:

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

Example 7-14 Deleting Site Guard Credential Associations

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

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

7.15 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"
         -property_name="lag value"
         [-target_name="database target name"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name The system for which you want to configure the threshold limit.
-property_name The property name. Valid values are apply_lag and transport_lag.
-target_name The name of the target database 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.

Example 7-15 Deleting Apply Lag and Transport Lag

emcli delete_siteguard_lag 
       -system_name="austin-system"
       -property_name="apply_lag"
 
emcli delete_siteguard_lag 
       -system_name="austin-system"
       -target_name="OID_db"
       -property_name="transport_lag"

7.16 delete_siteguard_script

Deletes a script from the Site Guard configuration.

Format

emcli delete_siteguard_script
         -script_id="script id"
Parameter Description
-script_id The ID associated with the script.

Example 7-16 Deleting Site Guard Scripts

emcli delete_siteguard_script 
         -script_id="10"

7.17 delete_siteguard_script_credential_params

Deletes a named credential that is a parameter to a 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 The ID associated with the script.
-credential_name The name of the credential. If this argument is not specified, all credentials associated with the script will be deleted.
-credential_owner 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-17 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.18 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"
Parameter Description
-script_id The ID associated with the script.
-host_name The name of the host where this script will be executed.

This parameter can be specified more than once.


Example 7-18 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.19 get_operation_plan_details

Provides the step-by-step information for an operation plan.

Format

emcli get_operation_plan_details
         -plan_name="plan_name"
Parameter Description
-plan_name The name of the operation plan.

Example 7-19 Obtaining Operation Plan Details

emcli get_operation_plan_details 
         -plan_name="austin-switchover"

7.20 get_operation_plans

Lists all configured Site Guard operation plans.

Format

emcli get_operation_plans        [-plan_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"]
        [-tags="tag names separated by ; ]"

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-plan_name The name of the operation plan.
-operation The name of the operation. For example, switchover, failover, start, or stop. If you do not specify this parameter, then all the operation plans will be listed.
-system_name The name of system used in the operation plan. If you These values, then the values for -primary_system_name and -standby_system_name need not be specified.
-primary_system_name The name of primary system used in the operation plan. You can 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 The name of the standby system used in the operation plan. You can 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.
-tags Semicolon-separated list of tags to be added to the operation plan. The comma (,) is an invalid character.

Example 7-20 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"

emcli get_operation_plans
        -tags="rack1_austin"

Output Columns

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

7.21 get_siteguard_aux_hosts

Get a list of all auxiliary hosts associated with a Site Guard system.

Format

emcli get_siteguard_aux_hosts
       -system_name="system_name"
Parameter Description
-system_name The system on which you are performing the operation.

Example 7-21 Listing Auxiliary Targets

emcli get_siteguard_supported_targets 
       -system_name="example-system"

7.22 get_siteguard_configuration

Provides the Site Guard configuration.

Format

emcli get_siteguard_configuration
         [-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
-system_name The name of the system used in the operation plan. If this is specified, then -primary_system_name and -standby_system_name should not be specified.
-primary_system_name The name of the primary system.
-standby_system_name The name of the standby system.

Output Columns

Primary System, Standby System(s)

Example 7-22 Obtaining Site Guard Configurations

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

emcli get_siteguard_configuration 
         -system_name="austin-system"

7.23 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 The name of the system.
-target_name The name of the target.
-credential_type The type of the credential. One of HostNormal, HostPrivileged, NodeManager, WLSAdmin, or DatabaseSysdba.

Output Columns

Target Name, Credential Name, Credential Type.

Example 7-23 Obtaining Site Guard Credential Associations

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

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

7.24 get_siteguard_health_checks

Displays the schedule of health checks for an operation plan.

Format

emcli get_siteguard_health_checks
         -plan_name="name_of_the_operation_plan"
Parameter Description
-plan_name The name of the operation plan for which schedule of health checks has to be displayed.

Example 7-24 Obtaining Site Guard Health Checks

emcli get_siteguard_health_checks 
         -plan_name="austin-switchover"

7.25 get_siteguard_lag

Retrieves configured limit for apply_lag and transport_lag for one or all databases of a system.

Format

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

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name The name of the system.
-property_name The name of the property. Valid values are apply_lag and transport_lag.
-target_name The name of the database. If the database name is not specified, the property is obtained for all databases in the system.

Example 7-25 Obtaining Site Guard Lags

emcli get_siteguard_lag
         -system_name="austin-system"
         -property_name="apply_lag"

emcli get_siteguard_lag
         -system_name="austin-system"
         -target_name="OID_db"
         -property_name="transport_lag"

7.26 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 The ID associated with the script.
-credential_name The name of the credential. If this argument is not specified, all credentials associated with the script will be deleted.
-credential_owner 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-26 Getting 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.27 get_siteguard_script_hosts

Lists the hosts in a Guard Site script.

Format

emcli get_siteguard_script_hosts
         -script_id="script_id"
Parameter Description
-script_id The ID associated with the script.

Output Columns

Host Name

Example 7-27 Obtaining Site Guard Script Hosts

emcli get_siteguard_script_hosts 
         -script_id="10"

7.28 get_siteguard_scripts

Gets the 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 The name of the system.
-operation The name of the operation. One of switchover, failover, start, or stop.
-script_type The type of the script. One of mount, unmount, pre-script, post-script, global pre-script, global post-script, storage-failover, or storage-switchover.
-role Filters the scripts based on the role associated with the system. One of Primary or Standby.

Output Columns

Script ID, Type, Operation, Path, Role.

Example 7-28 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.29 get_siteguard_supported_targets

Gets the list of all Site Guard supported targets in a 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 The name of the system.
-target_type The type of the target.

Example 7-29 Getting Supported Targets

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.30 run_prechecks

Runs a Site Guard Precheck for an operation plan.

Format

emcli run_prechecks
         -plan_name="name_operation_plan"
         [-database_lag_checks="true or false"]

Note:

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

Example 7-30 Running Prechecks

emcli run_prechecks 
          -plan_name="austin-switchover"
         
emcli run_prechecks 
          -plan_name="austin-switchover"
          -database_lag_checks="true"

7.31 schedule_siteguard_health_checks

Schedules health checks for an operation plan.

Format

emcli schedule_siteguard_health_checks
        -plan_name="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="whether_to_send_email_notifications"] 
             [-email="email_address_to_be_notified"]

Note:

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

start_time - The time when health checks have to start executing.

tz - The time-zone ID.

frequency - Valid values are once/interval/weekly/monthly/yearly.

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 - The frequency with which health checks have to be repeated. This is mandatory only if frequency is set to interval.

days - 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 - The list of months separated by commas. This is required only if frequency is yearly. Valid range is 1 to 12.

end_time - The end time for health check executions.

If not specified, health checks will run indefinitely.

grace_period - The grace period in minutes.

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

-notify 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.

-email 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.

Example 7-31 Scheduling Site Guard Health Checks

emcli schedule_siteguard_health_checks 
           -plan_name="austin-switchover"
           -schedule="start_time:2014/06/10 15:45"                                             
emcli schedule_siteguard_health_checks 
           -plan_name="austin-switchover" 
           -schedule="start_time:2014/10/29 2:00;frequency:interval;repeat:1d"
           -notify
           -email="admin@example.com"

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

7.32 stop_siteguard_health_checks

Stops all future health check executions of an operation plan.

Format

emcli stop_siteguard_health_checks
        -plan_name="name_of_the_operation_plan"
Parameter Description
-plan_name The name of the operation plan for which health check executions has to be stopped.

Example 7-32 Stopping Site Guard Health Checks

emcli stop_siteguard_health_checks 
         -plan_name="austin-switchover" 

7.33 submit_operation_plan

Submits an operation plan for execution.

Format

emcli submit_operation_plan
         -plan_name="name_of_operation_plan"
         [-disable_run_prechecks="whether_or_not_to_run_prechecks"]
         [-stop_primary="whether_to_stop_the_primary_site_during_failover"]
         [-database_lag_checks="whether to run database lag checks"]
         [-database_trace_enable="whether to enable database tracing"]
         [-database_immediate_failover="whether to fail over the database immediately"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-plan_name The name of the operation plan.
-disable_run_prechecks Not to run prechecks. One of true or false.
-stop_primary Whether to stop targets on primary site during a Failover operation. One of true or false.
-database_lag_checks Run database lag checks as part of Prechecks for all Data Guard configured databases. One of true or false.
-database_trace_enable Send additional database trace messages to logs during Switchover or Failover operations. One of true or false.
-database_immediate_failover Fail over the database immediately and do not apply redo logs. One of true or false.

Example 7-33 Submitting Operation Plans

emcli submit_operation_plan 
         -plan_name="example-switchover"

emcli submit_operation_plan 
         -plan_name="example-switchover"
         -disable_run_prechecks

emcli submit_operation_plan 
         -plan_name="austin-switchover"
         -disable_run_prechecks="true"
         -database_trace_enable="true"

emcli submit_operation_plan 
         -plan_name="austin-switchover"
         -database_lag_checks="true"

emcli submit_operation_plan 
         -plan_name="austin-failover"
         -stop_primary="true"
         -database_immediate_failover="true"

7.34 update_operation_plan

Updates a Site Guard operation plan.

Format

emcli update_operation_plan
        -plan_name="name of the plan"        -step_number="plan step number to update"
        -target_host="name of the target host"
        -target_name="name of the target"
        [-error_mode="the error mode"]
        [-enabled="flag specifying whether the step should be enabled"]
        [-execution_mode="execution mode"]
        [-execution_group="when execution_mode is parallel, then targets sharing the same execution group will execute in parallel"]
        [-timeout="timeout in seconds"]
        [-move="direction in which to move step"]
        [-delete "whether step should be deleted"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-plan_name The name of the operation plan.
-step_number The number of the step that should be updated.
-target_host The name of the system. Specifying this will update all the steps related to this target host.
-error_mode The function of the operation. One of stop or continue.
-enabled One of true or false.
-execution_mode The execution mode. One of Serial or Parallel.
-execution_group The execution group of the target, all members of which to be executed in parallel, an integer between 1 and 10 with each group executed sequentially.
-timeout Timeout in seconds for the execution of the step, between 1 second and 86400 seconds (24 hours).
-move Change the order. One of Up or Down.
-delete Whether you want to delete steps. One of true or false.

Example 7-34 Updating an Operation Plans

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

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.35 update_siteguard_configuration

Updates the 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="whether_to_reverse_system_roles"]
         [-role="new role of standby system"]

Note:

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

If this option is specified, only one standby system name can be submitted in the -standby_system_name parameter.

-role The new role of the standby system. One of Primary, Standby, or ValidateStandby.

If this option is specified, only one standby system name can be specified using -standby_system_name.

If Primary is specified, roles of primary and standby systems will be swapped.

If Standby is specified, role of standby system will be updated from Validate Standby to Standby.

If Validate Standby is specified, role of standby system will be updated from Standby to Validate Standby.


Example 7-35 Updating Site Guard Configurations

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

emcli update_siteguard_configuration 
         -primary_system_name="austin-system"
         -standby_system_name="utah-system" 
         -role="ValidateStandby"

7.36 update_siteguard_credential_association

Updates the credential association.

Format

emcli update_siteguard_credential_association
         -system_name="name_of_the_system"
         -credential_type="type_of_the_credential"
         -credential_owner="credential_owner"
         [-target_name="name_of_the_target"]
         [-credential_name="name_of_the_credential"]
         [–use_preferred_credential="whether to use a preferred credential"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name The name of the system.
-target_name The name of the target.
-credential_type The type of the credential. It can be HostNormal, HostPrivileged, WLSAdmin, or DatabaseSysdba.
-credential_name The name of the credential.
–use_preferred_credential If you are using Preferred Credentials, then specify true. If use_preferred_credential is false, then you must specify credential_name.
-credential_owner The owner of the credential. You need not specify this argument if the owner of the credential is same as logged in user.

Example 7-36 Updating Site Guard Credential Associations

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.37 update_siteguard_lag

Updates the values of apply lag and transport lag threshold for one or all databases of a system.

Format

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

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-system_name The system for which you want to configure the threshold limit.
-target_name 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 The property name. Valid values are apply_lag and transport_lag.
-value The threshold value to be updated (in seconds).

Example 7-37 Updating Apply Lag and Transport Lag

emcli update_siteguard_lag 
       -system_name="example-system"
       -property_name="apply_lag"
       -value="1000"
 
emcli update_siteguard_lag 
       -system_name="example-system"
       -target_name="OID_db"
       -property_name="transport_lag"
       -value="2500"

7.38 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="if_prechecks_to_check_availability_of_the_script"]
         [–credential_type="type_of_credential"]
         [-credential_name="name of the credential"]
         [-host_name="name_of_the_host_where_this_script_will_run"]
         [-run_on="whether to run on ANY or ALL hosts"]
         [-all_hosts="whether to run the script on all the hosts in the system"]
         [-credential_owner="credential_owner"]

Note:

[] indicates that the parameter is optional or conditionally optional.
Parameter Description
-script_id The script ID.
-path The path to the script.
-component 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 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 software library are designated as runtime scripts. Default value is false for scripts that are not staged from software library

–credential_type The type of the credential. One of HostNormal or HostPrivileged.
-credential_name 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. Can be specified more than once.
-run_on Whether the script needs to be executed on one of the available hosts (any) or on all hosts (all); default value is all.
-all_hosts Optional flag to allow the script to run on all the hosts in the system. Specify true or false. Overrides all values entered in the host_name parameter
-credential_owner The owner of the credential. This argument need not be specified if the owner of the credential is same as logged in user.

Example 7-38 Updating Site Guard Scripts

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"