C Oracle Site Guard Command-Line Interface Reference

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

Note:

EM CLI commands are case-sensitive, ensure that you use the correct EM CLI verb and pass correct input.

This chapter lists all EM CLI verbs used for configuring Site Guard:

See:

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

C.1 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="name1;name2;..." 
Parameter Description

-script_id

Identification associated with the script.

-host_name

Host that you want to associate with the script. You can specify more than one host name.


Example C-1 Adding Hosts

emcli add_siteguard_script_hosts 
         -script_id="10" 
         -host_name ="BIHOST1;BIHOST2"

C.2 create_operation_plan

Creates an operational plan for Oracle Site Guard operation.

Format

emcli create_operation_plan
        -primary_system_name="name"
        -standby_system_name="name"
        -system_name="name"
        -operation="name"
        -name="name"
        -role=""role"
Parameter Description

-primary_system_name

Name of your system associated with the primary site. Enter this option for switchover or failover operations.

-standby_system_name

Name of your system associated with the standby site. Enter this option for switchover or failover operations.

-system_name

Name of the system. Enter this option for start or stop operations.

-operation

The function of the operation. Example: switchover, failover, start or stop.

-name

Name of the operation plan.

-role

Role associated with a system, when you run an operation (start or stop).


Example C-2 Creating Operation Plan

emcli create_operation_plan 
                      -primary_system_name="BISystem1"
                      -standby_system_name="BISystem2"
                      -operation="switchover"
                      -name="BISystem1-switchover-plan"
emcli create_operation_plan 
                      -system_name="austin"
                      -operation="start"
                      -name="BISystem1-start-plan"
                      -role="Primary"

C.3 create_siteguard_configuration

Creates a site configuration for Site Guard. It associates the systems and their roles.

Format

emcli create_siteguard_configuration
                                              -primary_system_name="name"
                      -standby_system_name="name1;name2;..."
Parameter Description

-primary_system_name

Name of the system that is associated with the primary site.

-standby_system_name

Name of the system that is associated with the standby system. You can specify more than one option and one system name.


Example C-3 Creating Site Guard Configuration

emcli create_siteguard_configuration 
                      -primary_system_name="BISystem1"
                      -standby_system_name="BISystem2"

C.4 create_siteguard_credential_association

Associates the credentials with the targets in a site.

Format

emcli create_siteguard_credential_association
                                              -system_name="name"
                     [-target_name="name"]
                              -credential_type="type"
                      -credential_name="name"
                      -credential_owner="owner"

[] indicates that the parameter is optional.

Parameter Description

-system_name

Name of the system.

-target_name

Name of the target. This parameter is optional.

-credential_type

Type of the credential. Example: HostNormal, HostPrivileged, WLSAdmin, or DatabaseSysdba.

-credential_name

Name of the credential.

-credential_owner

Owner of the credential.


Example C-4 Creating Site Guard Credential Association

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

emcli create_siteguard_credential_association 
                      -system_name="BIsystem1"
                      -target_name="database-instance"
                      -credential_type="HostNormal"
                      -credential_name="HOST-DBCRED"
                      -credential_owner="sysman"

C.5 create_siteguard_script

Associates scripts (pre-script, post script and storage script) with the SiteGuard configuration.

Format

emcli create_siteguard_script
                                              -system_name="name"
                      -operation="name"
                      -script_type="type"
                             [-host_name=["name1;name2;..."]
                      -path="path"
                     [-all_hosts=["true or false"]
                     [-role=["role"]
Parameter Description

-system_name

Name of the system.

-operation

Name of the operation. For example: Switchover, Failover, Start, or Stop.

-script_type

Type of the script. It can be Mount, UnMount, Pre-Script, Post-Script, Failover, or Switchover.

-host_name

Name of the host where this script will be run.

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

-path

Path to the script.

-all_hosts

Optional flag to allow the script to run on all the hosts in the system. This parameter overrides the host_name. For example: true or false.

-role

Optional flag to configure script based on the system role. By default, the script is configured for both primary and standby roles for a given system. For example: Primary or Standby.


Example C-5 Creating Site Guard Script

emcli create_siteguard_script 
                      -system_name="BISystem1"
                      -operation="Switchover"
                      -script_type="Pre-Script"
                      -path="/tmp/prescript"
                      -all_hosts="true"
                      -role="Primary"

emcli create_siteguard_script 
                      -system_name="BISystem1"
                      -operation="Switchover"
                      -script_type="Pre-Script"
                      -path="/tmp/prescript"
                      -host_name="BIHOST1"
                      -host_name="BIHOST2"

C.6 delete_operation_plan

Deletes the specified operation plan from a Site Guard configuration.

Format

emcli delete_operation_plan
        -name="plan_name"
Parameter Description

-name

Specify the name of the operation plan you want to delete.


Example C-6 Deleting the Operation Plan

emcli delete_operation_plan 
                      -name="BISystem1-switchover"

C.7 delete_siteguard_configuration

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

Format

emcli delete_siteguard_configuration
                                              -primary_system_name="name"
                      -standby_system_name="name"
Parameter Description

-primary_system_name

Name of the primary system. Specify either primary_system_name or standby_system_name.

-standby_system_name

Name of the standby system.


Example C-7 Deleting Site Guard Configuration

emcli delete_siteguard_configuartion 
                      -primary_system_name="BISystem1"

emcli delete_siteguard_configuration
                      -standby_system_name="BISystem2"

C.8 delete_siteguard_credential_association

Deletes the credential association from the Site Guard configuration.

Format

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

-system_name

Specify the system on which the service resides.

-credential_type

Specify the credential type. It can be HostNormal, HostPrivileged, WLSAdmin, or DatabaseSysdba.

-target_name

Name of the target. This parameter is optional.


Example C-8 Deleting Site Guard Credential Association

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

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

C.9 delete_siteguard_script

Deletes the specified script from the Site Guard configuration.

Format

emcli delete_siteguard_script
                             -script_id="script id"
Parameter Description

-script_id

ID associated with the script.


Example C-9 Deleting Site Guard Script

emcli delete_siteguard_script 
                      -script_id="10"

C.10 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="name1;name2;..."
Parameter Description

-script_id

ID associated with the script.

-host_name

Name of the host where this script will be run.

This parameter can be specified more than once.


Example C-10 Deleting Site Guard Script Hosts

emcli delete_siteguard_script_hosts 
                      -script_id="10"
                      -host_name="BIHOST1"

C.11 get_operation_plan_details

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

Format

emcli get_operation_plan_details
                                             -name="plan name"
Parameter Description

-name

Name of the operation plan.


Example C-11 Obtaining Operation Plan Details

emcli get_operation_plan_details 
                      -name="BISystem1-switchover"

C.12 get_operation_plans

Lists all configured operation plans.

Format

emcli get_operation_plans
                            -name="operation plan_name"
    -operation="operation_name"
Parameter Description

-name

Specify the name of the operation plan.

-operation

Specify the name of the operation. For example, switchover, failover, start, or stop.


Example C-12 Obtaining Operation Plans

emcli get_operation_plans 
                      -name="austin-switchover"
                      -operation="switchover"

C.13 get_siteguard_configuration

Provides the Site Guard configuration.

Format

emcli get_siteguard_configuration
                           [-primary_system_name={name of the primary system}]
   [-standby_system_name={name of the standby system}]
Parameter Description

-primary_system_name

Name of the primary system. This parameter is optional.

-standby_system_name

Name of the standby system. This parameter is optional.


Example C-13 Obtaining Site Guard Configuration

emcli get_siteguard_configuartion 
                      -primary_system_name="BISystem1"
                      -standby_system_name="BISystem2"

C.14 get_siteguard_credential_association

List 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}]
Parameter Description

-system_name

Name of the system.

-target_name

Name of the target. This parameter is optional.

-credential_type

Type of the credential. It can be HostNormal, HostPrivileged, WLSAdmin, or DatabaseSysdba.

This parameter is optional.


Example C-14 Obtaining Site Guard Credential Association

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

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

C.15 get_siteguard_script_hosts

lists the host or hosts associated with any script where the script is designated to run.

Format

emcli get_siteguard_script_hosts
         -script_id="script id" 
Parameter Description

-script_id

ID associated with the script.


Example C-15 Obtaining Site Guard Script Hosts

emcli get_siteguard_script_hosts 
         -script_id="10"

C.16 get_siteguard_scripts

Obtains 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}]
Parameter Description

-system_name

Name of the system.

-operation

Name of the operation. For example, switchover, failover, start, or stop.

-script_type

Type of the script. For example: mount, unmount, pre-script, post-script, failover, or switchover.

-role

(Primary/Standby). Optional parameter to filter the scripts based on the role associated with the system. For example: Primary or Standby.


Example C-16 Obtaining Site Guard Scripts

emcli get_siteguard_scripts
                      -system_name="BISystem1"
                      -operation="Switchover"
                      -script_type="Pre-Script"

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

C.17 run_prechecks

Submits the pre check operation for any given operation plan.

Format

emcli run_prechecks
                           -operation_plan="name_operation plan"
Parameter Description

-operation_plan

Name of the operation plan.


Example C-17 Running Prechecks

emcli run_prechecks 
                      -operation_plan="BISystem1-switchover"

C.18 submit_operation_plan

Submits the specified operation plan for execution.

Format

emcli submit_operation_plan
                            -name="name_operation plan"
   [-run_prechecks={true/false}]
Parameter Description

-name

Name of the operation plan.

-run_prechecks

Run prechecks (true or false). This parameter is optional.


Example C-18 Submitting Operation Plan

emcli submit_operation_plan
                      -name="austin-switchover"
                      -run_prechecks="true"

C.19 update_operation_plan

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

Format

emcli update_operation_plan
                            -name="operation plan_name"
   [-step_number={step number}]
   [-target_host={host name}]
   [error_mode={error mode}]
   [enabled={true/false}]
Parameter Description

-name

The name of the operation plan.

-step_number

Number of the step that should be updated.

-target_host

The name of the system. Enter this option for starting or stopping operation.

-error_mode

The function of the operation. For example: stop or continue.

-enabled

 

Example C-19 Updating an Operation Plan

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

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

C.20 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"
Parameter Description

-primary_system_name

Name of the primary system.

-standby_system_name

Name of the standby system. This parameter can be specified more than once.


Example C-20 Updating Site Guard Configuration

emcli update_siteguard_configuartion 
                      -primary_system_name="BISystem1"
                      -standby_system_name="BISystem2"

Note:

If you update the site configuration then you must update the operation plan, as described in update_operation_plan.

C.21 update_siteguard_credential_association

Updates the credential association.

Format

emcli update_siteguard_credential_association
                            -system_name="name of the system"
   [-target_name={name of the target}]
            -credential_type="type of the credential"
    -credential_name="name of the credential"
    -credential_owner="credential owner"
Parameter Description

-system_name

Name of the system.

-target_name

Name of the target. This parameter is optional.

-credential_type

Type of the credential. It can be HostNormal, HostPrivileged, WLSAdmin, or DatabaseSysdba.

-credential_name

Name of the credential.

-credential_owner

Owner of the credential.


Example C-21 Updating Site Guard Credential Association

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

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

C.22 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}]
   [-all_hosts={flag to let script run on all the hosts in the system}]
Parameter Description

-script_id

Script ID.

-path

Path to the script.

-all_hosts

Optional flag to allow the script to run on all the hosts in the system. For example: true or false.


Example C-22 Updating Site Guard Script

emcli update_siteguard_script 
                      -script_id="10"
                      -path="/tmp/newprescript"
                      -all_hosts="true"