Start the Observer and Enable Fast-Start Failover

Install the observer on an Azure Compute VM in a separate availability zone and enable fast-start failover.
The Observer is a low-footprint client built into the DGMGRL CLI and, like any other client, may be run on a different hardware platform than the database servers.

Data Guard broker automates and centralizes the creation, maintenance, and monitoring of Data Guard configurations. It allows you to perform all management operations locally or remotely through the broker's client interfaces:

  • Oracle Enterprise Manager Cloud Control, or
  • Data Guard command-line interface, DGMGRL
DGMGRL command-line is part of the Oracle AI Database software installation and is available at $ORACLE_HOME/bin/dgmgrl. Follow these steps to enable fast-start failover:
  1. Download and install the Oracle AI Database client on the observer VM. For Linux x64:
    unzip LINUX.X64_2326100_client.zip
    cd client
    ./runInstaller
    
  2. Create the tnsnames.ora file with connection strings for the primary and standby database. Use the recommended connection string with the SCAN name:

    Edit $ORACLE_HOME/network/admin/tnsnames.ora on the observer VM.

    vi $ORACLE_HOME/network/admin/tnsnamse.ora
    
    DBZONE1=(DESCRIPTION=(CONNECT_TIMEOUT= 90)(RETRY_COUNT=100)(RETRY_DELAY=3)(TRANSPORT_CONNECT_TIMEOUT=1000ms)(LOAD_BALANCE=off)(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=scan-vmcluster-1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME = DBzone1.ocidelegatedsu.ocivnet1.oraclevcn.com)))
    
    DBZONE2=(DESCRIPTION=(CONNECT_TIMEOUT= 90)(RETRY_COUNT=100)(RETRY_DELAY=3)(TRANSPORT_CONNECT_TIMEOUT=1000ms)(LOAD_BALANCE=off)(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=scan-mvcluster-2)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME = DBzone2.ocidelegatedsu.ocivnet2.oraclevcn.com)))
    
    haservice = (DESCRIPTION =
    (CONNECT_TIMEOUT= 90)(RETRY_COUNT=100)(RETRY_DELAY=3)(TRANSPORT_CONNECT_TIMEOUT=1000ms)(LOAD_BALANCE=off)
        (ADDRESS_LIST =
            (LOAD_BALANCE=on)
            (ADDRESS = (PROTOCOL = TCP)(HOST=scan-vmcluster-1)(PORT=1521)))
        (ADDRESS_LIST =
            (LOAD_BALANCE=on)
            (ADDRESS = (PROTOCOL = TCP)(HOST=scan-vmcluster-2)(PORT=1521)))      
        (CONNECT_DATA=(SERVICE_NAME = haservice.oracle.com)))
  3. Validate connectivity to the primary and standby databases.
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    
    dgmgrl SYS@DBZONE1
    ...
    Connected to "DBzone1"
    Connected as SYSDBA.
                
    dgmgrl SYS@DBZONE2
    ...
    Connected to "DBzone2"
    Connected as SYSDBA.
    
  4. Check the Data Guard configuration and the Fast-Start Failover target settings.
    DGMGRL> show configuration
    Configuration - db26_dgconf
      Protection Mode: MaxAvailability
      Members:
      DBzone1 - Primary database
        DBzone2 - Physical standby database
    Fast-Start Failover:  Disabled
    Configuration Status:
    SUCCESS   (status updated 20 seconds ago)
    
    DGMGRL> show database DBzone1 FastStartFailoverTarget;
      FastStartFailoverTarget = 'DBzone2'
    
    DGMGRL> show database DBzone2 FastStartFailoverTarget;
      FastStartFailoverTarget = 'DBzone1'
  5. Start the observer process on the observer VM. To run the observer in the background:
    export WALLET_DIR=/u01/app/oracle/product/23.26.0/dbhome_1/network/admin/wallet
    mkstore -wrl $WALLET_DIR -create
    mkstore -wrl $WALLET_DIR -createCredential 'DBZONE1' sysdg <password>;
    mkstore -wrl $WALLET_DIR -createCredential 'DBZONE2' sysdg <password>;
    mkstore -wrl $WALLET_DIR -createCredential 'HASERVICE' sysdg <password>;
    
    vi /u01/app/oracle/product/23.26.0/dbhome_1/network/admin/sqlnet.ora
    WALLET_LOCATION = (SOURCE = (METHOD = FILE) (METHOD_DATA = (DIRECTORY = /u01/app/oracle/product/23.26.0/dbhome_1/network/admin/wallet)))
    SQLNET.WALLET_OVERRIDE = TRUE
    
    dgmgrl SYS@DBZONE1
    DGMGRL> START OBSERVER observer3 IN BACKGROUND FILE IS /home/oracle/observer3.dat LOGFILE IS /home/oracle/observer3.log CONNECT IDENTIFIER IS haservice;
    Submitted command "START OBSERVER" using connect identifier "haservice"
    
    DGMGRL> show observer
    Configuration - db26_dgconf
      Fast-Start Failover:     DISABLED
    Observer "observer3"(23.26.0.0.0)
      Host Name:                    fsfovm3
      Last Ping to Primary:         6 seconds ago
      Log File:                     /home/oracle/observerz3.log
      State File:                   /home/oracle/observerz3.dat
  6. Enable Fast-Start Failover for the configuration.
    DGMGRL> enable fast_start failover
    Enabled in Zero Data Loss Mode.
  7. Verify that the observer and configuration status show Fast-Start Failover as enabled.
    DGMGRL> show observer
    Configuration - db26_dgconf
      Fast-Start Failover:     ENABLED
      Primary:            DBzone1
      Active Target:      DBzone2
    Observer "observer3"(23.26.0.0.0) - Master
      Host Name:                    fsfovm3
      Last Ping to Primary:         1 second ago
      Last Ping to Target:          2 seconds ago
      Log File:                     /home/oracle/observerz3.log
      State File:                   /home/oracle/observerz3.dat
    
    DGMGRL> show configuration
    Configuration - db26_dgconf
      Protection Mode: MaxAvailability
      Members:
      DBzone1 - Primary database
        DBzone2 - (*) Physical standby database
    Fast-Start Failover: Enabled in Zero Data Loss Mode
    Configuration Status:
    SUCCESS   (status updated 13 second ago)
    
    DGMGRL> show fast_start failover
    Fast-Start Failover: Enabled in Zero Data Loss Mode
    ...

The observer is running and Fast-Start Failover is enabled for the Data Guard configuration.