tms installation sql replication guide

30
OneDOT Tunnel Management System Application Installation and Replication Guide

Upload: alexionumanarca

Post on 01-Oct-2015

33 views

Category:

Documents


2 download

DESCRIPTION

tms

TRANSCRIPT

  • OneDOT Tunnel Management System Application Installation and Replication Guide

  • 1

    Table of Contents

    Overview of the Tunnel Management System 2

    TMS Installation 3 Setup Options................................................................................................ 3

    Standalone Installation .......................................................................... 3 Client-Server Installation ....................................................................... 3

    TMS Microsoft SQL Server Version Installation...................................... 3 TMS Microsoft Access Version Installation ............................................... 4 TMS.ini File Configuration............................................................................ 4

    TMS Microsoft Access Version .......................................................... 4 TMS Microsoft SQL Server Version ................................................... 5

    TMS Inspection Data Replication 7 TMS Replication User Processes ................................................................ 7 Setting up Replication on the TMS SQL Server Database ..................... 8

    Setting Up the Distributor, Publisher, and Subscribers..................... 8 Setting Up the Publication................................................................... 14 Creating the Initial Snapshot............................................................... 22

    TMS Logins.................................................................................................. 24 Synchronizing Data between the TMS Applications ............................... 24

    Creating the Inspection Replica.......................................................... 24 Synchronizing Inspection Data ........................................................... 26 Data Synchronization Conflicts .......................................................... 28

  • 2

    Overview of the Tunnel Management System The Tunnel Management System (TMS) is designed to allow owners of a system of tunnels or single tunnel to monitor the physical condition of their tunnel assets. If used over a period of time, the software will provide a tool for the owner to see trends in the performance of particular components of their system.

    The software was originally developed using Microsoft Access for data storage and Microsoft Visual Basic as the programming language. The user interface provides access to the data through a graphical point and click method. The software provides owners with access to data that documents the physical condition of their tunnel assets. The data is in the form of element condition ratings, sketches, photos, and videos of defects, textual comments describing conditions, a log of repairs that have been made, and costs associated with repairs. An additional version of the application was created using Microsoft SQL Server as its data source for organizations that wish to use Microsoft SQL Server as the back-end database.

    The purpose of this document is to describe the TMS application replication setup and to aid system administrators in troubleshooting any synchronization problems. The use of the replication/synchronization features within TMS is completely optional. It was added to facilitate the transfer of data collected in the field to the TMS system in the organizations office. All data can be collected can be brought back into the office and input through the user interface without using synchronization.

  • 3

    TMS Installation Setup Options The TMS application may be installed on a single PC (Standalone) or on a shared network drive so many users can access the application (Client-Server). During the installation process, you will be prompted to select a setup type (see below). Select the desired Setup Type and click Next.

    Standalone Installation

    This setup type is for users who want to run TMS on a single PC. It installs all TMS application files, data files, and support files on the local PC. Only the PC that runs the installation will be able to use the application. If Standalone installations are run on several PCs in an organization, they will not be able to access each others data.

    Client-Server (Network) Installation

    This setup type is for users who want to run TMS on several PCs that are connected to a network and involves a two-step installation process. The Server setup type is run once and installs TMS application and data files on a shared network location. Thus, many users can access the same data using the application on the network. The Workstation setup type must then be run on each PC. This setup type installs Windows system files necessary to run TMS on the local PC. Because the Workstation setup does not know where the server-based TMS application was installed, shortcuts to the TMS executable on the network must be made manually by the installer after running the Workstation setup type.

    TMS Microsoft SQL Server Version Installation The TMS SQL Server Version requires SQL Server version 8.0 or greater. The TMS SQL database uses SQL Server authentication. When installing the TMS SQL Server Version, a SQL Server database backup file is extracted when the Standalone or Server setup type is run. It is located in a folder called Data beneath the program installation folder. The file is named ONEDOT_TMS.BAK. This file should be restored to the organizations SQL Server by a database administrator and is to be used as the data source for the TMS application. It is recommended that the name given to the restored database is ONEDOT_TMS.

    A sample tunnel system was installed as part of the TMS application setup. The TMS SQL Server Version installation creates a folder called Sample Data beneath the program installation folder. This folder contains a SQL Server database backup file called ONEDOT_TMS_SAMPLE_DATA.BAK. This file should be restored to the organizations SQL Server by a database administrator. It is recommended that the name given to the restored database is ONEDOT_TMS_SAMPLE_DATA. Sample data files are also extracted to the Sample Data folder. To use this sample data as your system, the TMS.ini file must be updated. See the instructions enclosed in the TMS.ini file for more information.

  • 4

    Refer to the file Readme.txt, located in the Resouce folder on the TMS installation CD, for information required by database administrator to restore either of these databases.

    TMS Microsoft Access Version Installation If the Client-Server setup type is selected and the users intend to use the replication features, an additional installation step must be taken to allow the server-based executable file to create replicas and synchronize data. The Microsoft Jet Synchronizer component must be installed on the server machine. This can be found on the ONEDOT TMS Microsoft Access Version Installation CD in the Resource folder. The setup file is called Jet40Repl.exe. Run this setup on the server machine to enable Microsoft Jet replication.

    A sample tunnel system was installed as part of the TMS application setup. The TMS Access Version installation creates a folder called Sample Data beneath the program installation folder. This folder contains an Access database backup file TMS_SAMPLE_DATA.mdb. Sample data files are also extracted to the Sample Data folder. To use this sample data as your system, the TMS.ini file must be updated. See the instructions enclosed in the TMS.ini file for more information.

    TMS.ini File Configuration The TMS.ini file is an important program file that is installed with TMS. It is located in the TMS program directory. It contains configurable information that the TMS executable files uses to locate data files, database servers, replication settings, and whether the computer running TMS is being used as a data collector. This information was placed in a text-based file so that the TMS installer can change it as necessary. The TMS.ini entries can not contain UNC paths. TMS was developed assuming that all users within an organization would have a common drive letter mapped to the location that the TMS was installed to, in the case that the Client-Server setup type was chosen.

    During the installation process, the user will be presented with a dialog asking them whether they would like to use the blank TMS database (for a new tunnel system) or a sample database which contains fictitious tunnel data for example purposes. This will initially point the TMS application to the desired database. If the user would like to change which database that TMS points to, the TMS.ini file must be manually edited.

    TMS Microsoft Access Version

    The contents of the TMS.ini file installed with the Microsoft Access version of TMS are found below. If the installer selects a different installation folder than the default location (C:\Program Files\OneDOT Tunnel Management System), the TMS.ini file is changed accordingly by the setup program.

    [TMS] DatabaseFile=C:\Program Files\OneDOT Tunnel Management System\Data\TMS_Tunnel_Data.mdb SystemPath=C:\Program Files\OneDOT Tunnel Management System\Data\ ReportRatingsFile=C:\Program Files\OneDOT Tunnel Management System\ReportData.mdb

  • 5

    DataCollector=No ;------------------------------------------------------------------ ; SAMPLE DATA ENTRIES ; To use the sample data delivered with the TMS application, ; the following lines should be enabled by deleting the semicolons ; before each entry. When using the sample data the entries ; above should be disabled by placing semicolons in front of the ; entries. ;------------------------------------------------------------------ ;DatabaseFile=C:\Program Files\OneDOT Tunnel Management System\Sample Data\TMS_SAMPLE_DATA.mdb ;SystemPath=C:\Program Files\OneDOT Tunnel Management System\Sample Data\ ;ReportRatingsFile=C:\Program Files\OneDOT Tunnel Management System\ReportData.mdb ;DataCollector=No

    The DatabaseFile entry specifies the path and filename of the TMS database to use. This entry can be updated to use an inspection replica when using a tablet PC or laptop when inspecting in the field.

    The SystemPath entry specifies the folder where the file-based TMS data is located. This path must be the same folder that the TMS database is located in.

    The ReportRatingsFile entry specifies the path and filename of the database file that is used when running an Element Condition report. If the Client-Server setup type is used, this should point to the ReportData.mdb file in the clients TMS installation folder. In the Client-Server setup, all clients run the same network-based executable file. Because of this, the TMS.ini file settings are the same for all clients. Thus, all client installations must be installed to the exact same folder to find this ReportRatingsFile path.

    The DataCollector entry specifies whether this PC is being used as a data collector in the field. This should be changed to Yes if running on tablet PC or laptop when inspecting in the field. This setting allows the user to open the field sketch files in Microsoft Paint to update the field sketch file. If this entry is set to No, the field sketch opens in the TMS image viewer screen (default behavior).

    TMS Microsoft SQL Server Version

    The contents of the TMS.ini file installed with the Microsoft Access version of TMS are found below. . If the installer selects a different installation folder than the default location (C:\Program Files\OneDOT Tunnel Management System), the TMS.ini file is changed accordingly by the setup program. [TMS] TMSSQLServer=PC50822 TMSSQLDBName=ONEDOT_TMS SystemPath=C:\Program Files\OneDOT Tunnel Management System\Data\ ReportRatingsFile=C:\Program Files\OneDOT Tunnel Management System\ReportData.mdb ;------------------------------------------------------------------ ; SAMPLE DATA ENTRIES ; To use the sample data delivered with the TMS application, ; the following lines should be enabled by deleting the semicolons ; before each entry. When using the sample data the entries ; above should be disabled by placing semicolons in front of the ; entries. ;------------------------------------------------------------------ ;TMSSQLServer=PC50822 ;TMSSQLDBName=ONEDOT_TMS_SAMPLE_DATA ;SystemPath=C:\Program Files\OneDOT Tunnel Management System\Sample Data\ ;ReportRatingsFile=C:\Program Files\OneDOT Tunnel Management System\ReportData.mdb [Replication]

  • 6

    Publisher=PC50822 PublisherDatabase=ONEDOT_TMS Publication=ONEDOT_TMS PublisherLogin=TMSUser PublisherPassword=TMSUser

    The TMSSQLServer entry specifies the name of the SQL Server machine that the TMS database was

    restored to. This entry must be updated manually after installation. The TMSSQLDBName entry specifies the name of the SQL Server database that contains the TMS

    application data. The default name ONEDOT_TMS is preferred so this entry does not need to be updated in the TMS.ini file.

    The SystemPath entry specifies the folder where the file-based TMS data is located. The ReportRatingsFile entry specifies the path and filename of the database file that is used when

    running an Element Condition report. . If the Client-Server setup type is used, this should point to the ReportData.mdb file in the clients TMS installation folder. In the Client-Server setup, all clients run the same network-based executable file. Because of this, the TMS.ini file settings are the same for all clients. Thus, all client installations must be installed to the exact same folder to find this ReportRatingsFile path. The TMS.ini entries in the [Replication] section of the file need to be updated correctly only if replication is implemented in your TMS application.

    The Publisher entry specifies the SQL Server machine that is the replication publisher. This entry must be updated manually after replication is configured.

    The PublisherDatabase entry specifies the TMS database that has been published for replication. If the database administrator restores the TMS database with a database name of ONEDOT_TMS, this entry does not need to be updated.

    The Publication entry specifies the name of the replicated publication. If the publication is named ONEDOT_TMS during replication configuration, this entry does not need to be updated.

    The PublisherLogin entry specifies the username that the client (TMS application) uses when synchronizing with the TMS SQL Server database. If the database administrator is logged in with the TMSUser SQL Server database username when configuring replication of the TMS database, this entry does not need to be updated

    The PublisherPassword entry specifies the password that the client (TMS application) uses when synchronizing with the TMS SQL Server database. If the database administrator is logged in with the TMSUser SQL Server database username when configuring replication of the TMS database, this entry does not need to be updated

  • 7

    TMS Inspection Data Replication The TMS inspection data replication functionality allows the tunnel inspectors to collect data in the field using tablet PCs or laptops and synchronize it with the TMS application installed in their organizations office. This way, the application data in the office and on the tablet PCs will be up-to-date with each other and data entry is streamlined.

    The information that is synchronized comes in 2 forms: file based data including field sketches, photos, and videos and database information that is stored in a Microsoft Access file on the tablet PC. The file based data is synchronized with the data on the organizations TMS workstation or network by copying the files from the tablet PC to the office workstation or network and vice-versa until the files and folders in both locations match. The Microsoft Access data is synchronized with the data on the organizations TMS workstation or network server using ActiveX controls on the tablet PCs.

    Regardless of whether the back-end database is Microsoft or Microsoft SQL Server, the inspection replica creation and synchronization process is the same. After the office TMS user creates a new inspection period for a tunnel and enters the field sketch forms within TMS, he uses the Replication menu on the System Definition screen to create one or many inspection replica(s). These replicas are in Microsoft Access file format and are copied to the tablet PCs via the organizations LAN or some media like CD, DVD, flash drive, etc. Additionally, any field sketch bitmap files are copied to the tablet PC for updates during this step. The tablet PCs users then use the TMS application to collect field data such as element ratings, field sketches, photos, and videos. When complete, the replica and inspection data files are either moved back onto some type of media for file transfer or the tablet PC is connected to the organizations LAN. The office TMS user then browses to the location of the inspection replica(s) for data synchronization. The synchronization process is bi-directional, meaning that data updates done on the tablet PCs are pushed to the workstation or server application and data changes performed on the workstation or server application are pulled down to the tablet PCs. The office TMS user can then review the inspection data, update it if necessary and post it so it is able to be viewed by all users. The figure below outlines these steps in a user process diagram.

    TMS Replication User Processes Office User

    `

    INSPECTION PREPARATION PROCESSDefines tunnel systemDefines tunnels & elementsDefines tunnel panels and which elements are part of these panelsCreates an inspection periodUpdates elements with field sketch forms

    Office UserREPLICA CREATION PROCESS

    Selects replica output path and file nameSpecifies number of replicas to createGenerates replicasLocates TMS field sketch files to copy to Tablet PCCopies replica and field sketch files to Tablet PCUpdates TMS.ini file to use replica

    Tablet PC UserINSPECTION PROCESS

    Inspects tunnel and enters element ratings, updating inspection replica databaseUpdates field sketch files to show defectsTakes photographs/videos and enters them using TMS application, updating inspection replica databaseCopies inspection replica and inspection files to media or connects to LAN

    Office UserPOST-INSPECTION SYNCHRONIZE PROCESS

    Browses to inspection replica database if synchronizing inspection databaseSelects tunnels and inspection periods if synchronizing inspection filesExecutes synchronization

    Office User

    `

    REVIEW PROCESSReviews unposted inspection dataUpdates data as necessaryPosts data so all TMS users can view inspection findings

    File Transfer or LAN Connection

    `

    `

    File Transfer or LAN Connection

  • 8

    Setting up Replication on the TMS SQL Server Database The first step in enabling data synchronization with the TMS application is to set up SQL Server Replication. The steps below will outline the steps needed to enable Replication of the TMS SQL Server database on your organizations SQL Server machine. Some of the first steps may be skipped if there is already replication occurring on this machine. Some of the following screenshots will be slightly different because they were created on a development machine, but the steps to be taken are the same.

    The type of replication that the TMS application uses called merge replication, using anonymous subscribers. The subscriptions will be pull subscriptions. This type of replication is designed for users that need to update data but are disconnected from the network.

    Setting Up the Distributor, Publisher, and Subscribers

    1. Open SQL Server Enterprise Manager and navigate to your organizations SQL Server.

  • 9

    2. If Replication is not already configured, right click the Replication folder and select Configure Publishing, Subscribers, and Distribution

    3. Click Next on the Welcome to the Configure Publishing and Distribution Wizard form.

  • 10

    4. Select the top option to use the organizations SQL Server machine as it own Distributor. Click Next.

    5. Enter the path to the preferred snapshot folder. YOU MUST SPECIFY A FOLDER ON A SHARED NETWORK DRIVE FOR THE SNAPSHOT FOLDER TO ENSURE THAT THE TABLET PCs CAN ACCESS THE SNAPSHOT FOLDER at any time. Use the UNC naming convention in the case that a particular drive letter is not mapped. All TMS Users must have read/write access to this folder. Click Next.

  • 11

    6. Select Yes, let me set the distribution properties. Click Next.

    7. Accept the default settings for the name and location of the distribution database. Click Next.

    8. Select only the organizations SQL Server machine to set it up as a Publisher. Click Next.

  • 12

    9. Select only the ONEDOT_TMS database for Merge replication to enable the Publication database. Click Next.

    10. Select NONE (click Enable None) of the SQL Server machines as subscribers. TMS will use anonymous pull subscriptions from the tablet PCs.

    11. Verify your settings on the Completing the Configure Publishing and Distribution Wizard form. Click Finish. The SQL Server will enable the machine as a distributor. You will see a progress screen appear as the server is enabled as a distributor.

  • 13

    12. Acknowledge the message that the organizations SQL Server machine was enabled as a distributor. Click OK.

    13. Acknowledge that the Replication Monitor has been added to the console tree. Click OK.

  • 14

    Setting Up the Publication

    1. Right click the Publications folder beneath the Replication folder and select the New Publication option.

    2. Click Next on the Welcome to the Create Publication Wizard form.

  • 15

    3. Select the ONEDOT_TMS database so choose it as the Publication Database. Click Next.

    4. Select Merge publication on the Select Publication Type form. Click Next.

    5. Select only the Heterogeneous data sources, such as Microsoft Access option on the Specify Subscriber Types form. Click Next.

  • 16

    6. Click the Article Defaults button on the Specify Articles form.

    7. Select Table articles on the Default Article Type form. Click OK.

    8. On the General tab, make sure that Treat changes to the same column as a conflict radio button is selected. On the Resolver tab, check the Allow Subscribers to resolve conflictscheck box is selected. Click OK.

  • 17

    9. On the right grid, select (check) all tables that are part of the TMS application database. These are indicated by the TMSUser in the Owner column. Do not select any non-application tables (such as system tables).

  • 18

    10. Acknowledge the article issues that exist with creating this publication on the Article Issues form. Click Next.

    11. Change the Publication name to ONEDOT_TMS. Click Next.

  • 19

    12. Select the Yes, I will define data filters radio button. Click Next.

    13. Do not check either of the filtering options. Click next.

    14. Select the Yes, allow anonymous subscriptions radio button. Click Next.

  • 20

    15. Uncheck the Create the first snapshot immediately checkbox. Allow the Snapshot Agent schedule to run once a week. You may change the run time if you wish, but run the agent once a week.

    16. Verify your settings on the Completing the Create Publication Wizard. Click Finish.

    17. You will see the progress as articles are created. Allow this form to close itself.

  • 21

    18. Acknowledge that the Publication was successfully created. Click the Publication Properties... button.

    19. Select the Subscriptions never expire radio button. Click OK.

  • 22

    Creating the Initial Snapshot

    Creating the initial snapshot will generate many files in the snapshot location designated in step 5 of the Setting up the Distributor, Publisher, and Subscriptions section. These files are used to synchronize the tablet PC TMS databases with the TMS SQL Server database and keep their database structures the same. Follow the following steps to create the initial snapshot.

    1. In SQL Server Enterprise Manager, navigate to the Replication Monitor>Agents>Snapshot Agent node. You should see the TMSTunnels Publication in the right pane and the status should say Never started.

    2. Right click the TMSTunnels Publication and select Start Agent. The agent will start and create the files in the snapshot directory.

  • 23

    3. Look at Windows Explorer in the specified snapshot directory and verify that the files are being created. This may take several minutes for this process to complete.

    snap

    4. When the process is completed, the Snapshot Agent view will show that the ONEDOT_TMS Publication Status is Succeeded. The replicated database is now able to interact with the TMS application replication/synchronization features.

  • 24

    TMS Logins Access to TMS is controlled by three different security levels. Options available to users are based on these levels.

    Privilege Level Description Username & Password (same)

    Wizard User This user has privileges to create or change the tunnel system, manage users, create and synchronize inspection replicas and data files, and perform all functions available to users with Data Entry and Viewer privileges.

    admin

    Data Entry User This user has privileges to enter ratings; maintain sketches, photos, and videos; enter comments, defect quantities, repair logs, emergency incidents, data tab information, and expenditure data.

    entry

    Viewer This user has privileges only to view data. By default, any person who has access to the application is a Viewer without specifically having to be defined within the TMS user base.

    user

    Synchronizing Data between the TMS Applications Inspection replicas can be created using either the Microsoft Access or Microsoft SQL Server version of TMS. The inspection replica created by TMS is a Microsoft Access file that contains the exact data as the TMS back-end database at the time of its creation. This replica is placed on a tablet PC or laptop for inspection data collection purposes. Thus, organizations using the replication features in TMS must install the Microsoft Access version of TMS on their data collectors, even if their back-end database in the office is Microsoft SQL Server. It is advised that while replicas are being populated and updated with data in the field, no updates to TMS data are done to the TMS back-end database in the office. This will eliminate data conflicts that can occur during synchronization.

    The data files (field sketch, photos, and videos) can also be copied to the data collector for update or comparison during the inspection. These files should be copied to the TMS System folder identified in the TMS.ini file and should maintain the same folder structure as the TMS system folder in the office.

    Creating the Inspection Replica

    To create an inspection replica, a user with wizard privilege level must be at the System Definition screen. Click the Replication Menu and select the Create Inspection Replica menu item.

  • 25

    At the Create Inspection Replica screen, specify the replica destination path, filename, and number of replicas to create. Click the Generate Replica(s) button.

    As the replica is created, the progress of the operation will be displayed.

  • 26

    When the process is complete, a message indicating success will be displayed.

    Synchronizing Inspection Data

    After data has been collected in the field, the database information and inspection data files can be synchronized with the TMS system in the organizations office. The inspection replica and data files can be accessed either through connecting the data collector to the organizations LAN or copying the inspection replica and files to media. If the files are coped to media, it is recommended that the entire TMS system folder identified in the TMS.ini file is coped to the media to ensure that the correct folder and file structure is maintained. This is necessary for a successful synchronization.

    To synchronize with an inspection replica and/or files, click the Replication Menu and select the Synchronize Inspection Data menu item. You can choose to synchronize inspection replica database information, the data files, or both. To synchronize with the inspection replica, browse to the inspection replica file to have its path and filename entered in the Inspection Replica Database textbox. To synchronize the data files, select which tunnels you wish to synchronize by selecting the checkbox and specify which inspection period. When done, click the Synchronize button.

  • 27

    As the data is synchronized, the progress of the operation will be displayed.

    When the process is complete, a message indicating success will be displayed.

  • 28

    Data Synchronization Conflicts

    Sometimes data synchronization conflicts can occur in the TMS database because two or more users update the same database row and column between synchronizations. When the data is synchronized, the database, be it Microsoft Access or Microsoft SQL Server, will recognize that there are conflicting data updates. By reviewing the conflicts in the Microsoft Replication Conflict Viewer, a user can view conflicting data and select which data to keep. When this choice is made, the data is no longer conflicting.

    To view any conflicts in the TMS database, open the conflict viewer in from the Microsoft SQL Server Enterprise Manager. To do this, right click the publication created for the TMS application and select View Conflicts

    The replicated TMS database is selected and any tables with conflicts are listed. Select one of the tables and click the View button to examine the conflicting data.

  • 29

    After examining the data, you can select which data to keep by clicking either the Keep winning change button or the Resolve With This Data button.

    After all conflicts have been resolved, you will see no more tables with conflicts listed in the initial screen

    To invoke the Microsoft Replication Conflict Viewer for a TMS system using a Microsoft Access back-end database, simply open the database in Microsoft Access. If there are any conflicts, you will be prompted to resolve the conflicts.