Stay organized with collections
Save and categorize content based on your preferences.
Set up a Data Guard observer on Google Cloud
Compute Engine
Depending on your high availability requirements.
you might want to automate failover between databases. After you've
validated your Data Guard deployment,
you have the option to set up a Data Guard observer on Compute Engine to do this.
An observer is a process that monitors a Data Guard configuration to initiate
an automated failover if conditions warrant it.
This guide covers installing the Oracle 19c database client on an observer
virtual machine (VM) and configuring Fast-Start Failover.
The following examples are used throughout this guide:
Networking. A subnet with firewall rules that allow access from your
Virtual Private Cloud to the Bare Metal Solution hosts running the primary and standby
databases.
Storage. -- At least 20 GB allocated to the boot disk.
Log in to the VM and verify that the SCAN hostname of each database cluster
resolves in DNS:
If the hostnames don't resolve, add the IP addresses for each SCAN hostname
to the /etc/hosts file on the VM. Replace the example IP addresses with
the IP addresses for each cluster:
The Oracle Database RPM installs software in a predefined directory. Add the
following entries to /home/oracle/.bash_profile to add the Oracle software
home to the path:
Oracle Database version 12.2 and higher includes support for the observer to
run in background mode. To do so, a wallet must be created to perform
passwordless authentication to the database. Log in as the oracle user on
the observer VM and perform the following tasks to create a wallet:
Add the following entries to $ORACLE_HOME/network/admin/sqlnet.ora:
Create the wallet directory on the VM hosting the observer:
mkdir/home/oracle/wallet
Initialize the wallet, then supply a password for the wallet when
prompted:
mkstore-wrl/home/oracle/wallet-create
Create an entry in the wallet for each database in the Data Guard
configuration. The mkstore command will request the SYS password for the
database, followed by the wallet password provided in the previous step:
Confirm that the wallet contains credentials for each database in the
Data Guard configuration. The -listCredential argument for mkstore
will request the wallet password:
mkstore-wrl/home/oracle/wallet-listCredential
Log in to the observer VM as Oracle and then test connectivity to the
primary and standby databases. Connect to the primary and secondary
databases with SQL*Plus by using the wallet credentials:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis guide outlines the process of setting up a Data Guard observer on a Google Cloud Compute Engine VM to automate database failover.\u003c/p\u003e\n"],["\u003cp\u003eThe setup involves creating a VM with specific operating system, networking, and storage criteria, followed by installing the Oracle 19c database client software.\u003c/p\u003e\n"],["\u003cp\u003eDatabase connectivity is configured by updating \u003ccode\u003etnsnames.ora\u003c/code\u003e and \u003ccode\u003esqlnet.ora\u003c/code\u003e, and creating a wallet for passwordless authentication.\u003c/p\u003e\n"],["\u003cp\u003eFast-Start Failover (FSFO) is enabled and configured using the Data Guard broker, which can automate failover between primary and standby databases.\u003c/p\u003e\n"],["\u003cp\u003eThe final steps include starting the Data Guard observer and verifying the configuration status to ensure it is successful, with a target, and a defined observer.\u003c/p\u003e\n"]]],[],null,["# Set up a Data Guard observer on Google Cloud Compute Engine\n\nSet up a Data Guard observer on Google Cloud\nCompute Engine\n===========================================================\n\nDepending on your [high availability requirements](https://docs.oracle.com/en/database/oracle/oracle-database/19/haovw/ha-requirements-architecture.html).\nyou might want to automate failover between databases. After you've\n[validated your Data Guard deployment](/bare-metal/docs/solutions/oracle/data-guard-setup/validate),\nyou have the option to set up a Data Guard observer on Compute Engine to do this.\nAn observer is a process that monitors a Data Guard configuration to initiate\nan automated failover if conditions warrant it.\n\nThis guide covers installing the Oracle 19c database client on an observer\nvirtual machine (VM) and configuring Fast-Start Failover.\n\nThe following examples are used throughout this guide:\n\nInstall the Oracle Database client software\n-------------------------------------------\n\n1. [Create a virtual machine (VM) on Compute Engine](/compute/docs/instances/create-start-instance)\n that meets the following criteria:\n\n - **Operating system.** Red Hat Enterprise Linux 7.\n\n - **Networking.** A subnet with firewall rules that allow access from your\n Virtual Private Cloud to the Bare Metal Solution hosts running the primary and standby\n databases.\n\n - **Storage.** -- At least 20 GB allocated to the boot disk.\n\n2. Log in to the VM and verify that the SCAN hostname of each database cluster\n resolves in DNS:\n\n host \u003cvar translate=\"no\"\u003eDBDG_SITE1_SCAN_HOSTNAME\u003c/var\u003e\n host \u003cvar translate=\"no\"\u003eDBDG_SITE2_SCAN_HOSTNAME\u003c/var\u003e\n\n If the hostnames don't resolve, add the IP addresses for each SCAN hostname\n to the `/etc/hosts` file on the VM. Replace the example IP addresses with\n the IP addresses for each cluster: \n\n # Site 1 SCAN Hosts\n 192.0.2.10 \u003cvar translate=\"no\"\u003eDBDG_SITE1_SCAN_HOSTNAME\u003c/var\u003e\n 192.0.2.11 \u003cvar translate=\"no\"\u003eDBDG_SITE1_SCAN_HOSTNAME\u003c/var\u003e\n 192.0.2.12 \u003cvar translate=\"no\"\u003eDBDG_SITE1_SCAN_HOSTNAME\u003c/var\u003e\n\n # Site 2 SCAN Hosts\n 198.51.100.10 \u003cvar translate=\"no\"\u003eDBDG_SITE2_SCAN_HOSTNAME\u003c/var\u003e\n 198.51.100.11 \u003cvar translate=\"no\"\u003eDBDG_SITE2_SCAN_HOSTNAME\u003c/var\u003e\n 198.51.100.12 \u003cvar translate=\"no\"\u003eDBDG_SITE2_SCAN_HOSTNAME\u003c/var\u003e\n\n3. [Install the Oracle Database RPM](https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/running-rpm-packages-to-install-oracle-database.html#GUID-BB7C11E3-D385-4A2F-9EAF-75F4F0AACF02).\n Install only the software. There's no need to configure a database on the\n observer VM.\n\n4. The Oracle Database RPM installs software in a predefined directory. Add the\n following entries to `/home/oracle/.bash_profile` to add the Oracle software\n home to the path:\n\n cat \u003e\u003e /home/oracle/.bash_profile \u003c\u003c EOL\n export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1\n export PATH=\\$PATH:\\$ORACLE_HOME/bin\n EOL\n\n5. Source the Oracle environment variables in your terminal session:\n\n source ~/.bash_profile\n\nConfigure the database connectivity\n-----------------------------------\n\n1. Configure the Oracle Net settings in the `$ORACLE_HOME/network/admin/tsnames.ora`\n file:\n\n \u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e =\n (DESCRIPTION =\n (ADDRESS = (PROTOCOL = TCP)(HOST = \u003cvar translate=\"no\"\u003eDBDG_SITE1_SCAN_HOSTNAME\u003c/var\u003e)(PORT = 1521))\n (CONNECT_DATA =\n (SERVER = DEDICATED)\n (SERVICE_NAME = \u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e) (UR=A)\n )\n )\n\n \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e =\n (DESCRIPTION =\n (ADDRESS = (PROTOCOL = TCP)(HOST = \u003cvar translate=\"no\"\u003eDBDG_SITE2_SCAN_HOSTNAME\u003c/var\u003e)(PORT = 1521))\n (CONNECT_DATA =\n (SERVER = DEDICATED)\n (SERVICE_NAME = \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e) (UR=A)\n )\n )\n\n2. Oracle Database version 12.2 and higher includes support for the observer to\n run in background mode. To do so, a wallet must be created to perform\n passwordless authentication to the database. Log in as the oracle user on\n the observer VM and perform the following tasks to create a wallet:\n\n 1. Add the following entries to `$ORACLE_HOME/network/admin/sqlnet.ora`:\n\n WALLET_LOCATION =\n (SOURCE =\n (METHOD = FILE)\n (METHOD_DATA = (DIRECTORY = /home/oracle/wallet))\n )\n SQLNET.WALLET_OVERRIDE = TRUE\n\n 2. Create the wallet directory on the VM hosting the observer:\n\n mkdir /home/oracle/wallet\n\n 3. Initialize the wallet, then supply a password for the wallet when\n prompted:\n\n mkstore -wrl /home/oracle/wallet -create\n\n 4. Create an entry in the wallet for each database in the Data Guard\n configuration. The `mkstore` command will request the SYS password for the\n database, followed by the wallet password provided in the previous step:\n\n mkstore -wrl /home/oracle/wallet -createCredential \u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e sys\n mkstore -wrl /home/oracle/wallet -createCredential \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e sys\n\n 5. Confirm that the wallet contains credentials for each database in the\n Data Guard configuration. The `-listCredential` argument for `mkstore`\n will request the wallet password:\n\n mkstore -wrl /home/oracle/wallet -listCredential\n\n3. Log in to the observer VM as Oracle and then test connectivity to the\n primary and standby databases. Connect to the primary and secondary\n databases with SQL\\*Plus by using the wallet credentials:\n\n sqlplus /@\u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e as sysdba\n sqlplus /@\u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e as sysdba\n\n If the wallet configuration is successful, the `sqlplus` command directly\n logs in to the database without asking for a password.\n\nConfigure and enable Fast-Start Failover\n----------------------------------------\n\n1. Create a directory to store the observer configuration and log files:\n\n mkdir /home/oracle/fsfo\n\n2. Connect to the Data Guard broker on the primary database using the wallet:\n\n dgmgrl\n CONNECT /@\u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e;\n\n3. View the Data Guard status to check that the configuration is marked as\n `SUCCESS`:\n\n SHOW CONFIGURATION;\n\n4. Enable Fast-Start Failover (FSFO):\n\n ENABLE FAST_START FAILOVER;\n\n Enabling FSFO does not make the configuration ready for automatic failover.\n Automatic failover requires an observer.\n5. Start Data Guard Observer:\n\n START OBSERVER observer1 IN BACKGROUND FILE IS '/home/oracle/fsfo/observer1_DBDG.dat' LOGFILE IS '/home/oracle/fsfo/observer1_DBDG.log';\n\n6. In a separate terminal session, verify the configuration:\n\n SHOW CONFIGURATION VERBOSE;\n\n The following example shows the verbose mode of the `show configuration`\n command. If the configuration status is `SUCCESS`, your setup is complete. \n\n Configuration - DBDG\n\n Protection Mode: MaxAvailability\n Members:\n \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eDBDG_SITE1\u003c/span\u003e\u003c/var\u003e - Primary database\n \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eDBDG_SITE2\u003c/span\u003e\u003c/var\u003e - Physical standby database\n\n (*) Fast-Start Failover target\n\n Properties:\n FastStartFailoverThreshold = '30'\n OperationTimeout = '30'\n TraceLevel = 'USER'\n FastStartFailoverLagLimit = '45'\n CommunicationTimeout = '180'\n ObserverReconnect = '0'\n FastStartFailoverAutoReinstate = 'TRUE'\n FastStartFailoverPmyShutdown = 'TRUE'\n BystandersFollowRoleChange = 'ALL'\n ObserverOverride = 'FALSE'\n ExternalDestination1 = ''\n ExternalDestination2 = ''\n PrimaryLostWriteAction = 'CONTINUE'\n ConfigurationWideServiceName = 'DBDG_CFG'\n\n Fast-Start Failover: Enabled in Potential Data Loss Mode\n Lag Limit: 45 seconds\n Threshold: 30 seconds\n Active Target: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eDBDG_SITE2\u003c/span\u003e\u003c/var\u003e\n Potential Targets: \"\u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e\"\n \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eDBDG_SITE2\u003c/span\u003e\u003c/var\u003e valid\n Observer: observer1\n Shutdown Primary: TRUE\n Auto-reinstate: TRUE\n Observer Reconnect: (none)\n Observer Override: FALSE\n\n Configuration Status:\n SUCCESS"]]