Back

Topic

[KB305]Replication sample with 2 SQL Express and 1 SQL Standard

Tags: MSSqlServer, SQL, SQL Server

14 years ago
By RM
Options
Print
Applies to:

PcVue all versions with support for SQL Server 2005.
The basic content of this article may also be applicable to other versions of Pcvue and SQL Server although the detail may vary.


Summary:

A possible and tested way to backup history using replication.


Details:

1.       Verifying installation of SQL Server Express on 2 PcVue stations and SQL Server Standard on a database server. Installation should be done with the replication and mixed authentication enabled.

2.       Enabling TCP / IP connections and leave the following MSDTC using Online Database Manager.

3.       Creating a bidirectional replication between 2 PcVue servers and a replication from PcVue servers to the station which have an SQL server database. Thus 2 replications on 2 PcVue servers. The intention is to initiate bidirectional replication from the active server (small replication) and replication to the database server from the passive station (large replication). 

Here’s a diagram:

Replication_sample_with_2_SQL_Express_and_1_SQL_Standard_1

4.       Establishment launches replications in PcVue:

– Added 3 ODBC data sources to 3 bases on the 2 PcVue servers.

– Added ReplicationConf.ini file in the directory TP of the project and modification of the file based on replication and ODBC sources. The file is slightly different on the 2 servers on the unidirectional replication.

– Added program SCADA_replication.pgr in the directory P of the project and modified it despite warnings in the header of the program.

5.       Indeed this is what we want to do:

a) No initiated unidirectional replication from the active station.

b) No initiated bidirectional replication from the passive station.

c) If there is only one server launch, it is active but you have to start the unidirectional replication.

d) At the start we must necessarily start bidirectional replication, active or passive.

6.     Here are the changes in the program to handle this correctly:

In this example Server 1 is named WS01, server 2 is named WS02 and station 3 is named WS03.
Function AddReplications(), line 213

Replication_sample_with_2_SQL_Express_and_1_SQL_Standard_2

7.       Note that it is possible at the end to configure PcVue to be able to read trends from the station 3 by configuring the database in read only mode in PcVue and by using Scada Basic instruction to force this unit as primary


Created on: 17 Dec 2010 Last update: 13 May 2024