Skip Headers
Oracle® Enterprise Manager Lifecycle Management Administrator's Guide
12c Release 2 (12.1.0.2)

Part Number E27046-08
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

F Oracle Site Guard Command-Line Interface Reference

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

Note:

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

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

See:

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

add_siteguard_script_hosts

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

Format

emcli add_siteguard_script_hosts
         -script_id="script_id"
         -host_name="name1;name2;..." 
Parameter Description
-script_id Specify the identification associated with the script.
-host_name Specify the host that you want to associate with the script. You can specify more than one host name.

Example F-1 Adding Hosts

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

create_operation_plan

Creates an operational plan for Oracle Site Guard operations.

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 Specify the name of your system associated with the primary site. Enter this option for switchover or failover operations.
-standby_system_name Specify the name of your system associated with the standby site. Enter this option for switchover or failover operations.
-system_name Specify the name of the system. Enter this option for start or stop operations.
-operation Specify the function of the operation. Example: switchover, failover, start or stop.
-name Specify the name of the operation plan.
-role Specify the role associated with a system, when you run an operation (start or stop).

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

create_siteguard_configuration

Creates a site configuration for Oracle 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 Specify the name of the system that is associated with the primary site.
-standby_system_name Specify the name of the system that is associated with the standby system. You can specify more than one option and one system name.

Example F-3 Creating Site Guard Configuration

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

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"
         [–use_preferred_credential="true_or_false"]

Note:

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

Example F-4 Creating Site Guard Credential Association

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

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


emcli create_siteguard_credential_association
         -system_name="BISystem1"
         -credential_type="HostNormal"
         -credential_owner="sysman"
         -use_preferred_credential="true"

create_siteguard_script

Associates scripts (pre-script, post script and storage script) with the Oracle Site Guard 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"]
         –credential_type="type"
         [-role="role"]

Note:

[ ] indicates that the parameter is optional.
Parameter Description
-system_name Specify the name of the system.
-operation Specify the name of the operation. For example: Switchover, Failover, Start, or Stop.
-script_type Specify the type of the script. It can be Mount, UnMount, Pre-Script, Post-Script, Failover, or Switchover.
-host_name Specify the name of the host where this script will be executed.

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

-path Specify the path to the script.
-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.
–credential_type Specify HostNormal or HostPrivileged if you have the root privileges.
-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 F-5 Creating Site Guard Script

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

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

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 F-6 Deleting the Operation Plan

emcli delete_operation_plan 
         -name="BISystem1-switchover"

delete_siteguard_configuration

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

Format

emcli delete_siteguard_configuration
         -primary_system_name="name"
        [-standby_system_name="name"]

Note:

[ ] indicates that the parameter is optional.
Parameter Description
-primary_system_name Specify the name of the primary system. Specify either primary_system_name or standby_system_name.
-standby_system_name Specify the name of the standby system. This parameter is optional. However, if you do not specify this parameter, the Oracle Site Guard configuration of the specified primary system and all its standby system are deleted.

Example F-7 Deleting Site Guard Configuration

emcli delete_siteguard_configuartion 
         -primary_system_name="BISystem1"

emcli delete_siteguard_configuration
         -standby_system_name="BISystem2"

delete_siteguard_credential_association

Deletes the credential association from the Oracle Site Guard configuration.

Format

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

Note:

[ ] indicates that the parameter is optional.
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 Specify the name of the target. This parameter is optional.

Example F-8 Deleting Site Guard Credential Association

emcli delete_siteguard_credential_association
         -system_name="BISystem1"
         -credential_type="HostNormal"

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

delete_siteguard_script

Deletes the specified script from the Oracle Site Guard configuration.

Format

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

Example F-9 Deleting Site Guard Script

emcli delete_siteguard_script 
         -script_id="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 Specify the ID associated with the script.
-host_name Specify the name of the host where this script will be executed.

This parameter can be specified more than once.


Example F-10 Deleting Site Guard Script Hosts

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

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 Specify the name of the operation plan.

Example F-11 Obtaining Operation Plan Details

emcli get_operation_plan_details 
         -name="BISystem1-switchover"

get_operation_plans

Lists all configured operation plans.

Format

emcli get_operation_plans
        [-name="operation_plan_name"]
        [-operation="operation_name"]

Note:

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

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


Example F-12 Obtaining Operation Plans

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

get_siteguard_configuration

Provides the Oracle Site Guard configuration.

Format

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

Note:

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

Example F-13 Obtaining Site Guard Configuration

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

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.
Parameter Description
-system_name Specify the name of the system.
-target_name Specify the name of the target. This parameter is optional.
-credential_type Specify the type of the credential. It can be HostNormal, HostPrivileged, WLSAdmin, or DatabaseSysdba.

This parameter is optional.


Example F-14 Obtaining Site Guard Credential Association

emcli get_siteguard_credential_association 
         -system_name="BISystem1"
         -credential_type="HostNormal"

emcli create_siteguard_credential_association 
         -system_name="BISystem1"
         -target_name="BI-database-instance"
         -credential_type="HostNormal"

get_siteguard_script_hosts

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

Format

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

Example F-15 Obtaining Site Guard Script Hosts

emcli get_siteguard_script_hosts 
         -script_id="10"

get_siteguard_scripts

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

Format

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

Note:

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

Example F-16 Obtaining Site Guard Scripts

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

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

run_prechecks

Submits the prechecks for any given operation plan.

Format

emcli run_prechecks
          -operation_plan="name_operation plan"
Parameter Description
-operation_plan Specify the name of the operation plan.

Example F-17 Running Prechecks

emcli run_prechecks 
          -operation_plan="BISystem1-switchover"

submit_operation_plan

Submits the specified operation plan for execution.

Format

emcli submit_operation_plan
         -name="name_operation plan"
         [-run_prechecks="true_or_false"]

Note:

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

By default, the value of this parameter is true.

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


Example F-18 Submitting Operation Plan

emcli submit_operation_plan
         -name="austin-switchover"

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_or_false"]
         [-execution_mode="Serial_or_Parallel"]
         [-move="Up_or_Down"] 

Note:

[ ] indicates that the parameter is optional.
Parameter Description
-name Specify the name of the operation plan.
-step_number Specify the number of the step that should be updated.
-target_host Specify the name of the system. Enter this option for starting or stopping operation.
-error_mode The function of the operation. For example: stop or continue.
-enabled Enter true or false.
-execution_mode Specify the execution mode. For example: Serial or Parallel
-move Change the order by specifying Up or Down.

Example F-19 Updating an Operation Plan

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

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

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

update_siteguard_configuration

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

Format

emcli update_siteguard_configuration
         -primary_system_name="primary_system_name"
         -standby_system_name="standby_system_name"
Parameter Description
-primary_system_name Specify the name of the primary system.
-standby_system_name Specify the name of the standby system. This parameter can be specified more than once.

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

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"
         [–use_preferred_credential="true_or_false"]

Note:

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

Example F-21 Updating Site Guard Credential Association

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

emcli update_siteguard_credential_association 
         -system_name="austin-system"
         -target_name="austin-database-instance"
         -credential_type="HostNormal"
         -credential_name="HOST-DBCRED"
         -credential_owner="sysman"
         
emcli update_siteguard_credential_association          -system_name="austin-system"         -target_name="austin-database-instance"         -credential_type="HostNormal"         -credential_owner="sysman"         –use_preferred_credential="true"

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"]
         –credential_type="type"
         [-all_hosts="true_or_false"]

Note:

[ ] indicates that the parameter is optional.
Parameter Description
-script_id Specify the script ID.
-path Specify the path to the script.
–credential_type Specify HostNormal or HostPrivileged if you have the root privileges.
-all_hosts Optional flag to allow the script to run on all the hosts in the system. For example: true or false.

Example F-22 Updating Site Guard Script

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