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.
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 |
---|---|
|
Identification associated with the script. |
|
Host that you want to associate with the script. You can specify more than one host name. |
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 |
---|---|
|
Name of your system associated with the primary site. Enter this option for switchover or failover operations. |
|
Name of your system associated with the standby site. Enter this option for switchover or failover operations. |
|
Name of the system. Enter this option for start or stop operations. |
|
The function of the operation. Example: |
|
Name of the operation plan. |
|
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"
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 |
---|---|
|
Name of the system that is associated with the primary site. |
|
Name of the system that is associated with the standby system. You can specify more than one option and one system name. |
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 |
---|---|
|
Name of the system. |
|
Name of the target. This parameter is optional. |
|
Type of the credential. Example: |
|
Name of the credential. |
|
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"
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 |
---|---|
|
Name of the system. |
|
Name of the operation. For example: |
|
Type of the script. It can be |
|
Name of the host where this script will be run. This parameter is optional and can be specified more than once. |
|
Path to the script. |
|
Optional flag to allow the script to run on all the hosts in the system. This parameter overrides the |
|
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: |
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"
Deletes the specified operation plan from a Site Guard configuration.
Format
emcli delete_operation_plan -name="plan_name"
Parameter | Description |
---|---|
|
Specify the name of the operation plan you want to delete. |
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 |
---|---|
|
Name of the primary system. Specify either primary_system_name or standby_system_name. |
|
Name of the standby system. |
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 |
---|---|
|
Specify the system on which the service resides. |
|
Specify the credential type. It can be |
|
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"
Deletes the specified script from the Site Guard configuration.
Format
emcli delete_siteguard_script -script_id="script id"
Parameter | Description |
---|---|
|
|
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 |
---|---|
|
|
|
Name of the host where this script will be run. This parameter can be specified more than once. |
Provides the detailed step-by-step information about the specified operation plan.
Format
emcli get_operation_plan_details -name="plan name"
Parameter | Description |
---|---|
|
Name of the operation plan. |
Lists all configured operation plans.
Format
emcli get_operation_plans -name="operation plan_name" -operation="operation_name"
Parameter | Description |
---|---|
|
Specify the name of the operation plan. |
|
Specify the name of the operation. For example, |
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 |
---|---|
|
Name of the primary system. This parameter is optional. |
|
Name of the standby system. This parameter is optional. |
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 |
---|---|
|
Name of the system. |
|
Name of the target. This parameter is optional. |
|
Type of the credential. It can be 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"
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 |
---|---|
|
|
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 |
---|---|
|
Name of the system. |
|
Name of the operation. For example, |
|
Type of the script. For example: |
|
(Primary/Standby). Optional parameter to filter the scripts based on the role associated with the system. For example: |
Submits the pre check operation for any given operation plan.
Format
emcli run_prechecks -operation_plan="name_operation plan"
Parameter | Description |
---|---|
|
Name of the 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 of the operation plan. |
|
Run prechecks ( |
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 |
---|---|
|
The name of the operation plan. |
|
Number of the step that should be updated. |
|
The name of the system. Enter this option for starting or stopping operation. |
|
The function of the operation. For example: |
|
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 |
---|---|
|
Name of the primary system. |
|
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.
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 |
---|---|
|
Name of the system. |
|
Name of the target. This parameter is optional. |
|
Type of the credential. It can be |
|
Name of the credential. |
|
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"
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. |
|
Path to the script. |
|
Optional flag to allow the script to run on all the hosts in the system. For example: |