Oracle® Enterprise Manager Lifecycle Management Administrator's Guide 12c Release 2 (12.1.0.2) Part Number E27046-08 |
|
|
PDF · Mobi · ePub |
This chapter describes how to set up Oracle Site Guard for your existing Oracle Fusion Middleware disaster recovery solution, to perform operations like switchover and failover on the primary site and the standby site.
It contains the following topics:
New Features of Oracle Site Guard in Enterprise Manager Cloud Control 12c Release 2
Prerequisites for Configuring Oracle Fusion Middleware Products for Oracle Site Guard
This section provides an overview of the new features available in Oracle Site Guard in Enterprise Manager Cloud Control 12c Release 2 (Fusion Middleware plug-in release 12.1.0.3).
You can use the Enterprise Manager Cloud Control Console user interface to perform the following tasks:
Define Sites
Associate Credentials for Site
Associate Pre-Scripts and Post-Scripts
Associate Storage Scripts
For more information, see "Configuring Oracle Site Guard".
In this release, you can use named credentials or preferred credentials to run an operation plan.
Preferred credentials are used to simplify access to managed targets by storing target login credentials in the Management Repository. With preferred credentials set, users can access an Enterprise Manager target that recognizes those credentials, without being prompted to log in to the target. Preferred credentials are set on a per-user basis, thus ensuring the security of the managed enterprise environment.
Default Credentials: Default credentials can be set for a particular target type, and will be available for all the targets of the target type. It will be overridden by target preferred credentials.
Target Credentials: Target credentials are preferred credentials set for a particular target. They could be used by applications such as the job system, notifications, or patching. For example, if the user chooses to use preferred credentials while submitting a job, then the preferred credentials set for the target (target credentials) will be used. If the target credentials are not present, the default credentials (for the target type) will be used. If the default credentials are not present, the job will fail. If not specified, by default, preferred credentials refer to preferred target credentials.
For more information about setting up preferred credentials, see "Setting Preferred Credential Using EMCLI Commands".
For more information, see "Changing Execution Orders".
Read the following notes before you start configuring Oracle Site Guard for Oracle Fusion Middleware components:
Read "Terminology" in the Oracle Fusion Middleware Disaster Recovery Guide to understand the disaster recovery and Oracle Site Guard terminology used in this chapter.
Read "Recommendations for Fusion Middleware Components" in the Oracle Fusion Middleware Disaster Recovery Guide before you configure Oracle Site Guard for Oracle Fusion Middleware.
Ensure that the disaster recovery environment is set up according to Oracle-recommended guidelines. For more information, see the following sections in the Oracle Fusion Middleware Disaster Recovery Guide:
Ensure that host names are configured, as described in "Planning Host Names" in the Oracle Fusion Middleware Disaster Recovery Guide.
Ensure that virtual IP addresses and virtual host names are configured, as described in "Virtual IP and Virtual Hostname Considerations" in the Oracle Fusion Middleware Disaster Recovery Guide.
Read "Storage Considerations" in the Oracle Fusion Middleware Disaster Recovery Guide.
Read "Database Considerations" in the Oracle Fusion Middleware Disaster Recovery Guide.
Ensure that you have configured Oracle Data Guard to provide disaster recovery for Oracle Database, as described in "Database Considerations" in the Oracle Fusion Middleware Disaster Recovery Guide.
Note:
Oracle Site Guard requires a database to be set up using Oracle Data Guard Broker. If Oracle Databases in a site are protected by Oracle Data Guard, you must configure Oracle Data Guard Broker for Oracle Data Guard, as described in the Oracle Data Guard Broker guide.Ensure that you have an existing Oracle Fusion Middleware disaster recovery setup, as described in "Setting Up and Managing Disaster Recovery Sites" in the Oracle Fusion Middleware Disaster Recovery Guide.
Oracle Site Guard primarily orchestrates switchover and failover between two disaster recovery sites. These sites should be created, as described in this chapter. Oracle Site Guard offers the following features:
Ensures high availability, data protection, and disaster recovery for enterprise data.
Performs Oracle Site Guard operations like switchover and failover. If the primary site becomes unavailable due to a planned or an unplanned outage, a Switchover or Failover process needs to be initiated using Oracle Site Guard.
This section includes the following topics:
Oracle Site Guard provides the following benefits:
Reduction of Errors Due to Prepared Responses
Oracle Site Guard helps in reducing the possibility of human error in case of disasters. The recovery strategies are mapped out, tested, and rehearsed in prepared responses within the application. After starting an Oracle Site Guard operation for disaster recovery, human intervention is not required.
Oracle Site Guard provides an easy mechanism to integrate with any storage. It integrates with storage appliances to perform switchover or failover, by using callouts to any user-specified storage role reversal scripts in the operation workflow.
Oracle Site Guard automatically handles dependencies between the targets while starting or stopping a site.
End-to-End Disaster Recovery Automation
Oracle Site Guard provides an end-to-end orchestration of the Oracle Site Guard operations by loosely integrating with storage appliances, to perform storage role reversals. It simultaneously integrates with Oracle Data Guard Broker to perform database role reversals. Oracle Site Guard then shuts down the primary site before performing disaster recovery operations like switchover or failover and brings up the standby site after the Oracle Site Guard operation is completed.
After Oracle Site Guard is configured, it manages all components in an application during an operation such as failover and switchover, and ensures that these operations are complete.
Oracle Site Guard ensures high availability, data protection, and disaster recovery for Oracle Fusion Middleware 11g. It automates the following Oracle Site Guard operations:
Stopping a site
Starting a site
Site Switchover
Site Failover
A site is a collection of related targets in a data center. Oracle Site Guard performs operations like start-site, stop-site, switchover, and failover, on the site. It is required to run a group of applications simultaneously. For example, a site could consist of Oracle Fusion Middleware instances, databases, and storage devices. Oracle Site Guard uses the Enterprise Manager Cloud Control generic system target to represent a site. Every site, whether primary or standby, is represented as a generic system, which is a collection of other target types, such as Oracle Database and Oracle Fusion Middleware Domain. Oracle Site Guard only supports Enterprise Manager deployments where both primary and standby sites are managed by a single Enterprise Manager Cloud Control instance.
Figure 30-1 shows an overview of an Oracle Fusion Middleware Disaster Recovery topology managed by a single Enterprise Manager Cloud Control instance.
Figure 30-1 Primary and Standby Site for Oracle Fusion Middleware Disaster Recovery Topology Managed by Enterprise Manager Cloud Control
The following are the key aspects of the topology in Figure 30-1:
A single Enterprise Manager Cloud Control instance monitors the primary site and the standby site.
Oracle Management Agent (EM Agent) is installed on all hosts in the primary site and the standby site. For example:
OPMN managed system components (WEBHOST1
and WEBHOST2
)
Oracle Fusion Middleware Applications (APPHOST1
and APPHOST2
)
Oracle RAC Database (DBHOST1
and DBHOST2
)
Oracle Management Agent (EM Agent) is one of the core components of Enterprise Manager Cloud Control that enables you to convert an unmanaged host to a managed host in the Enterprise Manager system. The Management Agent works in conjunction with the plug-ins to manage the targets running on that managed host.
When there is a failure or planned outage of the primary site, Oracle Site Guard automates the following steps to enable the standby site to assume the production role in the topology:
Stops services and applications running on the primary site, and unmounts the storage on the primary site.
Stops the replication from the primary site to the standby site (when a failure occurs, replication stops due to the failure), and performs storage role reversal.
Performs a failover or switchover of the Oracle Databases using Oracle Data Guard Broker.
Mounts the storage on the standby site.
Starts the services and applications on the standby site, and assumes the production role.
Note:
If continuous replication is not configured, Oracle recommends that you create a final replication between the primary and the standby sites, before the storage switchover.The following terms are used throughout this chapter when discussing about Oracle Site Guard:
Site
A site is a set of different targets in a datacenter needed to run a group of applications. For example, a site could consist of Oracle Fusion Middleware instances, databases, storage, and so on. A datacenter may have more than one site defined by Oracle Site Guard and each of them managed independently for operations like switchover and failover.
Site Failover
The process of making the current standby site the new primary site after the primary site becomes unexpectedly unavailable (for example, due to a disaster at the primary site). This book also uses the term "failover" to refer to a site failover.
Site Switchover
The process of reversing the roles of the primary site and standby site. Switchovers are planned operations done for periodic validation or to perform planned maintenance on the current primary site. During a switchover, the current standby site becomes the new primary site, and the current primary site becomes the new standby site. This book also uses the term "switchover" to refer to a site switchover.
Oracle Site Guard Configuration
An Oracle Site Guard configuration contains settings such as, site creation, pre-scripts or post-scripts, storage, and credentials that are applicable to its operations.
Target
Targets are core Enterprise Manager entities which represent the infrastructure and business components in an enterprise. These components need to be monitored and managed for efficient functioning of the business. For example, Oracle Fusion Middleware farm or Oracle Database.
Generic System
A System is the set of targets (hosts, databases, application servers, and so on) that work together to host your applications. To monitor an application in Enterprise Manger, you would first create a System, that consists of the database, listener, application server, and hosts targets on which the applications run.
Operation Plan
An operation plan contains the flow of execution for a particular Oracle Site Guard operation. It defines the order in which the steps of an operation plan should be executed, in addition to other attributes, such as, serial, parallelism, and so on.
This section briefly describes how to use Oracle Site Guard to orchestrate switchover or failover operations between two sites. It contains the following topics:
Figure 30-2 shows a flow chart of the tasks that you need to perform while using Oracle Site Guard for switchover or failover operations.
Table 30-1 describes each of the steps in the task-overview flow chart, which is shown in Figure 30-2. The table also provides pointers for to get more information about each of the task in the process.
Table 30-1 Table Describing the Steps for Using Oracle Site Guard
Task | Description | More Information |
---|---|---|
Discover targets on the primary site and the standby site |
The Oracle Enterprise Manager Cloud Control Administrator's Guide guide provides a high-level overview of how to discover targets on a primary site. |
Discovering Targets on the Primary Site and the Standby Site |
Create generic systems for primary site and standby site using EMCC |
Oracle Site Guard uses the Enterprise Manager Cloud Control generic system target to represent a site. Oracle Site Guard only supports Enterprise Manager deployments where both primary and standby sites are managed by single Enterprise Manager Cloud Control. |
|
Create credentials for Oracle Site Guard using EMCC |
Create named and preferred credentials before associating them with the Oracle Site Guard configuration. |
|
Configure software library using EMCC |
Oracle Software Library (Software Library) is a repository that stores scripts that Oracle Site Guard requires, to execute the operation plan. Configuring Oracle Software Library is a one-time process. |
|
Configure Oracle Site Guard on primary sites and standby sites |
You need to create pre-scripts, post-scripts, and storage scripts before configuring Oracle Site Guard on primary sites and standby sites. |
|
Create custom pre scripts and post scripts |
Custom scripts (pre-scripts and post-scripts) can be created and executed at the site level, for a given Oracle Site Guard operation. This is an optional configuration. |
|
Create storage mount or unmount, or switchover or failover scripts |
Create storage scripts (mount, unmount, switchover, failover) to manage storage-related tasks during switchover and failover operations. |
|
Associate credentials with Oracle Site Guard using EMCLI commands or EMCC |
After you create named and preferred credentials, ensure that you associate them with the Oracle Site Guard configuration. |
|
Update credential association |
After you associate credentials with Oracle Site Guard configuration, you can update them later, as required. |
|
Associate custom scripts with Oracle Site Guard using EMCLI commands or EMCC |
If you need to execute one or more custom scripts (pre-scripts and post-scripts) as part of a Oracle Site Guard operation workflow, ensure that you associate it with the Oracle Site Guard configuration. |
|
Update custom scripts association |
After you associate custom scripts with the Oracle Site Guard configuration, you can update them later, as required. |
|
Associate storage script with Oracle Site Guard using EMCLI commands or EMCC |
The storage scripts (mount, unmount, switchover, failover) need to be associated with Oracle Site Guard configuration. These scripts are then executed at designated points in the Oracle Site Guard switchover or failover workflow. |
|
Update storage scripts association |
After you associate storage scripts with Oracle Site Guard configuration, you can update them later, as required. |
|
Create operation plans using EMCLI commands, to execute Oracle Site Guard operation |
An operation plan contains the execution flow for the Oracle Site Guard operation. You can either use the default operation plan or update it to change the order of targets within their corresponding steps. |
|
Run operation plans using EMCLI commands to switchover or failover, or to start or stop sites |
After an operation plan is created for a particular operation type, you can execute it when required, to perform the corresponding operation. |
|
Monitor the operation plan execution using EMCC console |
After executing an operation plan, you can monitor its status using the EMCC console. |
Oracle Site Guard is included with Enterprise Manager Cloud Control 12c Release 1 (12.1.0.3). You can manage an Oracle Site Guard configuration by using Enterprise Manager command-line interface (EMCLI) or console. To install Oracle Site Guard, complete the following steps:
Note:
For information about Oracle Site Guard licensing, see Oracle Enterprise Manager Licensing Information.Install Enterprise Manager Cloud Control 12c Release 1 (12.1.0.3) for your existing Oracle Fusion Middleware enterprise deployment. For information about installing Enterprise Manager Cloud Control 12 c Release 1 (12.1.0.3), see "Oracle Enterprise Manager Cloud Control Basic Installation Guide.
Note:
Ensure that you install Oracle Management Agent (EM Agent) on each of the hosts managed by Enterprise Manager, as described in the chapter "Installing Oracle Management Agent" in the Oracle Enterprise Manager Cloud Control Basic Installation Guide.Install the Enterprise Manager Command-Line Interface (EMCLI), as described in the chapter "Command Line Interface Concepts and Installation" in the Oracle Enterprise Manager Command Line Interface Guide.
Note:
Oracle recommends that you install EM CLI in the same Middleware home where Oracle Management Service is installed. For example,OMS_HOME
/bin/emcli
.The following are the prerequisites for configuring Oracle Fusion Middleware 11g products for Oracle Site Guard:
For information about discovering targets on the primary site, see "Adding Targets" in the Oracle Enterprise Manager Cloud Control Administrator's Guide.
Oracle Site Guard supports discovery of the following target types:
Oracle Fusion Middleware farm
Oracle Fusion Middleware managed system components, such as Oracle HTTP Server and Oracle Internet Directory (part of the Oracle Fusion Middleware farm)
Real Application Cluster (RAC) databases
Single instance database
For a two-site deployment, the targets in the primary site should be discovered first, followed by the targets in the standby site.
A site should be up for its targets to be discovered. For a two-site deployment, you must first discover the targets in the primary site. Once you discover the targets in the primary site, you must manually perform a switchover operation, so that the standby site takes over the production role, as described in "Performing a Switchover" in Oracle Fusion Middleware Disaster Recovery Guide
After performing a switchover, you can discover the targets for the standby site by completing the steps described in "Adding Targets" in the Oracle Enterprise Manager Cloud Control Administrator's Guide.
Note:
After you discover the targets for the standby site, you must manually perform a switchover operation, so that the primary site takes over the production role, as described in "Performing a Switchover" in Oracle Fusion Middleware Disaster Recovery Guide.You must create a generic system for the primary site and the standby site. Each generic system must include all targets, Oracle Fusion Middleware farms and Databases, pertaining to the site that it represents.
Create the generic system using one of the following options:
To create a generic system for the primary site, using an Enterprise Manager Cloud Control console, complete the following steps:
Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR
user.
Select Targets and then select Systems.
The Systems page is displayed.
Select Generic System from the drop-down menu and click Add.
In the General section, enter the name for your primary system.
In the Member section, click Add.
Choose the targets, and click Select. You must associate the following:
Oracle Fusion Middleware Farm which includes:
Administration Server
Managed Servers
OPMN-managed system components
If you are using Oracle RAC Database then you must associate it with a Cluster Database target. For a single database instance, you must associate it with a Database Instance target.
Note:
Ensure that the following target types are not added to the generic system:Database System
Individual RAC Database instances
Select the time zone from the drop-down menu.
Click Next.
The Define Associations page is displayed.
Click Next.
The Availability Criteria page is displayed.
From Availability Criteria, select the Any Of The Key Members option.
Select AdminServer in the Members pane and double-click.
The AdminServer is removed from the Members pane and added in the Key Members pane.
Click Next.
The Charts page is displayed.
Click Next.
The Review page is displayed.
Review your settings, and click Finish.
Create a generic system by running the following emcli
commands (located at OMS_HOME
/bin/emcli
) in the command-line interface:
Note:
For information about setting up a new EMCLI client, see the Enterprise Manager Command-Line Interface Download page within the Cloud Control console. To access the page, in Cloud Control, from the Setup menu, click Command Line Interface.emcli create_system -name="name" -type=system -add_members="name1:type1;name2:type2;..."]... -timezone_region="actual_timezone_region"
Note:
To get status and alert information for targets, you can runget_targets
command. For more information, see the chapter "Verb Reference" in the Oracle Enterprise Manager Command Line Interface Guide.Parameter | Description |
---|---|
-name |
Enter a name for the system. |
-type |
Enter generic_system as the type. |
-add_members |
Add existing targets to the system. Each target is specified as a name-value pair target_name:target_type . You can specify this option more than once. |
-timezone_region |
Specify the time zone region. The time zone you specify here is used for scheduling operations such as jobs and blackouts, on the system. |
See "create_system" in the Oracle Enterprise Manager Command Line Interface Guide.
Create the credentials for the following targets associated with Oracle Site Guard, using Enterprise Manager Cloud Control Console:
Host (for normal user)
Host (users with root
privileges)
Oracle WebLogic Server
Oracle Database
Oracle Site Guard supports the following credentials:
Named Credentials
Preferred Credentials
For more information, see "Preferred Credentials" in the Oracle Enterprise Manager Cloud Control Administrator's Guide.
Notes:
The credentials created here are later associated with the Oracle Site Guard configuration. Oracle Site Guard supports specifying the same credentials for all targets of the same target type. For example, all databases in a system can have the same sysdba
credentials. Oracle Site Guard also allows the targets of same kind to have different credentials.
If the credentials are the same across the nodes (primary and standby site), you need not create credentials for the targets running on the standby site.
Creating Named Credentials Using Enterprise Manager Cloud Control Console
To create a named credentials using Enterprise Manager Cloud Control Console, complete the following steps:
Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR
user.
From the Setup menu, select Security, then select Named Credentials.
The Named Credentials page is displayed.
Click Create.
The Create Credential page is displayed.
In the General Properties section, specify the following:
Credential name: Enter a name for the credential.
Credential description: Enter the credential description.
Authenticating Target Type/ Credential type/ Scope: Enter the details as specified in the following table:
Element | Host Details | Host (root -User Privileges) Details |
Oracle WebLogic Server | Database Instance |
---|---|---|---|---|
Authenticating Target Type | Host | Host | Oracle WebLogic Server | Database Instance |
Credential type | Host Credentials | Host Credentials | Oracle WebLogic Credentials | Database Credentials |
Scope | Global | Global | Global | Global |
In the Credential Properties section, specify the following:
UserName: Enter the username.
Password: Enter the password.
Confirm Password: Enter the password again.
Run Privilege/ Role: Enter the details as specified in the following table:
Element | Host | Host (Users with root privileges) |
Oracle WebLogic Server | Database Instance |
---|---|---|---|---|
Run Privilege | None | Select Sudo and enter values in the Run As fields | Oracle WebLogic Server Administration user credentials | Oracle Database SYS user credential |
Role | None | None | None | SYSDBA |
Click Test and Save. To test credentials, select the appropriate Test Target Type from the drop-down menu for which you want to test the credentials, and specify Test Target Name.
Creating Named Credentials Using EMCLI Commands
You can create a named credential by running the following emcli commands in the command-line interface:
emcli create_named_credential -cred_name="cred_name" -auth_target_type="auth_target_type" -cred_type="cred_type" -attributes="p1:v1;p2:v2"
Parameter | Description |
---|---|
cred_name |
Sets the name for this credential set. |
auth_target_type |
Set the authenticating target type. |
cred_type |
Set the credential type for the target/credential set. |
attributes |
Enter the following credential column values:
colname:colvalue;colname:colvalue You can change the value of the separator using |
Setting Preferred Credential Using EMCLI Commands
You can set a named credential as a target-preferred credential by running the following emcli
commands in the command-line interface:
Note:
Oracle recommends that you to set the preferred credential using theemcli
commands.emcli set_preferred_credential -set_name="set_name" -target_name="target_name" -target_type="type" -credential_name="name" [-credential_owner ="owner]"
Note:
[ ]
indicates that the parameter is optional.Parameter | Description |
---|---|
set_name |
Sets the preferred credential for this credential set. |
target_name |
Sets the preferred credential for this target. |
target_type |
Target type for the target/credential set. |
credential_name |
Name of the credential. |
credential_owner |
Owner of the credential. This defaults to the currently logged-in user. |
Example:
emcli set_preferred_credential -set_name="HostCredsNormal" -target_name="test.example.com" -target_type="host" -credential_name="MyHostCredentials" -credential_owner="Admin"
Oracle Software Library (Software Library) is a repository that stores scripts required by Oracle Site Guard to execute the operation plan. To configure the storage location for the Oracle Software Library, complete the following steps:
Note:
Configuring Oracle Software Library is a one-time process. Enterprise Manager requires you to configure Oracle Software Library before proceeding with any deployment-procedure related tasks. Perform the steps listed in this section after confirming that Oracle Software Library is not configured.Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR
user.
From the Setup menu, select Provisioning and Patching, then select Software Library.
The Software Library: Administration page is displayed.
Select OMS Shared Filesystem from the Storage Type drop-down box.
Click Add.
Specify a Name and Location that is accessible to all OMSs and click OK.
Note:
As the storage location for the Software Library must be accessible to all OMSs as local directories, in a multi-OMS scenario, you must set up a clustered filesystem using OCFS2 or NFS. For single OMS systems, any local directory is sufficient.A job is executed to upload all the out-of-box content.
Note:
For more information, see "Configuring Software Library" in the Oracle Enterprise Manager Cloud Control Administrator's Guide.This section describes the setup and configuration of Oracle Site Guard in Enterprise Manager Cloud Control to manage Oracle Fusion Middleware Disaster operations on the primary site and the standby site.
Ensure that you create the scripts that are needed to configure Oracle Site Guard:
Creating Pre-Scripts and Post-Scripts
You can create custom scripts to be executed at the site level for the Oracle Site Guard operation (stop, start, switchover, or failover) workflow. Each script can be associated with more then one host in a site. You can create the following scripts:
Pre-Script
Post-Script
Create the required scripts and save them in a location of your choice on each of the hosts from where the script will be executed. After creating and testing the script, ensure that you associate the script with Oracle Site Guard, as described in "Associating Pre-Scripts and Post-Scripts".
Notes:
A custom script should be a shell script and it must have clearly defined return codes. The script must return 0
on success, and non-zero values on failure.
Ensure that you have the required privilege to run the script.
You can create the following storage scripts:
Mount Script
Unmount Script
Switchover script
Failover Script
Create the required scripts and save them to the location of your choice on each of the hosts from where the script will be executed. After creating and testing the script, you must associate that with Oracle Site Guard, as described in "Associating Storage Scripts".
Oracle Site Guard provides the following sample scripts for Sun ZFS and NetApp Storage appliances:
mount-unmount.sh
switchoverStorage.sh
The sample scripts are located in the AGENT_HOME
/plugins/oracle.sysman.emas.agent.plugin_12.1.0.3.0/scripts
directory after completing the Oracle Management Agent (EM Agent) installation.
Notes:
After running the script, verify that the execution return code value is 0. If you get any other value for the return code, then the script is considered to have failed. Ensure that you implement the script with the proper return code.The following are examples of scripts Sun ZFS and NetApp Storage appliances:
mount-unmount.sh
Run the following command to mount or unmount directories on the storage appliance:
./mount-umount.sh [-t operation_type ] [-d directories_to_mount_or_umount]
Note:
Ensure that the /etc/fstab
file is updated with the devices that you want to mount or unmount.
For example,
To mount multiple directories, run the following command:
./mount-umount.sh [-t mount] [-d /u02/oracle/config,/u02/oracle/product,/u02/oracle/stage]
To mount a single directory, run the following command:
./mount-umount.sh -t mount -d /u01/app/oracle/product/test
To unmount multiple directories, run the following command:
./mount-umount.sh [-t unmount] [-d /u02/oracle/config,/u02/oracle/product,/u02/oracle/stage]
To unmount a single directory, run the following command:
./mount-umount.sh -t umount -d /u01/app/oracle/product/test
switchoverStorage.sh
For Sun ZFS appliance:
Run the following command to switch over storage:
./switchoverStorage.sh -u appliance_user -h appliance -j project_name -p pool_name -s sourceID
For example:
./switchoverStorage.sh -u root -h host.test.example.com -j SiteGuard -p pool-0 -s source-000
ntapstorage.pl
Note:
Oracle Site Guard currently supports only shell scripts. Create a sample shell script to invoke the perl script,ntapstorage.pl
.Ensure that the sample wrapper shell script invokes the ntapstorage.pl
script for each pair of source and destination volumes. For example, if there are two pairs of source and destination volumes between the primary and standby sites, then this wrapper script should invoke ntapstorage.pl
script twice.Run the perl script ntapstorage.pl
. Do the following:
Call the perl script, ntapstorage.pl
, from the following sample wrapper shell script:
#!/bin/bash perl ntapstorage.pl $@
Run the following command to switch over storage:
./sample-wrapper.sh -sm <sip1:sv1/dip1:dv1> <update break | resync | break | release | break release | break release resync> [-ntap_src_user <sip2:root/password> -ntap_dest_user <dip2:root/password> -encrypted <true/false> ]
For example:
./sample-wrapper.sh -sm primary-storage:vol1/standby-storage:vol2 update
After creating the required scripts, complete the following steps to configure Oracle Site Guard:
Configure the primary and standby sites using generic systems, and associate them with Oracle Site Guard.
You can add the configuration for the primary and standby sites using one of the following options:
To associate the standby system with the primary system, complete the following steps:
Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR
user.
From the Targets menu, select Systems.
The Systems page is displayed.
Select the primary system (created in "Creating Generic Systems for the Primary and Standby Sites").
Click Generic System > Site Guard > Configure.
The Site Guard Configuration page is displayed.
In the Standby System(s) section, click Add.
The Search and Select: Standby Systems page is displayed.
Choose the standby system, and click Select.
Click Save.
To add the configuration for the primary and standby sites, you must run the following emcli
commands in the command-line interface:
Note:
For information about logging in toemcli
, see chapter "Command Line Interface Concepts and Installation" in the Oracle Enterprise Manager Command Line Interface Guide.emcli create_siteguard_configuration -primary_system_name="system_name" -standby_system_name="system_name"
Parameter | Description |
---|---|
-primary_system_name |
Enter the name of your system, which is associated with the primary site. |
-standby_system_name |
Enter the name of your system, which is associated with the standby site. |
To display information about the association between existing primary and standby sites, run the following emcli
commands in the command-line interface:
emcli get_siteguard_configuration -primary_system_name="system_name" -standby_system_name="system_name"
You must associate credentials created in "Creating Credentials" with the targets in each site.
Associate the credentials for the following targets:
Host, where Oracle Fusion Middleware and Oracle Database are installed and configured (for normal user and users with root
privileges)
Oracle WebLogic Administration Server
Oracle Database
You can associate the credentials using one of the following options:
To associate the credentials for the primary site, complete the following steps:
Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR
user.
Select Targets and then select Systems.
The Systems page is displayed.
Select the primary system (created in "Creating Generic Systems for the Primary and Standby Sites").
Click Generic System > Site Guard > Configure.
The Site Guard Configuration page is displayed.
Click the Credentials tab.
In the Normal Host Credentials section, click Add.
The Add Normal Host Credentials page is displayed.
Enter the following details:
Target: Select the target name.
Use Preferred Credentials: If you are using preferred credentials, then select the checkbox.
Named Credential: If you are using named credentials, then select the credential name.
Click Save.
In the Privileged Host Credentials section, click Add.
The Add Privileged Host Credentials page is displayed.
Enter the following details:
Target: Select the target name.
Use Preferred Credentials: If you are using preferred credentials, then select the checkbox.
Named Credential: If you are using named credentials, then select the credential name.
Click Save.
In the Oracle WebLogic Administration Credentials section, click Add.
The Add Oracle WebLogic Administration Credentials page is displayed.
Enter the following details:
Target: Select the target name.
Use Preferred Credentials: If you are using preferred credentials, then select the checkbox.
Named Credential: If you are using named credentials, then select the credential name.
Click Save.
In the Database Credentials section, click Add.
The Add Database Credentials page is displayed.
Enter the following details:
Target: Select the target name.
Use Preferred Credentials: If you are using preferred credentials, then select the checkbox.
Named Credential: If you are using named credentials, then select the credential name.
Click Save.
Choose the standby system, and click Select.
Use the above steps to associate the credentials for the standby site.
Associate the credentials for the targets by running the credential framework emcli
commands in the command-line interface:
emcli create_siteguard_credential_association -system_name="name" -credential_type="type" -credential_name="name" -credential_owner="owner" –use_preferred_credential="true or false"
Parameter | Description |
---|---|
-system_name |
Specify the name of the system, which is associated with the site. |
-credential_type |
Specify the credential type depending on the target:
|
-credential_name |
Specify a name for the credential. |
-credential_owner |
Specify the owner of the credential. |
–use_preferred_credential |
If you are using Preferred Credentials, then specify true . |
You can associate pre-scripts or post-scripts (created in "Creating Pre-Scripts and Post-Scripts") for the Oracle Site Guard operation workflow.
Note:
You can specify the script arguments as name-value pairs with the script. For example,test.sh -param1 value1 -param2 value2
.You can associate pre-scripts and post-scripts using one of the following options:
Associating Pre-Scripts and Post-Scripts Using Enterprise Manager Cloud Control Console
Associating Pre-Scripts and Post-Scripts Using EMCLI Commands
To associate pre-scripts and post-scripts for the primary site, complete the following steps:
Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR
user.
Select Targets and then select Systems.
The Systems page is displayed.
Select the primary system (created in "Creating Generic Systems for the Primary and Standby Sites").
Click Generic System > Site Guard > Configure.
The Site Guard Configuration page is displayed.
Click the Pre/Post Scripts tab.
Click Add.
The Add Pre/Post Scripts page is displayed.
Enter the following details:
Script Path: Enter the path to the script, or click the search icon and specify the path to the script.
Target Hosts: Select the target name.
Script Type: The type of script, depending on the function you want to perform, select one of the following options:
Pre-Script
Post-Script
Operation Type: The function of the operation. Example: Switchover, Failover, Start, or Stop.
Role: Select Primary or Standby based on the system role. By default, the script is configured for both primary and standby roles for a given system.
Credential Type: Select Normal Host Credentials or Privileged Host Credentials for users with root
privileges.
Click Save.
Use the above steps to associate the pre-scripts and post-scripts for the standby site.
To associate a pre-script or post-script with Oracle Site Guard, run the following emcli
commands in the command-line interface:
emcli create_siteguard_script -system_name= "name" -operation="operation_name" -script_type="script_type" -host_name="name of the host" -path="path of the script" -all_hosts="true" –credential_type="type" -role="role"
Parameter | Description |
---|---|
-system_name |
Specify the system on which you are performing the operation. |
-operation |
The function of the operation. Example: Switchover , Failover , Start , or Stop . |
-script_type |
The type of script, depending on the function you want to perform select one of the following options:
|
-path |
Enter the path to the script. |
-host_name |
The name of the host where the script will be run.
Note: Ensure that the hostname is part of the system specified in |
-all_hosts |
Specify this optional flag to enable the script to run on all the hosts in the system. This parameter overrides the host_name . |
–credential_type |
Specify HostNormal credentials or HostPrivileged credentials for users with root privileges. |
-role |
Specify the role of the system when the script is run.
For example: |
You can associate storage scripts (created in "Creating Storage Scripts") for the Oracle Site Guard operation workflow.
You can associate the storage scripts using one of the following options:
To associate storage scripts for the primary site, complete the following steps:
Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR
user.
Select Targets and then select Systems.
The Systems page is displayed.
Select the primary system (created in "Creating Generic Systems for the Primary and Standby Sites").
Click Generic System > Site Guard > Configure.
The Site Guard Configuration page is displayed.
Click the Storage Scripts tab.
Click Add.
The Add Storage Scripts page is displayed.
Enter the following details:
Script Path: Enter the path to the script or click the search icon, and specify the path to the script.
Target Hosts: Select the target name.
Script Type: The type of script, depending on the function you want to perform, select one of the following options:
Mount
UnMount
Storage-Switchover
Storage-Failover
Operation Type: The function of the operation. Example: Switchover or Failover.
Credential Type: Select Normal Host Credentials or Privileged Host Credentials for users with root
privileges.
Click Save.
To associate the storage scripts for the standby site, follow steps 1-7.
You must associate the following storage scripts:
Mount Scripts for Primary and Standby Sites
To associate a mount script, run the following emcli
commands in the command-line interface:
emcli create_siteguard_script -system_name="system_name" -operation="operation_name" -script_type="Mount" -host_name="name of the host" -path="path of the script" -all_hosts= "true" –credential_type="type"
Unmount Script for Primary and Standby Sites
To associate a pre-script or post-script, run the following emcli
commands in the command-line interface:
emcli create_siteguard_script -system_name="system_name" -operation="operation_name" -script_type= "UnMount" -host_name="name of the host" -path="path of the script" -all_hosts="true" –credential_type="type"
Switchover Script for Primary and Standby Sites
To associate a pre-script or post-script, run the following emcli
commands in the command-line interface:
emcli create_siteguard_script -system_name="system_name" -operation="operation_name" -script_type="Storage-Switchover" -host_name="name of the host" -path="path of the script" -all_hosts="true" –credential_type="type"
Failover Script for Primary and Standby Sites
To associate a pre-script or post-script, run the following emcli
commands in the command-line interface:
emcli create_siteguard_script -system_name="system_name" -operation="operation_name" -script_type="Storage-Failover" -host_name="name of the host" -path="path of the script" -all_hosts="true" –credential_type="type"
An operation plan contains the execution flow for the Oracle Site Guard operation. You can use it to define the order in which steps of an operation are executed. To execute any Oracle Site Guard operation, you must create an operation. It contains the execution flow for a Oracle Site Guard operation. For example, stopping Oracle HTTP Servers, stopping the Managed Servers and Administration Server in a WebLogic domain, and so on. You can either use the default operation plan or update it to change the order of targets within their corresponding steps.You can save an operation plan to the repository, and execute it as needed.
Ensure that you must complete the following steps before you perform an operation:
You can create an operation plan by running the following emcli
commands in the command-line interface:
For switchover or failover operations:
emcli create_operation_plan -name="name" -primary_system_name="primary_system_name" -standby_system_name="standby_system_name" -operation_plan="operation_name"
For starting or stopping a site:
emcli create_operation_plan -name="name" -system_name="name" -operation_plan="operation_name"
Parameter | Description |
---|---|
name |
Set the name of the operation plan. |
primary_system_name |
Set the name of the primary system. This parameter is set for switchover or failover operation only. |
standby_system_name |
Set the name of the standby system. This parameter is set for switchover or failover operation only. |
system_name |
Enter the name of the system. |
operation_plan |
Enter the name of the operation plan. |
For a sample of the emcli
command for creating an operation plan using the command-line interface, see Example F-2 in Appendix F, "create_operation_plan".
You can update an operation plan as follows:
You can modify the order in which the steps are executed in an operation plan. For example, you can start the Oracle Identity Manager domain before starting any other Oracle WebLogic Server domain in a site or the order of an individual step in an operation plan, by running the following emcli
command in the command-line interface:
emcli update_operation_plan -name="plan_name" -step_number="7" -move="Up"
The execution mode determines whether the steps pertaining to a target type in the site runs in parallel (executed simultaneously) or in serial mode. The execution mode can be either Serial
or Parallel
. You can update the execution mode by running the following emcli
command in the command-line interface:
emcli update_operation_plan –name=”plan_name” –step_number=”2” –execution_mode=”Parallel”
You can disable any step in the operation plan by running the following emcli
command in the command-line interface:
emcli update_operation_plan –name=”plan_name” –step_number=”2” –enabled=”false”
For more information, see "Updating Error Modes in an Operation Plan".
Oracle Site Guard automatically runs the precheck utility before performing any operation. You can also run the precheck utility separately, before executing any Oracle Site Guard operations. Oracle Site Guard performs the following prechecks:
Checks whether the Fusion Middleware Farms running on the primary is down before performing a failover operation.
Checks the agent status on all hosts involved in the operation.
Checks if any new targets are added to the generic system after the operation plan is created.
Checks whether all targets involved in the operation plan exist in the Enterprise Manager repository.
Detects if any targets are moved out or deleted from the generic system after the operation plan is created.
Asserts the existence of all configured scripts (pre/post/mount/unmount/storage role reversal) on their respective target hosts.
Runs Oracle Data Guard Broker prechecks to ascertain whether the Database is ready for role reversal (for switchover/failover operation)
Performs Database Role Checks
You must run the following emcli
command in the command-line interface:
emcli run_prechecks -operation_plan="operation_plan_name"
Parameter | Description |
---|---|
-operation_plan |
Enter the name of your operation plan. |
You can also monitor the status of a precheck operation using Enterprise Manager Cloud Control.
Note:
For more information, see Appendix F, "run_prechecks".You must submit an operation plan by running the following emcli
command in the command-line interface:
emcli submit_operation_plan -name="operation plan_name" [-run_prechecks={true|false}]
Parameter | Description |
---|---|
-name |
Enter the name of the operation plan. |
-run_prechecks |
Enter false , if you do not want to run precheck. For more information, see "Running Precheck Utility". |
Note:
For more information, see Appendix F, "submit_operation_plan".To monitor an operation plan submitted for execution, complete the following steps:
Log in to Enterprise Manager Cloud Control Console as an EM_CLOUD_ADMINISTRATOR
user.
Click Enterprise > Provisioning and Patching > Procedure Activity.
The Provisioning page is displayed.
Click the Procedure Activity tab.
Note:
You can also verify the status by running the followingemcli
command in the command-line interface:
get_instance_status_instance="GUID"
To get the GUID
information, run the following command:
emcli get_instances -type="SiteGuard"
Oracle Site Guard uses the Enterprise Manager Cloud Control deployment procedures framework to orchestrate disaster recovery operations on remote hosts. The framework provides error management support through error modes (stop and continue). In a disaster recovery scenario, it is very likely that things may go wrong. For example, some hosts might go down, become unreachable, or some servers might not start. To address such failures, Oracle Site Guard provides an option to define the error mode for individual steps and also lets you enable or disable steps. By default, the error mode is stop, and the run mode is enabled. This section includes the following topics:
Note:
For more information, see "Troubleshooting Oracle Site Guard Issues".You can define the following error modes for individual targets in a step for any given operation plan:
The execution flow stops if the step fails. The status of the step becomes Action Required. You must manually confirm this failure from Enterprise Manager Cloud Control console to restart the execution. The execution flow continues after the confirmation, but the failed step is not retried. The failed step can be retried at the job level from the console but the status of the retry operation is not reflected at the target level status or at the top-level step status. This is the default error mode. See Figure 30-3 and Figure 30-4.
In this error mode, execution flow continues even if the step fails. The status of the step shows Failed, but the operation continues and the top-level step status shows Completed with Errors. Figure 30-5 shows an example of continue error mode.
You can update the error modes in an operation plan by running the following emcli
command in the command-line interface:
emcli update_operation_plan -name="plan_name" -step_number={step number} -target_host={host name} -error_mode={error mode}
Parameter | Description |
---|---|
-name |
The name of the operation plan. |
-step_number |
Number of the step which should be updated |
-target_host |
The name of the system. Enter this option for Start or Stop operation. |
-error_mode |
The error mode type. For example, Stop or Enabled . |
Figure 30-6 shows an example of a user-defined operation plan.
To retry a failed operation, complete the following steps:
Log in to Enterprise Manager Cloud Control Console as an EM_CLOUD_ADMINISTRATOR
user.
Click Enterprise > Provisioning and Patching > Procedure Activity.
The Provisioning page is displayed.
Click the Procedure Activity tab.
Select the failed operation, and click Action Required.
In Embedded Procedure Step, click Action Required.
Select the failed operation, and click Failed.
In Target, select the failed operation, and click Failed.
Switch to Classic View.
Click Enterprise > Provisioning and Patching > Procedure Activity Credentials.
Click Procedure Activity.
Select the failed operation, and click Action Required.
In Embedded Procedure Step, click Action Required.
Select the failed operation, and click Action Required.
Click Confirm.
You can use emcli commands to execute the following Oracle Site Guard operations:
Note:
See Appendix F, "Oracle Site Guard Command-Line Interface Reference" for the list ofemcli
commands to manage an Oracle Site Guard configuration directly from the command-line interface.To stop a site, run the following emcli
command in the command-line interface:
emcli submit_operation_plan -name="stop-site1" -run_prechecks="true"
Parameter | Description |
---|---|
-name |
Specify the name of the site that you want to stop. |
-run_prechecks |
Enter true or false . The value of this parameter is true , by default. |
To start a site, run the following emcli
command in the command-line interface:
emcli submit_operation_plan -name="start-site1" -run_prechecks="true"
Parameter | Description |
---|---|
-name |
Specify the name of the site that you want to start. |
-run_prechecks |
Enter true or false . The value of this parameter is true , by default. |
To perform a site switchover, run the following emcli
command in the command-line interface:
emcli submit_operation_plan -name="switchover-site1" -run_prechecks="true"
Parameter | Description |
---|---|
-name |
Specify the name of the site for which you want to perform a switchover. |
-run_prechecks |
Enter true or false . |
To perform a site failover, run the following emcli
command in the command-line interface:
emcli submit_operation_plan -name="failover-site1" -run_prechecks="true"
Parameter | Description |
---|---|
-name |
Specify the name of the site for which you want to perform a failover. |
-run_prechecks |
Enter true or false . |
After performing a failover operation, you must manually reinstate the database manually. For more information, see "How to Reinstate a Database" in the Oracle Data Guard Broker.