How to Replicate BillQuick 2003 database on SQL Server 2000. This article provides a step-by-step procedure for replicating the BillQuick 2003 database using Microsoft SQL server 2000 and allowing it to be replicated continuously using the Merge Replication. This gives the users the ability to distribute data over multiple servers and keep them Sync in real time. Note: This white paper is only for reference purpose. BQE Software Inc bares no responsibility in case there is corruption or failure of replication process. Replication process is purely Microsoft SQL server 2000 based. There are multiple ways to set replication process using Microsoft SQL server 2000. Please refer to Microsoft SQL Server help file or Visit Microsoft Web Site. We assume that you have a complete understanding of Microsoft SQL server 2000 and the replication process. CHECKING THE NECESSARY CONDITIONS: Check the following before setting up Merge replication: a) The Localsystem account has no access to shares on the network, as it isn't an authenticated network account. So, if you want to setting up replication you must change the account the MSSQLServer and SQLServerAgent services runs under an account with the Windows NT/Windows 2000 administrator's rights. If your Microsoft SQL Server runs on Windows NT or Windows 2000, you can create Windows NT/Windows 2000 account and include it into local Administrators group, into Domain Users group, and set Log in as service permission for this account. b) Because Windows 9x does not support Windows NT services, so if your Microsoft SQL Server runs on Windows 9x, you do not need to create SQL account. c) Only members of the sysadmin server role can set up and configure replication, so if you have not these rights, you cannot set up replication. d) Don't forget to start SQLServerAgent service and MSSQLServer service. e) You should allocate adequate disk space for the distribution database. f) You should allocate adequate disk space for the publisher and subscriber's databases. g) SQL Server 7.0/2000 uses uniqueidentifier column to identify each row during the merge replication, so if your table does not have a uniqueidentifier column with the ROWGUIDCOL property, Microsoft SQL Server 7.0/2000 will add this column to the table. So, you need the additional disk space to store your data. h) You cannot replicate only one table with foreign key constraints; you should include all referenced tables in the publication. i) You should ensure the server that is being replicated to, is defined as a remote server. j) Make sure all the servers can ping each other with the SQL Server name. e.g. you can ping from ServerA to ServerB and Vice Versa. 1/5
SOLUTION: Steps to Create BillQuick 2003 Database Replication using SQL Server 2000 MasterDB Server A SlaveDB Server B Prior to creating a replication of a BillQuick database, please do the following: a) Using BillQuick 2003 application create a new database or upsize an existing BillQuick database to ServerA. For the purpose of this document, we will refer to this database as MasterDB b) 2. Using BillQuick 2003, connect to the MasterDB database on ServerA and test MasterDB Database. c) Make a backup of the database. Step 1: a) Run the SQL Server Enterprise Manager on ServerA b) Select ServerA. Click on Tools/Replication/ Configure Publishing, Subscription and Distribution -> Click Next c) Make ServerA as its Distributor -> Click Next d) Specify snapshot folder, use the default path -> Click Next e) In the next screen choose No, use the default settings. And then -> Click Next - > Click Finish button. f) Next, the server will create a distributor database. You will then get a Successful completion message. Step 2: a) Click on Tools/ Replication/ Create and Manage Publications b) Select the Database to be published and Click on Create Publication. A Wizard comes up. -> Click Next c) Choose publication type -> Merge Publication -> Click Next d) Specify Subscriber types -> All Subscriber will be running SQL Server 2000 -> Click Next e) Specify Articles - > Click on Publish ALL button for both Tables and View 2/5
f) g) Select one by one each table in the right grid. Click on [ ] button next to the table name. h) Select the Snapshot Tab. Uncheck the Include declared referential integrity. Click on OK. i) Repeat the step f and g for all the table objects. j) Click on Next button. Article Issue Screen will be shown. Again click on Next Button. 3/5
k) Publication Name -> Default Name-> Click Next l) Use default properties of the Publications -> No, Create publication without data filters and with the following properties -> click next -> Click Finish Button m) Next, the server will create a publication database. You will then get a Successful Completion Message->Click Close n) Select ServerA, Go to Tools/ Create and Manage Publications o) Select the publication database created in the steps above. p) Select Publication->choose Properties and Subscriptions q) Click on the Subscription Options tab. Check Allow Pull subscriptions and check Allow anonymous subscribers. (Note: This is not a security leak. This setting is required for initial setup only. You can later on change it to enabled subscribers only after adding the subscriber login account to the access list on ServerA) r) Apply changes and Click on the Close button. Step 3: a) On ServerA, go to Replication Monitor-> Publishers->Publisher Name and Database Name b) Check if the Snapshot process is running, wait for it to complete. If status is succeeded and last action is A snapshot of 44 articles was generated, then the snapshot was successfully created. Step 4: a) Using BillQuick 2003 application, create a new database on your remote server i.e. ServerB. For the purpose of this document, we will assume that you named it SlaveDB (The purpose of this step is to create the new BillQuick 2003 database, SQL Server Accounts, BillQuickSQL and BillQuickGuest on ServerB) Step 5: At this point you have 2 choices. Choice 1: Push Subscription: (Server A pushes to Server B) Push subscription is subscription when the publishing Server i.e Server A will periodically push transactions out to the subscribing server i.e Server B or database. a) From the Enterprise Management Console Select ServerA b) Go to Tools/Replication/Push Subscription to Others. c) Select the publication database you want to subscribe. d) Click Push new Subscription e) Choose ServerB f) Click on Browse Button and point it to the SlaveDB. -> Click Next g) Click Next h) Set Merge Agent Scheduling -> continuously -> Click Next i) Initialize Subscription Yes, initialize the schema and data and check Start the Merge Agent to Initialize the subscription immediately -> Click Next 4/5
j) Set Subscription Priority Select Use the Publisher as a proxy for the subscriber when resolving conflicts Click Next k) Start Required Services SQLServerAgent on ServerA is Checked. ->Click Next l) Click Finish. Successful completion message. -> Click OK -> Click Close. To check if replication started m) From the Enterprise Management Console Select ServerA n) Go to Replication Monitor -> Publishers-> Select MasterDB. You should see in the right panel. Type Push and Status running Choice 2: Pull Subscription: (Server B pulls from Server A) Pull subscription is subscription when the subscribing server (Server B) will periodically connect to the distribution database (Server A) and pull information. a) From the Enterprise Management Console Select ServerB b) Go to Tools/Replication/Pull Subscription to ServerB. c) Click Pull new Subscription d) Choose ServerA e) Highlight Publication Click Next f) Specify sa account and -> Click Next g) Choose destination database SlaveDB.-> Click Next h) Initialize Subscription -> Yes option -> Click Next i) Set Merge Agent Scheduling -> continuously -> Click Next j) Start Required Service Allow wizard to Check for SQL ServerAgent on ServerB k) Click Finish. Successful completion message. -> Click OK -> Click Close. To check if replication started l) From the Enterprise Management Console Select ServerB m) Go to database -> Select SlaveDB. Click on Pull Subscriptions -> you will see the status as Running and Type as Anonymous. n) Wait for the Sync Agent to complete Sync Operation. This article is provided to BillQuick users for information only. BQE Software Inc. does not provide technical support for the SQL replication process. These services are provided as expert consulting services and not included in the standard technical support contract for BillQuick enterprise. For more information regarding SQL Server replication, please read these articles: http://msdn.microsoft.com/library/default.asp?url=/library/enus/replprog/rp_4_3roprg_37qr.asp http://support.microsoft.com/support/access/content/repl/replovrvw.asp http://www.sqlmag.com/articles/index.cfm?articleid=8825 http://www.mssqlcity.com/articles/replic/setupmr/setupmr.htm http://www.mssqlcity.com/tips/replication_optimization.htm 5/5