How To Configure Observer On Windows Server for Oracle Dataguard Fast Start Failover

Setting up Oracle Observer on Windows to Monitor your DG setup for automatic Failover.



Setting up Observer on Windows to Monitor your DG setup for automatic Failover does't differ much from Linux.

You just need to find out the way how to rung the observer process in background. Dont worry its really simple

You can use one of following methods

            1. HSTART 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 lot 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 Change theese please be very carefull and avoid any typo etc otherwise your Observer will not start.

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

2. Make sure your Primary and Standby database are 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)
 )
)


3. Login to observer Server and create following directories.

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

Note:- Adjust the path as per your Environment

4. download below exe for your OS

             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


5. 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)


6. 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 Env.
     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/MYdb2017@MYDBP.ORACLE.COM  \"start observe\""
Note:- I am really not fond of putting the Passwords in clear text Format and therefore I will soon write another post to Show you how we can use Oracle Wallet to avoid this issue


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


8. 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/MYdb2017@MYDBP.ORACLE.COM  "start observer file=C:\oracle\admin\\MYDBP\fsfo.dat"

How to Creae String Value Entry on Windows


9. Start the Service ObserverMYDB.

go to cmd-> services.msc-> locate Service ObserverMYDB-> right click-> go to properties and change startuptype from Manual to Automatic. Right click and start.

10. 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.

Next Blog to configure Broker and Add the database into Broker configuration will Follow soon............................

Have fun with Broker on Windows
Please leave your comment in the comment section like the post share on your wall do whatever you want and keep motivated......




No comments:

Post a Comment