DBMoto 6.5 Setup Guide for SQL Server Transactional Replications



Similar documents
Using DBMoto 7 in a Microsoft Windows Cluster

DBMoto 7 Setup Guide for IBM DB2 for i Transactional Replications

DBMoto. Oracle Setup Guide. Version HiT Software, Inc. T Moorpark Ave F

Moving the TRITON Reporting Databases

Outlook Profile Setup Guide Exchange 2010 Quick Start and Detailed Instructions

Video Administration Backup and Restore Procedures

Project management integrated into Outlook

SQL Server Replication Guide

NTP Software File Auditor for Windows Edition

Table of Contents. CHAPTER 1 About This Guide CHAPTER 2 Introduction CHAPTER 3 Database Backup and Restoration... 15

Setting Up ALERE with Client/Server Data

Setting up a database for multi-user access

Portions of this product were created using LEADTOOLS LEAD Technologies, Inc. ALL RIGHTS RESERVED.

Crystal Reports Installation Guide

How To Create An Easybelle History Database On A Microsoft Powerbook (Windows)

ODBC Client Driver Help Kepware, Inc.

Sage Intelligence Financial Reporting for Sage ERP X3 Version 6.5 Installation Guide

Introduction and Overview

CRM Migration Manager for Microsoft Dynamics CRM. User Guide

AssetWise Performance Management. APM Remote Upgrade Guide

Immotec Systems, Inc. SQL Server 2005 Installation Document

How to configure the DBxtra Report Web Service on IIS (Internet Information Server)

File Auditor for NAS, Net App Edition

How To Set Up Total Recall Web On A Microsoft Memorybook (For A Microtron)

STATISTICA VERSION 9 STATISTICA ENTERPRISE INSTALLATION INSTRUCTIONS FOR USE WITH TERMINAL SERVER

Cloud Services ADM. Agent Deployment Guide

Improving Performance of Microsoft CRM 3.0 by Using a Dedicated Report Server

Microsoft SQL Replication

Insight Video Net. LLC. CMS 2.0. Quick Installation Guide

Time & Expense Entry WalkThrough

BSDI Advanced Fitness & Wellness Software

TECHNICAL NOTE. The following information is provided as a service to our users, customers, and distributors.

ArcGIS 9. Installation Guide: Workgroup for Microsoft SQL Server Express

Microsoft Dynamics GP. econnect Installation and Administration Guide Release 9.0

Moving a Romexis Database to an Existing SQL Instance

Dell InTrust Preparing for Auditing Microsoft SQL Server

Upgrading from MSDE to SQL Server 2005 Express Edition with Advanced Services SP2

Automating Administration with SQL Agent

NovaBACKUP. Storage Server. NovaStor / May 2011

RoomWizard Synchronization Software Manual Installation Instructions

User Guide. Version 3.2. Copyright Snow Software AB. All rights reserved.

Bosch ReadykeyPRO Unlimited Installation Guide, product version 6.5. This guide is item number DOC , revision 2.029, May 2012.

Table of Contents SQL Server Option

DigitalPersona Pro. Password Manager. Version 5.x. Application Guide

How To Upgrade Your Microsoft SQL Server for Accounting CS Version

SMS Database System Quick Start. [Version 1.0.3]

STATISTICA VERSION 12 STATISTICA ENTERPRISE SMALL BUSINESS INSTALLATION INSTRUCTIONS

Bitrix Site Manager ASP.NET. Installation Guide

SolarWinds Migrating SolarWinds NPM Technical Reference

User s Manual. Management Software for ATS

Apple Mail Outlook Web Access (OWA) Logging In Changing Passwords Mobile Devices Blackberry...

StarWind iscsi SAN Software: Tape Drives Using StarWind and Symantec Backup Exec

Juris Installation / Upgrade Guide

ThinManager and Active Directory

SQL Server Setup for Assistant/Pro applications Compliance Information Systems

Dell Statistica Statistica Enterprise Installation Instructions

StarWind Virtual SAN Installing & Configuring a SQL Server 2012 Failover Cluster

Microsoft Dynamics GP econnect Installation and Administration Guide

Metalogix SharePoint Backup. Advanced Installation Guide. Publication Date: August 24, 2015

Management Reporter Integration Guide for Microsoft Dynamics AX

SafeCom G2 Enterprise Disaster Recovery Manual

POLICY PATROL MFT. Manual

TSM Studio Server User Guide

RSA Security Analytics

StarWind Virtual SAN Installation and Configuration of Hyper-Converged 2 Nodes with Hyper-V Cluster

ewebextra OfficeMate Integration User s Guide

Installing LearningBay Enterprise Part 2

1. CONFIGURING REMOTE ACCESS TO SQL SERVER EXPRESS

VERITAS Backup Exec TM 10.0 for Windows Servers

NetBak Replicator 4.0 User Manual Version 1.0

User Migration Tool. Note. Staging Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted Release 9.0(1) 1

Exercise Safe Commands and Audit Trail

Connecting to Manage Your MS SQL Database

Exchange Outlook Profile/POP/IMAP/SMTP Setup Guide

Portions of this product were created using LEADTOOLS LEAD Technologies, Inc. ALL RIGHTS RESERVED.

Active Directory Management. Agent Deployment Guide

USER MANUAL APPLICATION MONITOR. Version March 2015

Installation Instruction STATISTICA Enterprise Small Business

FmPro Migrator - FileMaker to SQL Server

Server Installation: ServerTools

4cast Client Specification and Installation

AWS Schema Conversion Tool. User Guide Version 1.0

Veeam Backup Enterprise Manager. Version 7.0

Silect Software s MP Author

Sitecore Ecommerce Enterprise Edition Installation Guide Installation guide for administrators and developers

Technical Paper. Defining an ODBC Library in SAS 9.2 Management Console Using Microsoft Windows NT Authentication

Advanced Event Viewer Manual

Protected Trust Directory Sync Guide

Note: With v3.2, the DocuSign Fetch application was renamed DocuSign Retrieve.

-lead Grabber Business 2010 User Guide

How To Use The Policy Patrol Archiver Server

EXPRESSCLUSTER X for Windows Quick Start Guide for Microsoft SQL Server Version 1

1 of 10 1/31/2014 4:08 PM

mylittleadmin for MS SQL Server Quick Start Guide

v4.8 Getting Started Guide: Using SpatialWare with MapInfo Professional for Microsoft SQL Server

CIMHT_006 How to Configure the Database Logger Proficy HMI/SCADA CIMPLICITY

STEALTHbits Technologies, Inc. StealthAUDIT v5.1 System Requirements and Installation Notes

Auditing manual. Archive Manager. Publication Date: November, 2015

CRM to Exchange Synchronization

Transcription:

DBMoto 6.5 Setup Guide for SQL Server Transactional Replications

Copyright This document is copyrighted and protected by worldwide copyright laws and treaty provisions. No portion of this documentation may be distributed or reproduced by any means, or in any form, without HiT Software's prior written permission. COPYRIGHT NOTICE: Copyright 2001-2010 HiT Software, Inc. All rights reserved. Disclaimer Information in these HTML documents is subject to change without notice. Although efforts have been made to ensure the accuracy of these documents, HiT Software, Inc. assumes no responsibility for damages incurred directly or indirectly from errors, omissions, and discrepancies between the software and the documents. If you find any problems in the documentation, please report them to HiT Software, Inc. Trademarks HiT Software, DBMoto and Ritmo are registered trademarks or trademarks of HiT Software, Inc. All other marks are used for the benefit of their respective owners and HiT Software, Inc. disclaims any interest in such marks. Contact Information HiT Software, Inc. Tel. +1-408-345-4001 Fax +1-408-345-4899 Electronic mail: info@hitsw.com Web site: www.hitsw.com HiT Software 1BCopyright 2010 2

This guide describes how to set up your DBMoto environment to replicate data from a Microsoft SQL Server database. DBMoto allows you to replicate data in three different ways, or modes: Refresh A one-time complete replication from source to target table, according to replication settings and scripts. You can control the timing of the replication, identify the columns to be replicated and add scripts to transform data during replication. One-way mirroring A continuous update of a replicated table based on changes to the source database that have been recorded in the database server log. Typically, this involves an initial refresh operation, as described above, to set up the target table. Then you can define the replication settings to check the transaction log on the source database at regular intervals. Any changes found in the log would be applied to the target database. Synchronization (two-way mirroring) Syncronization is appropriate when changes occur in both tables involved in the replication. Your replication settings ensure that both tables maintain the same state by checking the logs on each table and performing updates on each table as needed. This guide describes the setup process for one-way mirroring and synchronization when replicating data from a SQL Server database. The setup process for a refresh replication can usually be completed using the DBMoto wizards without additional documentation because it does not involve access to the SQL Server transaction logs. 1. Set Up Database Connections from DBMoto DBMoto requires Microsoft.NET Framework 2.0 or higher to be installed on the system where you are running DBMoto. The.NET Framework 2.0 also includes the.net data provider for SQL Server, needed for connecting to your SQL Server database. You can configure your connection to SQL Server from within the DBMoto Enterprise Manager as described in Source Connection below. 1. Make sure you have a database connection via a.net data provider to your target database (the database to which you are replicating.) Install and configure one of the supported data access products. See http://www.hitsw.com/support/kbase/dbmoto/providers_dbmoto.htm for a current list of supported providers. From the data access product, test the connection to the database. Create a connection string for the data access product/database you are using. Check the documentation for the data access product for information on how to do this. Check that the SQL Server user ID you are planning to use has sufficient permissions to complete all operations in DBMoto. The user ID should have permissions to connect, select tables, insert/update/delete records, access the transaction log and so on. For complete details, see the section DBMoto User Permissions for SQL Server. 2. Start Enterprise Manager. DBMoto provides a default database (Microsoft SQL Server CE) for your DBMoto metadata, all the information that DBMoto needs to store about your replication setup. HiT Software 1BCopyright 2010 3

3. In the Enterprise Manager tree, expand the metadata node to view the Sources and Targets nodes. Source Connection 4. Select the Sources node. 5. From the right mouse button menu, choose Add New Connection. HiT Software 1BCopyright 2010 4

6. In the Source Connection Wizard, follow steps to add a connection string and test the connection to the database. 7. In the Select Provider screen, fill out the following fields: Source Name Type a name to identify the source connection. This name appears in the Enterprise Manager tree as a way to group connections for a specific replication. Database Select Microsoft SQL Server from the drop-down list. Provider The value Microsoft.NET Driver (SQL Client) is provided automatically. You do not need to change this value. Assembly The pathname to the.net Assembly for the SQL Server Data Provider is already available in the.net environment so you do not need to provide a value for this field. 8. In the Set Connection String screen, fill out the following fields: HiT Software 1BCopyright 2010 5

Connection Properties Edit at least the Required connection properties by clicking in the property value field and typing a new value. For Synchronization Replications: The login/user ID that you provide must be unique to DBMoto. It should not be used for any transactions occurring in either database involved in the synchronization. DBMoto does not replicate transactions by the user you specify in this connection. This user ID is used by DBMoto during synchronization to read the database logs and perform the synchronization operations. Therefore, any transactions found in the logs with this user ID are not replicated as part of the synchronization data. For SQL Server Replications: If you are replicating from SQL Server using mirroring or synchronization, for the user ID and password fields, provide a login that does not have system administrator privileges. This login ID should also be used exclusively for DBMoto (i.e., no other applications should use the login ID that you specify for DBMoto). You will need to provide a second login with system administrator privileges in the Setup Info screen. The second login is used to create the distributor and to access the transaction log. Edit Click Edit to open a text entry window where you can paste or type a connection string for your provider. This is offered as an alternative to the Connection Properties grid, but should be used with great care because an error in the connection string can cause a connection to fail or to have unexpected properties. This window displays any connection information that you have already entered in connection string format. Note that default values are not displayed as part of the connection string. Test Click Test to make sure that the connection correctly opens a database connection. 9. In the Setup Info screen, check Use Transactional Replication. For transactional replications with SQL Server, first select whether you plan to perform replications using the SQL Server transaction log (default) or triggers (required for SQL Server 2005 Express Edition, or tables with no primary key setting.) SQL Server Transaction Log Triggers Note the following restrictions on using the Triggers option for transactional replications with SQL Server. Functions with SQL Server 2000 or higher (except MSDE), including SQL Server 2005 Express Data types "image", "text" and "ntext" are not supported. If you create a transactional replication on a table with fields where these data types defined, the Enterprise Manager warns you that the fields will not be replicated. In SQL Server 2005 and SQL Server Express, these types have been replaced by "varbinary(max)", "varchar(max)", and "nvarchar(max)". Microsoft recommends replacing the old data types with the new ones. The new data types are supported when using the Triggers option. HiT Software 1BCopyright 2010 6

The source table does not need a primary key set in SQL Server but it must have a primary key defined in DBMoto. See the DBMoto User s Guide, available from the Help menu in the Enterprise Manager, for information on creating primary keys in DBMoto. SQL Server Transaction Log Connections The following information applies if you have selected "SQLServer" from the Use Transactional Replication drop-down list. If you plan to define a mirroring or synchronization replication, you need to define two connections to the database: a non system administrator connection and a system administrator connection. The system administrator connection is used to set up the distributor and access the transaction log. However, a system administrator connection does not provide sufficient user information in the log to identify transactions for replication, so you also need the non system administrator connection. Note: When using SQL Server as a source in mirroring (or as a source or target in synchronization replications), SQL Server requires that tables have a primary key defined. Publisher The name of the database server that you are using for the connection. Distributor Initially, this field displays the name of the database server you are using for the connection. When you click Verify to see if a Distributor is installed for this database server, the value changes as follows: If a distributor exists for the server, the server name is displayed and two buttons are active The Ellipsis button to the right of the Distributor field Click here to open the Change Distributor dialog and view the distributor values. You cannot edit values in the dialog unless you first exit the dialog, remove the installed distributor, then re-open the dialog. The Remove button is active so that you can remove the distributor in cases where you prefer to use a distributor defined for another accessible installation of SQL Server. If no distributor exists, the server name is displayed, and two buttons are active: The Ellipsis button to the right of the Distributor field Click here to open the Change Distributor dialog and set or create a distributor on a different SQL Server installation from the one containing the table(s) to be replicated (remote distributor). The Install button is active so that you can install a distributor. If you choose this option to install a distributor in the current SQL Server installation, DBMoto creates a distributor called DBRS_Distribution. Be sure to install a distributor before closing the dialog. Change Distributor Dialog This dialog can be accessed by clicking next to the Distributor field. If you have a distributor installed in the SQL Server to which you are connecting for replication, the Use Local Distributor option is selected and values in the Server and HiT Software 1BCopyright 2010 7

Database fields reflect the SQL Server installation and distributor database. These values cannot be changed from the dialog. To change the distributor, you need to close the dialog, remove the local distributor and reopen the dialog. If you do not have a distributor installed and want to set or create a distributor on a remote installation of SQL Server, select the Use Remote Distributor option and enter the SQL Server name (or an established alias for the SQL Server system), then the distributor database name. If the distributor does not exist, one will be created using the specified name. Provide a user name and password with appropriate privileges for creating the distributor in the remote installation of SQL Server. If problems arise when DBMoto attempts to create the remote distributor, you may need to enter the full pathname to the location where the distributor should be created. This is usually in the SQL Server folder that contains the Data and Log folders, for example, "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL." The path has to be the complete path up to the SQL Server folder that contains the Data and Log folders. Use Windows Authentication Select this option if you (or your system administrator) have set up your environment to use your Windows login ID to access SQL Server. You may also need to open the Connection Properties dialog and set the optional field Integrated Security to True. Use SQL Server Authentication Select this option to use a SQL Server login ID and password. Provide a system administrator login and password. HiT Software recommends that you use this type of authentication. HiT Software 1BCopyright 2010 8

Verify, Install and Remove Click Verify first to see that the distributor is correctly installed. Depending on the results of this operation, either the Install or Remove buttons will become active. Click Install to create the distributor. Click Remove to delete the distributor. Note that a distributor is required to perform mirroring or synchronization replications. SQL Server Trigger Connections The following information applies if you have selected "Triggers" from the Use Transactional Replication drop-down list. You need to fill out information in the Setup Info dialog so that triggers can be created to log table changes for replication. Your system administrator needs to create and define appropriate table spaces and databases to hold the log tables. They should be large enough to handle the expected amount of replication data. The login you are using for the source connection should have appropriate authorizations to create tables. See DBMoto User Permissions for SQL Server for more information. Master Table Either specify an existing qualified table name, or click Change to create a new table to hold general information about replication transactions including user name, timestamp, table name for each transaction. There are two tables associated with each replication: a Master table, common to all replications using that connection, and a Log table for each replication source table. The Master table keeps track of all the transactions affecting the source tables and it records general transactional information. Master and Log tables are created in the schema specified when you set the Master table name. You can choose a Master table name, or use the default _DBM MASTERLOG. Log tables are automatically generated by DBMoto and the names are _DBM LOG_#, where # is a number. The selected schema for the Master and Log tables must not contain other non-dbmoto tables with names _DBM LOG_#. HiT Software recommends that you create a new schema to use specifically for the DBMoto Master and Log tables. Tablespace HiT Software recommends that you assign a tablespace for the Master table and Log Tables so that it is easier to control log table sizes. If you leave this field blank, the default tablespace value for your login ID will be used. Your system administrator should be able to provide you with the appropriate value for this field. Retention Time The amount of time in hours that a transaction is kept in the log tables. The default value is 72 hours. When the amount of time a transaction resides in the log exceeds the retention time, the transaction is permanently removed from the log tables. Tuning the retention time provides control over the size of the log tables. Verify, Install and Remove Click Verify first to see that the Master Table is correctly installed on the server. Depending on the results of this operation, either the Install or Remove buttons will become active. Click Install to create the table on the server. Click Remove to delete the table from the server. HiT Software 1BCopyright 2010 9

10. In the Select Tables screen, choose one or more objects from the treeview to associate with the source connection. Objects include tables, views and aliases. When creating a replication, you will be able to select an object for replication from those that you have chosen in this wizard. If you create multiple replications, you can select an object for each replication that you are defining. Use the Select All Tables and Deselect All Tables buttons to work with multiple tables. Use the Hide System Tables checkbox to limit the number of tables displayed. Select a database owner/schema, then click this button to check all tables under the owner/schema. Select a database owner/schema, then click this button to uncheck all tables under the owner/schema. 11. Review the Summary screen. 12. If you want to create a target connection right away, check the option to Proceed with the definition of a target connection. 13. Click Finish to complete the wizard and create your connection. Target Connection 14. To create a target connection, either the Target Connection Wizard opens automatically because you selected that option in the last screen of the Source Connection wizard, or you can select the Targets node in the Enterprise Manager tree. Note that you must install, configure and test the connection to the database to which you are replicating before attempting to create a target connection to the database from DBMoto. For example, if you are replicating from Microsoft SQL Server to MySQL, you need.net data providers installed and tested for both Microsoft SQL Server and MySQL. See http://www.hitsw.com/support/kbase/dbmoto/providers_dbmoto.htm for a current list of supported providers. 15. From the right mouse button menu, choose Add New Connection. HiT Software 1BCopyright 2010 10

16. In the Target Connection Wizard, select the database to which you are replicating then follow steps to add a connection string and test the connection to the database. If you are creating a connection to a Microsoft SQL Server database, refer to the steps above (Source Connection) for configuring the connection. Note that you do not need to configure the Setup Info screen unless you are planning to perform a synchronization replication using Oracle. For all other databases, check the HiT Software knowledge base article on data providers before entering a value in the Assembly field. HiT Software 1BCopyright 2010 11

17. Choose the tables to which you plan to replicate. If a table does not exist, continue to the next screen without selecting a table. You can use the Create Target Table wizard once you have created the connection. 18. Complete the wizard. 2. Create a Target Table If you are replicating to a database where no target table exists, you need to create the target table before defining the replication. If the target table already exists in the database to which you are replicating, go to Defining the Replication. The Target Table wizard allows you to create tables from DBMoto but the target schema/owner etc. (depending on your database type) must have been created prior to running the wizard. 1. Expand the DBMoto tree to display the table that contains the data you want to replicate. 2. Select the table. 3. From the right mouse button menu, choose Replication then Create Target Table... HiT Software 1BCopyright 2010 12

4. In the Select Source Connection screen, choose the source name from the drop-down list that includes all the source connections you have created in DBMoto. 5. Choose the table that you want to replicate from the drop-down list. 6. If you want more information about the table before proceeding, click Open Table... 7. Click Next to go to the Select Target Connection screen. HiT Software 1BCopyright 2010 13

8. Choose a target source name from the drop-down list that includes all the target connections you have created in DBmoto. 9. Type a name for the table you wish to create in the target database. This table will contain the replicated data. 10. Click Next to go to the Define Columns screen. HiT Software 1BCopyright 2010 14

11. Review the columns that will be created in the target table. You can add or remove columns as well as designate one or more columns as a primary key. 12. When you have finished editing the target table columns, click Next to go to the SQL Script screen. 13. If necessary, edit the SQL script that generates the table. 14. Click Next to review the wizard settings in the Summary screen. 15. To create additional tables, check the option Create another table. This opens another Create Target Table wizard when this wizard is complete. 16. To go directly to creating a replication once this wizard is complete, check the option Proceed with the Definition of a Replication. This opens the Replication wizard when the Create Target Table wizard is complete. 17. Click Finish to create the target table. 18. Note that the new table is not automatically displayed in the Enterprise Manager tree. Click Yes to add the newly created table to the list of target tables in the Enterprise Manager tree. HiT Software 1BCopyright 2010 15

3. Define the Replication This section explains how to create a single table-to-table replication. However, most real applications consist of many such replications and, if the replications use the same source and target databases, it may make sense to create multiple replications in a group to optimize database connection and log access times. Use the Help menu in the Enterprise Manager to find out more information about creating multiple replications and grouping replications. 1. Expand the Enterprise Manager tree to display the table that contains the data you want to replicate. 2. Select the table. 3. From the right mouse button menu, choose Replication then Create New Replicaton... 4. In the Define Replication Type screen, type a name to identify the replication. 5. Optionally provide a description of the replication. 6. In the Replication Mode area, choose Continuous Mirroring. HiT Software 1BCopyright 2010 16

7. Click Next to go to the Select Source Connection screen. 8. Choose the source name from the drop-down list that includes all the source connections you have created in DBMoto. 9. Choose the table that you want to replicate from the drop-down list. 10. If you want more information about the table before proceeding, click Open Table... HiT Software 1BCopyright 2010 17

11. Click Next to go to the Source Log Info screen. Distributor A distributor, DBRS_Distributor, is created by DBMoto to manage a log that keeps track of transactions for the source table. This is typically done when setting up the connection in the Setup Info screen, although you can also set or modify the distributor or system administrator login information in the Connection Properties dialog. To create the distributor, your source connection should have system administrator privileges. If you encounter connection problems at this stage, you need to cancel the Replication Wizard and change the Source Connection Properties by selecting the source connection in the Enterprise Manager tree and choosing Connection Properties from the right mouse button menu. Publication DBMoto creates a publication in SQL Server called DBMotoPUB_ followed by the source database name. The publication is used to identify the tables involved in replication. One publication per database is created, so that several replications may use the same publication. To create the publication, your connection should have system administrator privileges as described above. Transaction ID The ID for the transaction at which you want to start replication. To change the transaction ID, click... to open the Read Point dialog. In the Transaction Read Point dialog, you can either retrieve the current transaction or the transaction for a specified date and time. If you enter a date and time, DBMoto retrieves the first transaction after the time entered. This information is available and can be changed in the Replication Properties dialog after the wizard is completed. Transaction Timestamp The timestamp for the transaction above. Read Interval (sec) The frequency (in seconds) with which you want to check the log during replication. For example, if the setting is 90 seconds, DBMoto will check the log every 90 seconds to see if any transactions have occurred that need to be replicated to the target table. This information is available and can be changed in the Replication Properties dialog after the wizard is completed. 12. In the Transaction ID field, click Read to open the Read Point dialog. 13. Choose either the current transaction or a transaction ID based on a time and date. 14. Click OK to add the value to the Source Log Info screen. 15. Set the value of the Read Interval field to the frequency with which you want DBMoto to check the transaction log for new events to mirror. 16. Click Next to go to the Select Target Connection screen. HiT Software 1BCopyright 2010 18

17. Choose a target source name from the drop-down list that includes all the target connections you have created in DBmoto. 18. Choose the table to which you want to replicate from the drop-down list. If no tables are listed, you need to exit the wizard and add or create a target table. 19. If you want more information about the table before proceeding, click Open Table... 20. Click Next to go to the Set Mapping Info screen. Source and target columns with the same name are automatically mapped. You can also map columns by dragging the target column and dropping it on the source column, or you can map a column to an expression. For more information about mapping, check the Replication Wizard help topic. An alternative is to write a script to set mappings at runtime. 21. Click Next to go to the Scheduling screen. HiT Software 1BCopyright 2010 19

22. Make sure the Enable Replication option is checked. This is required for the replication to run. 23. Set a start time for the replication. The Start Time field indicates the time at which the Data Replicator will begin considering the replication for execution. 24. Check the option to Execute Initial Refresh if needed. If you check this option, a full replication will be performed from the source to the target table, prior to starting the mirroring process where only incremental changes will be replicated. 25. Go to the Mirroring Schedule tab. 26. Select how you want to run the replication: Run Continuously: the transaction log will be checked for changes to the table using the frequency that you specified on the Set Log Info tab. Any changes will be replicated to the target table. Schedule Interruptions: the replication process will run as above, except for interruptions specified when you click the Schedule button in the Scheduler dialog. Click Next to go to the Summary screen. Click Finish to complete the wizard. 4. Run the Replication If you installed DBReplicator as a service during DBMoto setup, you just need to start the service using the DBMServiceMonitor program (located in the DBMoto install folder or on the Windows Start > Programs > Startup menu. The replication that you have scheduled should start at the specified time. Use the Replication Monitor tab in the Enterprise Manager to track the progress of the replication. HiT Software 1BCopyright 2010 20

If you would like to set up the DBMoto Replicator as a service: From the Windows Desktop Start menu, choose Programs, then HiT Software DBMoto, then Service Installer. Manage the service from DBMServiceMonitor program (located in the DBMoto install folder or on the Windows Start > Programs > Startup menu). Use the Replication Monitor tab in the Enterprise Manager to track the progress of the replication. To run the DBMoto Replicator interactively: From the Windows Desktop Start menu, choose Programs then HiT Software DBMoto then DBReplicator. The replication that you have scheduled should start at the specified time. Use the Replication Monitor tab in the Enterprise Manager to track the progress of the replication. DBMoto User Permissions for SQL Server When setting up replications that use SQL Server as either a source or target database, you need to be sure that the user ID used for making connections to the database has sufficient privileges to complete all the operations required for DBMoto to perform a replication. This section is organized by the type of replication you want to perform. It describes in detail all the user authorities that will be required during the setup and execution of replications. Refresh with SQL Server as Either Source or Target Database 1. AUTHORITY TO CONNECT TO DATABASE This should already be granted when the user is created. However, here is the syntax, just in case: grant connect to <uid>; Example where dbmoto is the user ID: grant connect to dbmoto; 2. AUTHORITY TO SELECT CATALOG To display a list of tables and show fields in the table in the Enterprise Manager (for selecting a source or target table and for setting which fields to replicate), DBMoto runs a SELECT command on the catalog. If the user ID has insufficient privileges, an error is generated on the SQL Server system. The command below allows read access to any table in the database, including catalog information. It is actually broader than the necessary permission, since this step requires access only to the system tables. use <database>; exec sp_addrolemember 'db_datareader', '<uid>' HiT Software 2BDBMoto User Permissions for SQL Server 2010 21

Example where dbmoto is the user ID: use test; exec sp_addrolemember 'db_datareader', 'dbmoto' 3. AUTHORITY TO SELECT TABLES DBMoto runs a SELECT statement to identify records to replicate. Therefore, the user ID used to make a connection must have adequate authority to run a SELECT statement for tables involved in replication. If you used the syntax in 2 above, you do not need to grant select authority to specific tables involved in replications because the above command covers all tables. 4. AUTHORITY TO CREATE TABLES To create a target table in the Enterprise Manager (as part of the Create Table Wizard), DBMoto requires permissions to modify the database schema. use <database>; grant alter on schema::<schema> to <uid>; grant create table to <uid>; Example where dbmoto is the user ID: use test; grant alter on schema::dbo to dbmoto; grant create table to dbmoto; 5. AUTHORITY TO UPDATE TABLES To create a target table in the Enterprise Manager (as part of the Create Table Wizard), DBMoto requires write permissions to the database. The following command allows write access to any table in the database and is broader than the necessary permission. It is possible to grant more granular access to every single table in the database, if necessary, by changing permissions for a user. use <database>; exec sp_addrolemember 'db_datawriter', '<uid>' Example where dbmoto is the user ID: use test; exec sp_addrolemember 'db_datawriter', 'dbmoto' 6. AUTHORITY TO DROP TABLES, ALTER TABLES (optional) The use of these commands from within DBMoto is entirely optional (i.e. not necessary for running a refresh replication.) They are used if you choose to remove a table from SQL Server or change the table via the Enterprise Manager Execute SQL Query dialog. The following commands are broader than needed. Alter and drop can also be granted to specific tables. use <database>; grant alter on schema::<schema> to <uid>; HiT Software 2BDBMoto User Permissions for SQL Server 2010 22

grant create table to <uid>; Example where dbmoto is the user ID: use test; grant alter on schema::dbo to dbmoto; grant create table to dbmoto; Transactional Replications/Initial Refresh with SQL Server as Either Source or Target Database This section includes information for mirroring where SQL Server is the data source, and synchronization where SQL Server can be either the source or target data source. 1. AUTHORITY TO CONNECT TO DATABASE This should already be granted when the user is created. However, here is the syntax, just in case: grant connect to <uid>; Example where dbmoto is the user ID: grant connect to dbmoto; 2. AUTHORITY TO SELECT CATALOG To display a list of tables and show fields in the table in the Enterprise Manager (for selecting a source or target table and for setting which fields to replicate), DBMoto runs a SELECT command on the catalog. If the user ID has insufficient privileges, an error is generated on the SQL Server system. The command below allows read access to any table in the database, including catalog information. It is actually broader than the necessary permission, since this step requires access only to the system tables. use <database>; exec sp_addrolemember 'db_datareader', '<uid>' Example where dbmoto is the user ID: use test; exec sp_addrolemember 'db_datareader', 'dbmoto' 3. AUTHORITY TO SELECT TABLES DBMoto runs a SELECT statement to identify records to replicate. Therefore, the user ID used to make a connection must have adequate authority to run a SELECT statement for tables involved in replication. If you used the syntax in 2 above, you do not need to grant select authority to specific tables involved in replications because the above command covers all tables. 4. AUTHORITY TO CREATE TABLES To create a target table in the Enterprise Manager (as part of the Create Table Wizard), DBMoto HiT Software 2BDBMoto User Permissions for SQL Server 2010 23

requires permissions to modify the database schema. use <database>; grant alter on schema::<schema> to <uid>; grant create table to <uid>; Example where dbmoto is the user ID: use test; grant alter on schema::dbo to dbmoto; grant create table to dbmoto; 5. AUTHORITY TO UPDATE TABLES To create a target table in the Enterprise Manager (as part of the Create Table Wizard), DBMoto requires write permissions to the database. The following command allows write access to any table in the database and is broader than the necessary permission. It is possible to grant more granular access to every single table in the database, if necessary, by changing permissions for a user. use <database>; exec sp_addrolemember 'db_datawriter', '<uid>' Example where dbmoto is the user ID: use test; exec sp_addrolemember 'db_datawriter', 'dbmoto' 6. AUTHORITY TO DROP TABLES, ALTER TABLES (optional) The use of these commands from within DBMoto is entirely optional (i.e. not necessary for running a refresh replication.) They are used if you choose to remove a table from SQL Server or change the table via the Enterprise Manager Execute SQL Query dialog. The following commands are broader than needed. Alter and drop can also be granted to specific tables. use <database>; grant alter on schema::<schema> to <uid>; grant create table to <uid>; Example where dbmoto is the user ID: use test; grant alter on schema::dbo to dbmoto; grant create table to dbmoto; 7. AUTHORITY TO SET UP TRANSACTIONAL REPLICATIONS and ACCESS LOG (Note: Not needed when SQL Server is a target in mirroring replications or when using triggers instead of the transaction log to identify data change.) When setting up transactional replications (where SQL Server is serving as the source of data, either for mirroring or for synchronization), you need additional privileges that are not required for replication operations. You need a user with sysadmin privileges to set up and verify the distributor. For synchronization, a separate user with sysadmin credentials is needed in order to handle conflicts HiT Software 2BDBMoto User Permissions for SQL Server 2010 24

based on the user. exec sp_addsrvrolemember '<uid>', 'sysadmin'; Example: exec sp_addsrvrolemember 'dbmoto', 'sysadmin'; HiT Software 2BDBMoto User Permissions for SQL Server 2010 25