7 Oracle Site Guard Command Line Interface

Manage Oracle Site Guard with Enterprise Manager Command Line Interface (EMCLI). EMCLI is a command line interface typically used in batch programs and scripts.

Note:

EMCLI commands are case-sensitive. For more information about EMCLI, see Oracle Enterprise Manager Command Line Interface.

This chapter includes the following EMCLI commands:

7.1 add_operation_plan_tags

A tag allows you to group and search operation plans across sites.

EMCLI command that adds tags to an operation plan.

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.

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_site_properties

Adds user-defined properties to a site. Each property consists of a name and value associated with a site. Through Site Properties you can group and search for sites that share common attributes.

Format

emcli add_site_properties
          -system_name="Name of the system (site)"
          -properties="property name=value pairs separated by ;"
Parameter Description

-system_name

Name of the generic system (site).

-properties

Semicolon (;) separated list of property name=value pairs to be added to the site.

Example

emcli add_site_properties -system_name="austin-system" -properties="customer=acme corp; data center=austin dc"
emcli add_site_properties -system_name="utah-system" -properties="rack=08-57wvx"

Note:

Site Properties name/value pairs are not case-sensitive. Name and value are each restricted to 256 characters in length.

7.3 add_siteguard_aux_hosts

An auxiliary host is a host that is not part of the system but is managed by Oracle Enterprise Manager Cloud Control.

EMCLI command that adds an auxiliary host to an Oracle Site Guard system.

Auxiliary hosts can execute any script. Other targets running on an auxiliary host are part of operation plans.

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.

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.4 add_siteguard_script_credential_params

The user name and password in a credential passed to a script can be accessed within the script.

EMCLI command that adds a named credential parameter to an Oracle Site Guard 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.

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.5 add_siteguard_script_hosts

Add one or more hosts to an Oracle Site Guard configuration script..

EMCLI command that adds a host to a configuration script. More than one host can added to a script.

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.

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

7.6 configure_siteguard_lag

Configure lag limits for databases in an Oracle Site Guard system.

EMCLI command that configures Apply Lag and Transport Lag for one or all databases in 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.

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

Create Oracle Site Guard operation plans.

EMCLI command that creates a new 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.

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"

See Also:

The get_operation_plans and submit_operation_plan commands.

7.8 create_siteguard_configuration

Create Oracle Site Guard configurations.

EMCLI command that creates a new 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.

emcli create_siteguard_configuration 
         -primary_system_name="example1"

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

7.9 create_siteguard_credential_association

Associate credentials with targets in a site.

EMCLI command that associates credentials with site targets.

Format

emcli create_siteguard_credential_association
         -system_name="name_of_the_system"
         -credential_type="type_of_credential"
         -credential_owner="credential_owner"
         [-target_name="name_of_the_target"]
         [-credential_name="name_of_the_credential"]
         [–use_preferred_credential="flag_to_use_preferred_credential"]

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. It can be: HostNormal, HostPrivileged, NodeManager, WLSAdmin, or DatabaseSysdba.

-credential_owner

The owner of the credential. This argument need not be specified if the owner of the credential is the same as the logged in user (Optional).

-target_name

The name of the target (Optional).

-credential_name

The name of the credential (Optional). If credential_name is not specified, then use_preferred_credential must be set to true.

–use_preferred_credential

Flag to use a preferred credential instead of a named credential (Optional). If use_preferred_credential is not true, then credential_name has to be specified.

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="utah-system" 
         -credential_type="HostPrivileged" 
         -use_preferred_credential 
         -credential_owner="sysman" 

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

7.10 create_siteguard_script

Create pre, post, and storage scripts for an Oracle Site Guard configuration.

EMCLI command that creates a script for a 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.

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

Delete an Oracle Site Guard operation plan.

EMCLI command that deletes an operation plan.

Format

emcli delete_operation_plan
         -plan_name="name_of_operation_plan"
Parameter Description

-plan_name

The operation plan to delete.

emcli delete_operation_plan 
         -plan_name="austin-switchover"

See Also:

The create_operation_plan and get_operation_plans commands.

7.12 delete_operation_plan_tags

Delete tags in Oracle Site Guard operation plans.

EMCLI command that deletes tags in an operation plan.

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

All tags of the operation plan are deleted. This value overrides any choices passed to the tags argument.

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.13 delete_site_properties

Deletes user-defined properties from a site. Specific properties being deleted must already be associated with a site.

Format

emcli delete_site_properties
         -system_name="Name of the system (site)"
         -properties="property names list separated by ;"
         -all
Parameter Description

-system_name

Name of the generic system (site)

-properties

Semicolon (;) separated list of property names to delete from the site.

-all

If this option is specified, all properties assigned to the site are deleted. This option overrides any choices made using the "-properties" option.

Examples

emcli delete_site_properties -system_name="austin-system" -properties="customer; data center"
emcli delete_site_properties -system_name="utah-system" -properties="rack"
emcli delete_site_properties -system_name="austin-system" -all

7.14 delete_siteguard_aux_host

Delete auxiliary hosts associated with an Oracle Site Guard system.

EMCLI command that deletes an auxiliary host associated with a 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.

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"

See Also:

The add_siteguard_aux_hosts and get_siteguard_aux_hosts commands.

7.15 delete_siteguard_configuration

Delete the entire configurations of a system and all associated standby systems..

EMCLI command that deletes an Oracle Site Guard configuration. This command deletes scripts, credential associations, site associations, and operation plans in a system and standby systems.

Format

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. A configuration can become stale if one or more sites involved in the configuration have been altered or deleted. Enter either true or false.

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

Delete credential associations from Oracle Site Guard configurations.

EMCLI command that deletes a credential association from a 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.

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.17 delete_siteguard_lag

Delete Apply Lag and Transport Lag thresholds for databases in your system.

EMCLI command that deletes Apply Lag and Transport Lag threshold configured values for one or more Oracle Data Guard enabled databases of a 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.

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.18 delete_siteguard_script

Delete scripts from an Oracle Site Guard configuration.

EMCLI command that deletes a script from a site configuration.

Format

emcli delete_siteguard_script
         -script_id="script id"
Parameter Description

-script_id

The ID associated with the script.

emcli delete_siteguard_script 
         -script_id="10"

7.19 delete_siteguard_script_credential_params

Delete a credential passed to an Oracle Site Guard script.

EMCLI command that deletes a named credential, which is passed as a parameter to a 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.

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.20 delete_siteguard_script_hosts

Delete hosts associated with an Oracle Site Guard script.

EMCLI command that deletes hosts associated with a 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.

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

7.21 get_operation_plan_details

Get details for your Oracle Site Guard operation plan.

EMCLI command that outputs complete and detailed information about an operation plan set up. When used in script mode, this command outputs details in JSON format.

Format

emcli get_operation_plan_details
         -plan_name="plan_name"
Parameter Description

-plan_name

The name of the operation plan.

emcli get_operation_plan_details 
         -plan_name="austin-switchover"

See Also:

The create_operation_plan and get_operation_planscommands.

7.22 get_operation_plans

List all your configured Oracle Site Guard operation plans.

EMCLI command that lists all configured operation plans for a site. The output incudes information such as the plan name, the operation name, the primary site name, the standby site name, and tags.

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.

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"

See Also:

The create_operation_plan and submit_operation_plancommands.

7.23 get_site_properties

A tag allows you to group and search operation plans across sites.

Lists user-defined properties assigned to a site, or lists sites that match the specified property names and values.

Format

emcli get_site_properties
          -system_name="Name of the system (site)"
          -properties="property names list or name=value pairs separated by ;"
Parameter Description

-system_name

Name of the generic system (site).

-properties

Semicolon (;) separated list of property names or name=value pairs to search for.

Example 1

The following example gets the values of specified property names for the specified site:

emcli get_site_properties -system_name="austin-system" -properties="customer; data center"

Example 2

The following example gets values of all properties for the specified site:

emcli get_site_properties -system_name="utah-system"

Example 3

The following example gets all sites matching to the specified properties:

emcli get_site_properties -properties="data center=austin dc; rack=11-935zxp"

7.24 get_siteguard_aux_hosts

List all auxiliary hosts for your Oracle Site Guard system.

EMCLI command that outputs the list of all auxiliary hosts associated with a system.

Format

emcli get_siteguard_aux_hosts
       -system_name="system_name"
Parameter Description

-system_name

The system on which you are performing the operation.

emcli get_siteguard_supported_targets 
       -system_name="example-system"

7.25 get_siteguard_configuration

List the details of your Oracle Site Guard configuration.

EMCLI command that outputs a configuration set up. The output includes the details of the configuration for the primary and standby sites.

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.

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

emcli get_siteguard_configuration 
         -system_name="austin-system"

7.26 get_siteguard_credential_association

List all credentials configured for your system.

EMCLI command that lists the credential associations configured for a system. The output includes target names, credential name, and credential types.

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.

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.27 get_siteguard_health_checks

Get the schedule of health checks for your operation plan.

EMCLI command that 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.

emcli get_siteguard_health_checks 
         -plan_name="austin-switchover"

7.28 get_siteguard_lag

Get the limits configured for lags in your database systems.

EMCLI command that retrieves configured limits for the apply_lag and transport_lag lags 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.

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.29 get_siteguard_script_credential_params

Get all credentials used as parameters for an Oracle Site Guard script.

EMCLI command that outputs all the credential parameters for a 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.

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

List all hosts associated with your Oracle Site Guard script.

EMCLI command that lists the hosts used in a script. The output includes host names.

Format

emcli get_siteguard_script_hosts
         -script_id="script_id"
Parameter Description

-script_id

The ID associated with the script.

emcli get_siteguard_script_hosts 
         -script_id="10"

7.31 get_siteguard_scripts

List all Oracle Site Guard scripts in your system.

EMCLI command that outputs the scripts associated with a system. The output incudes the script ID, the type, the operation, paths, and roles.

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.

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.32 get_siteguard_supported_targets

List all targets in your Oracle Site Guard system.

EMCLI command that outputs the list of all 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.

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

Run prechecks for your Oracle Site Guard operation plan.

EMCLI command that runs prechecks 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.

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

7.34 schedule_siteguard_health_checks

Schedule health checks for your operation plans.

EMCLI command that 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;"
         [-email="email_address_to_be_notified"]
                         [-notify_on_failure] If set, health check report will be emailed on failed execution only.                                                                                                               

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.

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

-notify_on_failure

If set, health check report will be e-mailed on failed execution only. (Optional).

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" 
                         -email="admin@example.com"
                         -notify_on_failure 
          
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.35 stop_siteguard_health_checks

Stop all heath check future executions in your Oracle Site Guard operation plan.

EMCLI command that stops health executions in 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.

emcli stop_siteguard_health_checks 
         -plan_name="austin-switchover" 

7.36 submit_operation_plan

Submit an Oracle Site Guard operation plan for execution.

EMCLI command that 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"]
         [-ignore_warnings]

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.

-ignore_warnings

Ignore non-fatal warnings when performing failovers.

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"

emcli submit_operation_plan
                    -plan_name="austin-failover"
                    -ignore_warnings

emcli submit_operation_plan
                    -plan_name="austin-failover"
                    -stop_primary -ignore_warnings 

See Also:

The create_operation_planand get_operation_planscommands.

7.37 update_operation_plan

Update you Oracle Site Guard operation plan.

EMCLI command that updates an 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.

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.38 update_site_properties

Updates existing user-defined properties assigned to a site. Property names being updated must already be assigned to that site. To add new properties, use emcli add_site_properties command.

Format

emcli update_site_properties         
          -system_name="Name of the system (site)"
          -properties="property name=value pairs separated by ;"
Parameter Description

-system_name

Name of the generic system (site).

-properties

Semicolon (;) separated list of property name=value pairs to be updated for the site.

Example

emcli update_site_properties -system_name="austin-system" -properties="customer=acme corp; data center=austin dc"
emcli update_site_properties -system_name="utah-system" -properties="rack=08-57wvx"

7.39 update_siteguard_configuration

Add additional standby systems to your primary system.

EMCLI command that adds standby systems to an primary system. 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 to add. 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.

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.40 update_siteguard_credential_association

Update Oracle Site Guard credential associations.

EMCLI command that updates a credential association for a system.

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.

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

7.41 update_siteguard_lag

Update lag thresholds for databases in your system.

EMCLI command that updates the apply lag and transport lag threshold values for one or all databases in 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).

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.42 update_siteguard_script

Update the path and flag associated with an Oracle Site Guard script.

EMCLI command that updates the path and the all_hosts flag associated with a 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.

Examples

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"