Oracle® Enterprise Manager Lifecycle Management Administrator's Guide 12c Release 2 (12.1.0.2) Part Number E27046-08 |
|
|
PDF · Mobi · ePub |
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.Adds a host to the Oracle Site Guard configuration scripts. You can add more than one host.
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. |
Creates an operational plan for Oracle Site Guard operations.
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"
Creates a site configuration for Oracle Site Guard. It associates the systems and their roles.
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. |
Associates the credentials with the targets in a site.
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"
Associates scripts (pre-script, post script and storage script) with the Oracle Site Guard configuration.
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"
Deletes the specified operation plan from a Site Guard configuration.
emcli delete_operation_plan
-name="plan_name"
Parameter | Description |
---|---|
-name |
Specify the name of the operation plan you want to delete. |
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.
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. |
Deletes the credential association from the Oracle Site Guard configuration.
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. |
Deletes the specified script from the Oracle Site Guard configuration.
emcli delete_siteguard_script
-script_id="script id"
Parameter | Description |
---|---|
-script_id |
Specify the ID associated with the script. |
Deletes the host or hosts associated with a given script.
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. |
Provides the detailed step-by-step information about the specified operation plan.
emcli get_operation_plan_details
-name="plan name"
Parameter | Description |
---|---|
-name |
Specify the name of the operation plan. |
Lists all configured operation plans.
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. |
Provides the Oracle Site Guard configuration.
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. |
Lists the credential associations configured for a system.
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. |
Lists the hosts associated with any script where the script is designated to run.
emcli get_siteguard_script_hosts
-script_id="script_id"
Parameter | Description |
---|---|
-script_id |
Specify the ID associated with the script. |
Obtains the Oracle Site Guard scripts associated with the specified system.
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 . |
Submits the prechecks for any given operation plan.
emcli run_prechecks
-operation_plan="name_operation plan"
Parameter | Description |
---|---|
-operation_plan |
Specify the name of the operation plan. |
Submits the specified operation plan for execution.
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 If you set the value to |
Updates the Error Mode and Run Mode for any step in the given operation plan.
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"
Updates the Oracle Site Guard configuration to add additional standby systems. One primary system can be associated with one or more standby systems.
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.Updates the credential association.
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"
Updates the path and the all_hosts
flag associated with any script.
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 . |