Skip to main content

Step by Step How to Configure Observer and Enable Fast Start Failover: Oracle Dataguard


How to Configure Observer and Enable Fast Start Failover for Oracle Dataguard

The article covers configuring observer on Windows Server only. Although setting up Observer on Linux to Monitor your DG setup for automatic Failover doesn't differ much from Windows, Installing Observer on Linux will be covered in different post.

To install broker on Windows Server, The first requirement is to find a way to run the observer process in background. You can use one of following methods for the same.


            1. HSTART ( Hidden Start ) software (keep in mind its not free)

             2. SilentCMD (its free)

             3. Windows task Scheduler.


Lets pick up the easiest way and quickly configure Observer on Windows without wasting much time. I am not going to use any of the 3 listed above rather keeping it more easy.


Advice :- There are lots of Parameter (Variables) and Values used in this post are specific to my Test Environment. Please Change them as per your Environment. Also while you are changing these please be very careful and avoid any typo etc otherwise your Observer will not start.


Step1: Install Oracle Database Software 

I am assuming that you have already installed Oracle binaries if not then its time to install.


Step2: Configure TNS Entries

2. Make sure your Primary and Standby database is reachable from Observer Server and TNSNAMES.ORA has entry for both Primary and Standby. Ensure TNSPING is working for both from Observer Server


MYDBP.ORACLE.COM =

 (DESCRIPTION =

   (ADDRESS_LIST =

     (ADDRESS = (PROTOCOL = TCP)(HOST = prod.oracle.com)(PORT = 1521))

   )

 (CONNECT_DATA =

   (SERVICE_NAME = MYDB)

 )

)

MYDBS.ORACLE.COM =

 (DESCRIPTION =

   (ADDRESS_LIST =

     (ADDRESS = (PROTOCOL = TCP)(HOST = stdby.oracle.com)(PORT = 1521))

   )

 (CONNECT_DATA =

   (SERVICE_NAME = MYDB)

 )

)


Step3: Create Directory Structure

On observer Server create following directories.


       mkdir C:\oracle\diag\observer\\trace\
       mkdir C:\oracle\admin\\


Note:- Adjust the path as per your Environment


Step4: Download below exe for your OS


Below exe is available as part of Resource Kit Tools and can be downloaded from HERE

Copy both the exe's  instsrv.exe and srvany.exe in C:\windows\system32

instsrv.exe to C:\windows\system32

srvany.exe  to C:\windows\system32

Note :- instrsrv.exe is used to install the service while srvany.exe acts as a wrapper around the application and handles the service events. Both utilities are available as part of Microsoft’s Windows Server 2003 Resource Kit Tools. For more information on this visit



Step5: Create Windows Service


Create a windows service for your Observer


              cd C:\WINDOWS\system32


             sc create ObserverMYDB binPath= C:\Windows\System32\srvany.exe DisplayName= "ObserverMYDB" (replace ObserverMYDB as you Need)


Step6: Create Registry Entry


Create a Windows registry entry for your application

 

create file edit_reg_for_observer.reg with following contents. Please pay attention to the file extension. Please adjust the following as per your environment.

     ORACLE_HOME

     ORACLE_SID

     TNS_CONNECT

     PASSWORD


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ObserverMYDB\Parameters]

"Application"="C:\\oracle\\product\\11.2.0.4\\home_1\\BIN\\DGMGRL -logfile "C:\\oracle\\diag\\observer\\MYDB\\trace\\observer.log" -silent sys/XXX@MYDBP.ORACLE.COM  \"start observe\""


Step7: Update Registry 


Double click on edit_reg_for_observer.reg. This will create a registry entry for your Observer.


Step8: Create Registry Entry "Application"


Navigate in regedit to Parameters (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ObserverMYDB\Parameters) right click and create new String Value called ‘Application’ and  set following value.


C:\oracle\product\11.2.0.4\home_1\BIN\DGMGRL -logfile "C:\oracle\diag\observer\MYDB\trace\observer.log" -silent sys/xxxx@MYDBP.ORACLE.COM  "start observer file=C:\oracle\admin\\MYDBP\fsfo.dat"


How to Creae String Value Entry on Windows


Step9: Start Observer Service


Start the Service ObserverMYDB.

open  command prompt (cmd)

type  services.msc

locate Service ObserverMYDB

right click

go to properties and change startuptype from Manual to Automatic

Right click on the service and start.


Step10: Verify Logfiles


Check the observer logfile and Configuration file

C:\oracle\diag\observer\MYDB\trace\observer.log

C:\oracle\admin\\MYDBP\fsfo.dat


And you are done with Observer Setup.


Go to Primary Database. use dgmgrl utility and enable fast_start_failover.


Comments