Quantcast
Channel: StackExchange Replication Questions
Viewing all 17268 articles
Browse latest View live

sql server 2008 replication of SAP Business One Database 8.82

$
0
0

I am planning on creating a database replication(transactions) for our SAP Server using SQL Server 2008. The goal is to separate the database accessed by crystal reports and also for our 3rd Party software that will use the replicated(subscriber) database. I have made a research about replication, i choose replication than mirroring because i do not want to copy the entire database, only tables that contains transactions of day to day. As how I understood it, whatever will happen to publisher(updates) will affect the subscriber, but whatever will happen to subscriber will/should not affect the publisher.

I want to know:

  1. I would like to know the best practice in doing this, specially in SAP B1 database structure.
  2. Should i make the subscriber local or to other computer, if local will it not affect the live database?

Migrate replication from SQL Server 2008 R2 to SQL Server 2016 - Old to new hardware

$
0
0

I will be working on a project shortly that would involve moving the replicated databases off of old to the new SQL Server instance. I haven't done this in the past so I don't have much knowledge either on how to move ahead except to do some research.

As of this date our current config sits on a Windows 2008 R2 server with SQL Server 2008 R2 and publisher along with the distributor is the same SQL Server instance e.g sqla and the subscriber is sqlb and also now sqlb is acting as a publisher and distributor for sqlc... these are all pull subscribers with one way transactional and snapshot replication.

Now, back to my original question. Is there a way to migrate the databases off of the old to the new with least downtime so I don't have to script out and reinitialize subscriptions as it would take a lot of time (that's what most of the people mentioned on google). Do we have any hacks or tricks to make this work without causing problems or if there is any step by step to work it out even if we use script method.

Sync data from local db to Central SQL Server

$
0
0

I have a requirement to sync local db data with central SQL server. The remote users (mostly around 10 people) will be using laptop which will host application and local db. The internet connection is not 24x7. During no connectivity, the laptop user should be able to make changes in local db and once the connection is restored, the data should be synced with central SQL server automatically. The sync is just usually data updates. I have looked at options Sync framework and Merge replication. I can’t use sync framework as I am not C# expert. For Merge replication, additional hardware is required I believe which is not possible. The solution should be easy to develop and maintain.

Are there any other options available? Is it possible to use SSIS in this scenario?

Replicate trigger on subscriber in merge replication of SQL Server

$
0
0

I have deployed 1 subscriber and 1 publisher server in merge replication configuration of SQL Server. I added a table along with a trigger on that table on publisher and want to replicate that table and trigger on subscriber. I have set 'replicate schema changes' and 'copy user triggers' to true but still the trigger is not replicated on subscriber.

How can I solve the problem?

Sync databases without changing database structure

$
0
0

I have two databases on different physical locations. Both databases have the same structure and will remain the same. I need to sync data between the two databases (both ways). Merge replication is out of scope because it adds columns to the published articles, which causes errors in the vendors software. I want a solution which will sync data bidirectional, without any changes in the database structure (schema). Can you suggest such solutions?

EDIT PEER TO PEER Peer to Peer Transactional Replication is also out of scope because some of the tables (which needs to be synced) contain TIMESTAMP columns.

Disaster recovery planning for existing merge replication environment

$
0
0

In a proactive approach I'm planning to make a database Disaster Recovery environment.

I have set a environment with this structure:

Database1: Publisher Database2: Subscriber of Database1 + Publisher of Database3 Database3 Database3: Subscriber of Database2 All databases are on different physical machines in different locations: All databases have 5 different publications named Pub1, Pub2, Pub3, Pub4, Pub5

I just dropped a Subscriber (Pub3) on Database3

What will be the best approach to restore dropped subscriptions? by keeping in mind that 1. Each publication have more than 200 tables and database size is almost 800GB. 2. Each Database is on different location & Machines (Network Involved) 3. Having very Short Recovery Time

Snapshot Agent - Merge Replication: Failed to read from Server

$
0
0

We currently have Merge replication with 1 publisher and 2 subscribers. This morning I noticed the snapshot agent failed. I have tried to kick this off manually, but it keeps failing. The following is the error message that I get:

Error messages:
Message: Failed to read from server
Stack:    at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.BcpOut(String strBcpObjectName, String strBcpObjectOwner, String strBaseBcpObjectName, Boolean fUnicodeConversion, String strDataFile, String strLoadOrderingHint, String strWhereClause, Boolean useTableLockHint, Int32 bcpFileFormatVersion)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.BcpOut(String strBcpObjectName, String strBcpObjectOwner, String strBaseBcpObjectName, Boolean fUnicodeConversion, String strDataFile, String strLoadOrderingHint)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.BcpOut(String strBcpObjectName, String strBcpObjectOwner, String strDataFile)
   at Microsoft.SqlServer.Replication.Snapshot.MergeContentsBcpOutWorkItem.DoWork(MergeSnapshotProvider snapshotProvider, IBcpOutProvider bcpOutProvider)
   at Microsoft.SqlServer.Replication.WorkerThread.NonExceptionBasedAgentThreadProc()
   at Microsoft.SqlServer.Replication.AgentCore.BaseAgentThread.AgentThreadProcWrapper() (Source: MSSQLServer, Error number: 0)
Get help: http://help/0
Message: COLV_90_TO_80: Cannot convert parameter param1: Resulting colv would have too many entries.
Stack:  (Source: MSSQLServer, Error number: 20005)
Get help: http://help/20005
Message: The statement has been terminated.
Stack:  (Source: MSSQLServer, Error number: 3621)

What does this error mean? How do I get the snapshot agent to run successfully again?

MySQL merge two tables of different database to single database [closed]

$
0
0

Friends, i have database named as DB1 with a table called TB1A and another database as DB2 with a table TB2A.

TB1A having 5 columns and TB2A having 8 columns, All the columns available in TB1A is present in TB2A.

I want to create new table called TB3A which should be a merged result of a TB1A and TB2A. Means TB3A will have 8 columns and contains all the datas of TB1A and TB2A.

CREATE TABLE TB3A AS (

SELECT * 
  FROM DB1.TB1A 
  JOIN  DB2.TB2A 
) 

While i trying like above it is showing an error like below

Error Code: 1060

Duplicate column name 'Agreement_Id'

Execution Time : 0 sec

Transfer Time : 0 sec

Total Time : 0 sec

Does any one have any idea about this. I have google it this issue but i am not able to find the solution for this ..


Merge Replication customize synchronization cycle and its performance

$
0
0

I'm trying to implement Merge Replication between just two servers, a publisher and one Subscriber.

Assume these tables :

--Main table in Publisher
Ticket (id, userId, reqId, blockedDate, usedDate, returnDate, transferDate, ...)

--On Subscriber (The fields are in Publication)
Ticket (id, userId, blockedDate, usedDate)

We must assign current date to transferDate whenever a row goes to Subscriber, and assign to returnDate whenever it comes back from Subscriber. As we HAVE to consider a file syncing (transfer/return data to/from subscriber with a USB stick!) these fields must be assigned on syncing either on file syncing or on replication.

I know you can add your custom business logic for Conflict Resolution (when a conflict occurs). I'm looking for something like triggers for replication events, which gain me the ability to manipulate some fields out of Publication (or even another table whenever needed).

Questions

  • Is it possible to handle replication events(push and pull) manually?** (customize or override PULL/PUSH's. Not conflict resolver)**

  • Can you give me a comparison between implementing a customized merge replication and syncing with help of a distributed transaction SP?

I need synchronization to be scheduled (at midnight when there's no load on DB server), BUT it is highly needed we'll be able to sync manually (from within our web application).

In second question I need their performance, reliability, and of course their maintainability. These factors especially the first two, are a big concern. Suppose Publisher may have about millions of records, and Subscriber may have about several ten thousand. So with each synchronization, about several ten thousand records will be transferred.

Merge replication checks rows; if there's a change and there's not a conflict, the row merges. if there's a conflict, a conflict resolver (could be your custom stored procedure resolver) handles the conflict. I want to write my own logic in the first case (data changed without conflict) instead of SQL's built-in merge mechanism. Clearly I want to customize it.

There's onlyid, userId, blockedDate, usedDate columns in the article. I want to fill returnDate whenever a Ticket comes back to Publisher (on a pull) and fill transferDate whenever a Ticket goes to Subscriber (on a push).

How to change column name in subscriber table in SQL Server?

$
0
0

I have a table in first DB and I make transactional replication to create this table on second DB but I want change first column name in subscriber table.I change it but when I insert,update or delete on table of the first DB replication was failed.please help me

In mysql Multi-Source replication,replicate-rewrite-db is not working

$
0
0

In mysql, i have Configured Two master to single slave. i want to replicate from different db to single db. so i mentioned replicate-rewrite-db=TEST->TEST1 I INSERTED IN TABLE test in ONE OF THE MASTER WITH DB NAME TEST. slave has TEST1 DB and test table. replication is not happenning. i think this is due to Multi-source replication..i mean we can;t do it with multiple master configured to single slave? any one idea how to achieve replicate-rewrite-db=TEST->TEST1 in multi-source replication

Getting error in Sanpshot agent while performing transactional replication from Onprem sql server databse to azure sql db

$
0
0

I am configuring the transactional replication.

I have created the publisher and subscriber but no table got moved to the replication DB.

When i check in the publisher monitor i found error with snapshot agent

"Access to the path 'D:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\ReplData\unc\DB_Name\20170803122054\' is denied."

I am using SQL Server 2008r2 and trying to replicate data to azure sql db

I am Stuck please help.

Distribution Clenup in Transaction Replication

$
0
0

I have setup transaction Replication PULL type between SQL servers. But, my distribution cleanup job is not removing any data from MS_replCommands and repltransaction tables.

I have set Immediate_Snyc and allow_anonymous to 0.

Distribution Job Detail:

Query: EXEC dbo.sp_MSdistribution_cleanup @min_distretention = 0, @max_distretention = 72

JOB result: Executed as user: NT SERVICE\SQLSERVERAGENT. Removed 0 replicated transactions consisting of 0 statements in 0 seconds (0 rows/sec). [SQLSTATE 01000] (Message 21010). The step succeeded.

note: When I have set Immediate_Snyc to 1 and tried then it worked, but why not with 0 as on other server I have set 0 and it's working.

Please help me.

Advise on SQL server data replication and cost saving

$
0
0

We are about to implement fail over and replication. We will be using two different servers where 2 of our websites will be hosted along with their databases. due to some reason, When site 1 is down, Traffic will directed to site 2 and site 2 has its own database, and when site 1 back online traffic will redirect to site 1. We want to keep up to date data in our both server's. Please suggest any idea where we can apply which type of replication?

We will have two different sql server as well.

Merge replication - corrupt row continually trying to INSERT

$
0
0

We have "push" SQL replication sent up, with one publisher and three subscribers. Two of the three are working fine, but one is continually causing trouble. I went through the pain and heartache of reinitialising the subscription at the weekend, and just a few days later it's stuck again.

This time, the error I'm seeing in replmerg.log (after turning up the verbosity) is:

The merge process could not replicate one or more INSERT statements to the 'Publisher'. A stored procedure failed to execute. Troubleshoot by using SQL Profiler.

I've tracked this down to a single table in the database: for some reason, an obviously corrupt row is continually trying to be INSERTed into the table, with a rowguid of 00000000-0000-0000-0000-000000000000. DBCC CHECKDB shows no sign of corruption.

Here's the row:

enter image description here

If I try to get rid of the bad row on the Publisher:

delete from mytable
where rowguid like '00000000-0000-0000-0000-000000000000'

I get the error:

Msg 2601, Level 14, State 1, Procedure MSmerge_del_590C419D78ED4A36A40292C23CF5F67B, Line 68 Cannot insert duplicate key row in object 'dbo.MSmerge_tombstone' with unique index 'uc1MSmerge_tombstone'. The duplicate key value is (3095029, 00000000-0000-0000-0000-000000000000). The statement has been terminated.

If I manually remove the row from MSmerge_tombstone, it comes back after the next replication cycle (which is continuous, so typically 60 seconds later).

I really don't want to have to reinitialise this subscription again. Is there any way of purging this set of corrupt transactions out of the "queue", or otherwise returning the replication back to normal?


is it possible to do the Merge Replication in databases that having two different database structures?

$
0
0

is it possible to do the Merge Replication in databases that having two different database structures ?

When Setuping the Merge Replication The Rows are Read only cannot be changed in subscriber Side

$
0
0

I Setup the Merge Replication In two instance with creating a database, the merge Setup was run successfully.But in subscriber side the rows are Read Only ,They cannot be Update or Delete.In the Publisher side the replication is working successfully(If We update some rows on publisher side it is replicating).

In the Subscriber Side The Replicated Database Rows are Read Only

The Data Synchronization Status

Replication recommendation

$
0
0

I am asked to investigate viability to use SQL Server replication technology for one of our upcoming project. In this project, basically there will be one central server located at corporate HQ (say Hub) and there will be multiple servers located at remote locations (say Nodes). All nodes will get data by using our application and Hub will get data directly injected into SQL Server. I am given 2 business requirements that need to be satisfied by this solution,

  1. Data to be synchronized between hub and nodes both ways.
  2. Data from one node NOT to appear on another node.

So based on those requirements, I chose to try Merge Replication.For test, I setup hub and 2 nodes. Hub is also acting as distributor. Then selected all objects of database and created subscription. And registered both nodes as subscribers. And this setup works... almost. The issue I am facing is, if I update data from node1 it appears in hub as well as node2 (and vise versa). That doesn't satisfy our 2nd requirement.

I am familiar with Replication but not master at it and I would really appreciate if someone can suggest if something is wrong with my approach. Or is merge replication not a good choice for my case?

I am using SQL Server 2014 standard editions for all 3 instances installed in Windows Server 2012R2.

Transaction Replication messed up

$
0
0

I have setup SQL Server transaction replication setup in our environment.

  • SQL version: SQL Server 2014

  • Server1 as publisher

  • Server2 as Subscriber1
  • Server3 as Subscriber2

Both subscribers are PULL type one way (transaction) replication.

Question: when I delete 100000 rows at publisher, then it deletes the same no of rows at subscriber1, but at subscriber2, it deletes more than 100000 rows.

To stop this I have to cleanup distribution and stop deletion.

What can be the issue?

Reconfig replSet issue in MongoDB

$
0
0

I used to try a replica set demo in same db folder. The replica set name is "test". Then I tried to re-build repl set with different name "repl". After i reconfig, I get error message below:

{
        "ok" : 0,
        "errmsg" : "replSetReconfig should only be run on PRIMARY, but my state is REMOVED; use the \"force\" argument to override",
        "code" : 10107,
        "codeName" : "NotMaster"
}

So I follow the errmsg, and try to run the command below:

rs.reconfig(config,{"force":true})

Now I get following error message:

{
        "ok" : 0,
        "errmsg" : "New and old configurations differ in replica set name; old was test, and new is repl",
        "code" : 103,
        "codeName" : "NewReplicaSetConfigurationIncompatible"
}

too bad! So I use the previous name "test". But I get the error again.

{                                                                                                                       
        "ok" : 0,                                                                                                       
        "errmsg" : "New and old configurations differ in the setting of the arbiterOnly field for member 127.0.0.1:27020
; to make this change, remove then re-add the member",                                                                  
        "code" : 103,                                                                                                   
        "codeName" : "NewReplicaSetConfigurationIncompatible"                                                           
}  

I just really don't understand, if every configure information has to be consistent with the previous, why do we need to reconfig it?

Someone said you can drop local database, but this operation still doesn't work.

 {
            "ok" : 0,
            "errmsg" : "Cannot drop 'local' database while replication is active",
            "code" : 20,
            "codeName" : "IllegalOperation"
    } 

Oh, MGD! I just couldn't understand why it is so difficult to restart a replset in current db folder.

Viewing all 17268 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>