6.2.2 Using Oracle Replication in WebNMS



The design of WebNMS is such that both Primary and Standby servers share the same database. In this scenario, if the database crashes (most unlikely) both the BE and the FE would lose their connection and eventually go down. Though WebNMS does not provide out-of-the-box support for database failover, users can use various mechanisms offered by Oracle such as Oracle Replication and Oracle Clustering for handling database failure.

 

This topic explains how database replication works and the procedure to set up the database to support replication.

 

How Does Database Replication Work?

 

Assume that you have

This scenario is depicted in the following image.

 

What happens when DB1 fails?

 

In the above given scenario, when the database DB1 that is connected to BE1 fails,

 

 

What happens when BE1 fails?

 

In the above scenario, when the primary server BE1 fails,

What happens when connection between BE1 and DB1 fails?

 

If DB1 and BE1 are in different machines and the network connection between them fails,

As the contents of DB2 are in synchronization with DB1, chances of data inconsistency are ruled out in both the above cases.

Top

 

Procedure to Set Up Database Replication

 

The procedure is explained based on an example with the following names.

This procedure assumes that the primary database is created in the machine where primary server is installed and secondary database is created in the machine where secondary server is installed. You can create databases in different machines also, i.e., the primary database need not necessarily be created in primary server machine.

 

Note:

  • The procedure explained is based on Oracle Database Replication in Solaris.

  • The primary server BE1 should be connected to primary database DB1. Similarly, the secondary server BE2 should be connected to secondary database DB2. For information on setting up this, refer to WebNMS Configuration.

  • Both the primary and the secondary servers should have the same license files.

  • Dynamic table replication is not supported.

 

Installing Oracle

Top

 

Creating Databases

 

Create two databases, namely DB1 (primary database) and DB2 (secondary database) in BE1 (primary server) and BE2 (secondary server) respectively. The SID of the database should be unique, i.e., DB1 and DB2.

 

For information on creating the database, refer to Oracle technical manuals.

 

After creating the database,

Follow the same procedure for the database DB2 in the secondary server BE2.

Top

 

Creating / Setting Up Oracle Net8 Names

 

Follow this procedure in both the machines - BE1 (where DB1 database is created) and BE2 (where DB2 database is created). This procedure is done to create/setup Oracle Net8 Names to enable the communication between the two databases DB1 and DB2.

Follow the same procedure to create Net8 Service Name for the machine BE2 with database DB2 by giving BE1's SID and host name. For example, net service names can be db2 in the BE1 to connect to DB2 and db1 in BE2 to connect to DB1.

Top

 

Creating Users

 

Create a user where all the application tables (i.e., WebNMS tables) are created, in both the machines - BE1 (where DB1 database is created) and BE2 (where DB2 database is created).

 

Note: The user names created on both the databases should be the same.

 

For information on creating users, refer to Oracle technical manuals.

Top

 

Creating Tables

 

To set up replication, you should have all the tables created in the user's schema. The tables are to be created only on the Master Definition Site i.e. DB1 (primary database) on BE1 (primary server).

 

Tip: To create the tables, start WebNMS Server. Initially the tables are created and then the processes are started. You can view this in the command prompt. Before the process could start, kill the server. On performing this, the tables are created. Check the Database Schema for data types that Oracle Replication does not support.

 

Note: Oracle supports Number, Date, Varchar, Char, BLOBS, CLOBs data types but does not support the replication of columns that use the LONG datatype.

Top

 

Replication Setup

 

In the machine where primary database (DB1) is created,

Repeat the same procedure to add the database (DB2) in the same machine BE1 with the host name and SID as DB2.

Top

 

Setting Up Master Site and Master Definition Site

Top

 

Creating Database Links for Replication

 

Assumption: Here the database link is named as solaris1 and solaris2 because these are the host names that the DB1 and DB2 resides. Any names can be given.

In the DB1 database


shell >> sqlplus /nolog

 

SQL > connect system/manager

connected

 

SQL > create public database link  solaris2  using 'db2';

database link created.

 

SQL > connect repadmin/repadmin

connected

 

SQL > create database link solaris2 connect to repadmin identified by repadmin;

Database link created.

In the DB2 database


shell >> sqlplus /nolog

 

SQL > connect system/manager

connected

 

SQL > create public database link  solaris1  using 'db1';

database link created.

 

SQL > connect repadmin/repadmin

connected

 

SQL > create database link solaris1 connect to repadmin identified by repadmin;

Database link created.

Note:
 db2 is the Net Service Name that you have created earlier to point to the DB2 database.

Top

 

 

Creating Master Groups at the Master Definition Site

Top

 

Generating Replication Support

 

Note: Before starting the replication activity, ensure that the replication support is generated for the objects.

Top

 

Starting Replication Activity

Top

 

Configurations to be done in WebNMS

 

Perform the steps to setup Oracle database in both primary server (BE1) and secondary server (BE2) by referring to Procedure to Configure AdventNet WebNMS for Oracle section.

 

In secondary server (BE2), edit the file FailOver.xml located in <Web NMS Home>/conf directory.

Example:

 

<FAILOVER>

       <STANDBY

               FAIL_OVER_INTERVAL="60"

                RETRY_COUNT="1">

                <BACKUP

                        ENABLED="TRUE"

                        BACKUP_INTERVAL="600" />

        </STANDBY>

</FAILOVER>

Top

 

Starting WebNMS with Database Replication

Now the data present in the primary database DB1 is replicated to the secondary database DB2 as scheduled.

Top

 

 


Copyright © 2013, ZOHO Corp. All Rights Reserved.