I configured transactional replication. However, data is not replicating from publisher to subscriber. I have attached screenshots of errors. Could you please advise
Kiran
I configured transactional replication. However, data is not replicating from publisher to subscriber. I have attached screenshots of errors. Could you please advise
Kiran
few days before snapshot agent showing red mark in replication monitor without any changes...
synchronizing from publisher to subscribe working fine...
and how to clean up snapshot agent job history...
plz give me a solution...
Thanks in advance.......
Hello,
I'm trying to create a merge replication between SQL sever 2012 SP4 and SQL server compact 3.5SP2.
Once I am creating a subscription in SQL server compact, I have faced the below error in step synchronize :
The server agent could not connect to the publisher.
HRESULT 0x80070057.
Thank you.
Omar
The transactional log reader seems to be broken in sql server 2019 RTM.
I upgraded my test environment and run in the problem that the second step in the sql server agent job (run agent) is only doing retries because it fails.
The only output you get (even with Outputverboselevel 2) is the one below with an empty text '' message.
2019-11-12 10:16:30.566 Microsoft SQL Server Log Reader Agent 15.0.2000.5
2019-11-12 10:16:30.566 Copyright (c) 2016 Microsoft Corporation
2019-11-12 10:16:30.582
2019-11-12 10:16:30.582 The timestamps prepended to the output lines are expressed in terms of UTC time.
2019-11-12 10:16:30.582 User-specified agent parameter values:
-Publisher WIN-4LTCDQ485TB
-PublisherDB test
-Distributor WIN-4LTCDQ485TB
-DistributorSecurityMode 1
-Continuous
-Outputverboselevel 2
-Output C:\Temp\output.txt
2019-11-12 10:16:30.597 Status: 0, code: 20015, text: ''.
2019-11-12 10:16:30.597 Disconnecting from OLE DB ''
Problem can also be reproduced on a fresh installation of sql server 2019 on a fresh windows server 2019 vm.
Can someone else confirm or has a working logreader on sql server 2019?
I cannot create a snapshot with SQL Server 2019 in order to get a transactional replication up and running. Upon the snapshot agent starting I receive the following error.
Microsoft OLE DB Driver for SQL Server: Unable to load msoledbsqlr.rll due to either missing file or version mismatch. The application cannot continue.
I hae the latest version of the OLE drivers installed and I am still getting this. How can I get the snapshot created?
Peter Munnelly
Hi
I have installed SQL Server 2019 and setup a new publication as normal.
When I have tried to run the snapshot agent it will get so far and then error out with the below:
2020-01-06 09:49:31.22 [23%] Generating merge article triggers for all table articles on the publisherI have setup two new virtual machines and installed SQL Server 2019 and the exact same issue is occuring. When I have installed SQL Server 2017 on another new VM the snapshot agent has ran successfully.
Is there a known issue or what might the cause be?
Thanks,
Mark
Kiran
Current setup: SQL Server 2016 merge replication with 1 publisher and 1 subscriber. Same exact setup for our test environment. We currently are setup with simple recover model and do 4 full database backups each day. Size of the database is around 5.1 GB.
Goal: I would like to restore data from production server to test server and ideally have option to select all tables or a subset of the tables.
Things I have tried: I have done a drop subscription and restore database, but rather not go through the whole process of re setting up the merge replication environment every time. Such as re-adding SQL Objects that exist on subscriber only to re adding users, to re-adding encryption keys etc.
I then tried SSMS database task – Import data. (I tested with one table) I created the package and then added a SQL Server Agent job to run the .DTSX package. The data copied from production publisher to test publisher, but the data did not replicate to the test subscriber.
I then tried to delete the data from test publisher and got the following error
Cannot insert duplicate key row in object 'dbo.MSmerge_tombstone' with unique index 'uc1MSmerge_tombstone'. The duplicate key value is (99999999, 99999-…..).
After researching the above error, it appears I should not do a restore with Keep_Replication true, I did not get an option to set that to false. I also did not see an option to view the script so I could possibly modify that setting? I looked during the process of creating the package and used SSDT to view the package details.
I ended up dropping the table from the publication, deleted the data and then re adding the table to the publication.
I spent a lot of time researching this but was unable to find a solution to copy data from production to test for those who have merge replication setup and just want to copy data and not the SQL objects from production to a test environment.
Toni
Hi,
I am having issues getting replication up and running correctly between two enterprise editions fo SQL Server 2019. I have just installed the latest CU1 update but am still struggling.
Intitially I had an issue with creating a snapshot, I have got aroun this by creating a publication using the following;
use db
GO
EXEC sp_addpublication
@publication = db,
@status = N'active',
@allow_sync_tran = N'true',
@allow_queued_tran = N'true',
@allow_pull = N'true',
@independent_agent = N'true'
Once the publication was created, I created the subscriber by;
USE [db]
GO
EXEC sp_addsubscription
@publication = db,
@subscriber = 'server',
@destination_db = db,
@sync_type = 'initialize with backup',
@backupdevicetype ='disk',
@backupdevicename = 'C:\db.bak'
This creates ok and give me one way replication from the publisher to the subscriber, however I want to use 2 way replication but I cannot seem to get this working. If I go to properites of the subscription I can see that updatable subscription is set to false and this cannot be change.
I have removed the subscription and tied to add @update_mode = 'sync tran' to the sp_addsubscription commands above but I just receive incorrect syntax near @update_mode
Could somebody help me to acheive the transactional replication with updatabe subscription please?
Peter Munnelly
We are using Oracle publisher to replicate data from oracle to SQL server,everything works well but i see the rowlevel triggers captures old data and new data also so i am seeing duplicates records in HREPL_POLL for two operations,any idea why its tracks
old data?its slowing the process as we are having multiple records.As per the trigger logic whenever updates happens its stores old data and new data,can it update data basing on primary key?or its the expected behavior
/* Formatted on 8/30/2019 10:06:55 AM (QP5 v5.256.13226.35510) */
CREATE OR REPLACE TRIGGER HREPL_ARTICLE545_TRIGGER_ROW
AFTER DELETE OR INSERT OR UPDATE
ON "FLXUSER"."TEST"
FOR EACH ROW
DECLARE
Seq NUMBER := 0;
Stmt NUMBER;
Op1 NUMBER := 0;
Op2 NUMBER := 0;
EntryTime NUMBER
:= ROUND (TO_NUMBER ( (SYSDATE - HREPL.BaseTimeT) * 86400));
BEGIN
IF HREPL.SQLORIGINATOR = FALSE
THEN
BEGIN
SELECT HREPL_SEQ.NEXTVAL INTO Seq FROM DUAL;
IF UPDATING
AND ( :old."ID" != :new."ID"
OR :old."NUM" != :new."NUM")
THEN
SELECT HREPL_STMT.CURRVAL INTO Stmt FROM DUAL;
Op1 := '15';
OP2 := '16';
ELSE
IF INSERTING
THEN
Op2 := '2';
ELSIF DELETING
THEN
Op1 := '1';
ELSE
Op1 := '3';
Op2 := '4';
END IF;
END IF;
IF UPDATING OR DELETING
THEN
INSERT INTO HREPL_ARTICLE545LOG_1
VALUES (Seq,
Stmt,
Op1,
0,
EntryTime,
:old."ID",
:old."NUM");
END IF;
IF UPDATING OR INSERTING
THEN
INSERT INTO HREPL_ARTICLE545LOG_1
VALUES (Seq,
Stmt,
Op2,
0,
EntryTime,
:new."ID",
:new."NUM");
END IF;
END;
END IF;
END;
/
Hi all,
I've a problem with a merge replication. When I make changes on it, adding a new article, the SQL Server CE subscriptions crash while trying to synchronize, the get error number 25542 (SSCE_M_QP_READONLYINSERT) on [__sysMergeArticles] table.
I don´t unsderstand why this happen and I'm very frustated because the only way to run is deleting the SDF file at the subscriber.
Any suggestions?
Thanks in advance.
Regards.
JMF
Hi Guys,
We are using below SP for clean up, it was supposed to clean data older than 3 days from CDC tables, but its not works as excepted
EXEC sp_cdc_change_job @job_type='cleanup', @retention = 4320, @threshold = 5000
How to clean up data older than 3 days.
Regards,
Navin
Navin.D http://dnavin.wordpress.com
I have applied filters on articles in SQL Merge Replication and syncing the data using MergeSynchronizationAgent via Web Synchronization. The data is syncing as per the applied filters from publisher to subscriber. Similarly when anything is changed on subscriber that is syncing to publisher correctly and if the data at subscriber does not lie under applied filter on publisher, that is automatically deleting from subscriber database.
All this is working well if I am syncing daily. Problem starts when I initiate a sync after a weekend, or after couple of days. Everything in the sync works except the data which should now be deleted from subscriber as it does not fulfill the applied filter criteria.
I actually have filter applied based on GetDate(), which means as soon as the next day starts and I initiate a sync, the data from the previous day should be deleted automatically from subscriber. Even in this, the publisher to subscriber direction syncing is fine i.e. the previous day's data does not sync to subscriber. But this should work the other way (subscriber to publisher) as well i.e. the last days data from subscriber should be deleted too. This is happening correctly if I am syncing daily, but not happening if I have a gap of days (like weekend) in syncing.
Hello all. I am a student attempting to run the 'Creating a Mobile Application with SQL Server Compact Edition' walkthrough on the MSDN site. Unfortunately I am running into a problem I can't seem to get through...
I am executing the following steps in the walk-through:
Create the publication snapshot
- In SQL Server Management Studio, in Object Explorer, expand the (local) computer node.
- Expand the Local Publications folder, select the publication name, right-click SQLMobile, and then click View Snapshot Agent Status.
- In the View Snapshot Agent Status dialog box, click Start.
Make sure that the snapshot job has succeeded before you continue.
I have checked all the services and permissions, IDs, etc. on my box. They all look good.
I am running WinXP with SP2. The version of SQL Server 2005 is Developer Edition. I have installed SQL Server SP2 to see if that would fix my problems but it didn't...
The 'Snapshot Agent Status' gets as far as 18% and then I get the following error:
An unspecified error had occurred in the native SQL Server connection component.
This is the full text of the error message:
Error messages:
Message: An unspecified error had occurred in the native SQL Server connection component.
Stack: at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowConnectionFailureException(CConnection* pNativeConnectionWrapper)
at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.InitializeNativeBcpOutProvider(LogMessageCallback logMessageCallback, String strName, String strApplication, String strHost, String strServer, String strNetwork, Int32 encryptionLevel, String strDatabase, SecurityMode securityMode, String strLogin, SecureString strPassword, Int32 bcpBatchSize, Int32 loginTimeout, Int32 queryTimeout, Int32 packetSize, DeadlockPriority deadlockPriority, String strRowDelimiter, String strFieldDelimiter, Byte syncMethod, Boolean forceOdbcBcp, Boolean forceOleDbBcp, Boolean enableMultipleActiveResultSets, Boolean useReadPastHint)
at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider..ctor(LogMessageCallback logMessageCallback, String strName, String strApplication, String strHost, String strServer, String strNetwork, Int32 encryptionLevel, String strDatabase, SecurityMode securityMode, String strLogin, SecureString strPassword, Int32 bcpBatchSize, Int32 loginTimeout, Int32 queryTimeout, Int32 packetSize, DeadlockPriority deadlockPriority, String strRowDelimiter, String strFieldDelimiter, Byte syncMethod, Boolean forceOdbcBcp, Boolean forceOleDbBcp, Boolean enableMultipleActiveResultSets)
at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.InstantiateBcpOutProviderWorker(String strBcpConnectionName)
at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.InstantiateBcpOutProvider(String strBcpConnectionName)
at Microsoft.SqlServer.Replication.Snapshot.SqlServer.BcpOutThreadProvider.Initialize()
at Microsoft.SqlServer.Replication.WorkerThread.NonExceptionBasedAgentThreadProc()
at Microsoft.SqlServer.Replication.WorkerThread.AgentThreadProc()
at Microsoft.SqlServer.Replication.MainWorkerThread.AgentThreadProc()
at Microsoft.SqlServer.Replication.AgentCore.BaseAgentThread.AgentThreadProcWrapper() (Source: MSSQL_REPL, Error number: MSSQL_REPL55012)
Get help: http://help/MSSQL_REPL55012
Clicking the link from within the Replication Monitor takes you here:
and it is not helpful at all. In addition, a Google search for 'MSSQL_REPL55' returned no hits either.
Any help is greatly appreciated. Thanks all.
According to this page https://msdn.microsoft.com/en-us/library/ms152543.aspx, "the @threshold parameter, which is used to determine when a new range of identities is required for a subscription." And "For example, you could specify 10000 for @pub_identity_range, 1000 for @identity_range (assuming fewer updates at the Subscriber), and 80 percent for @threshold. After 800 inserts at a Subscriber (80 percent of 1000), a Subscriber is assigned a new range."
We are running transactional replication on a application DB with approx 6000 tables.
We are planning to upgrade the application and in doing so, a number of tables are affected by either getting deleted or restructured in some way or form, getting new ones, etc.
What are my options besides recreating the replication all together?
TIA
Hi All,
We are getting below error in SQL server replication. its SQL 2012 enterprise edition.
Message
Replication-Replication Distribution Subsystem: agent (null) failed. You do not have sufficient permission to run this command. Contact your system administrator.
Message
Error: 14151, Severity: 18, State: 1.
Kindly provide me step to resolve the above issue.
Regards,
Karthik B
Hello all! I am trying to set up replication to a test environment and am running into some problems. This pratically a copy of an existing replication job that's working, but with the name of the replicaiton job and the subscriber being different.
I'm getting this error:
2020-01-22 18:05:05.386 Snapshot will be applied from the alternate folder '%Replication Folder Name%'
2020-01-22 18:05:05.776 Agent message code 20034. The process encountered operating system error '뚰캛¶'.
2020-01-22 18:05:05.932 ErrorId = 39696, SourceTypeId = 2
ErrorCode = '20034'
ErrorText = 'The process encountered operating system error '뚰캛¶'.'
2020-01-22 18:05:05.948 Adding alert to msdb..sysreplicationalerts: ErrorId = 39696,
Transaction Seqno = 001184e9000a0e54003d00000000, Command ID = 4
Message: Replication-Replication Distribution Subsystem: agent %agent_name% failed. The process encountered operating system error '뚰캛¶'.ErrorId = 39696, SourceTypeId = 3
ErrorCode = '0'
ErrorText = 'The operation completed successfully.
I can't find much if any information about the error messages and the garbage text is different every time the error appears. Any clues?
Thanks in advance!
Hi,
Running SQL Server 2008 R2 SP3 in a merge replication topology, publisher and distributor are on same machine.
We have a merge article, [dbo].[Table_A], which is specified as a filtered table in our publication. There are multiple merge article join filters configured against the merge article. For example:
Article [dbo].[Table_A]
Join Filter [dbo].[Table_A_1]
Join Filter [dbo].[Table_A_2]
Join Filter [dbo].[Table_A_3]
Is it possible to create an additional nested level of join filters? For example:
Article [dbo].[Table_A]
Join Filter [dbo].[Table_A_1]
Join Filter [dbo].[Table_A_1_A]
Join Filter [dbo].[Table_A_1_B]
Join Filter [dbo].[Table_A_2]
Join Filter [dbo].[Table_A_3]
Any assistance is greatly appreciated!
Best Regards
So I decided recreating a transactional replication (TR) from scratch instead of dropping and adding articles when we do our upgrade in the near future. Our DB is large, 280GB with 6000+ tables.
On a test environment, I created TR initialization from snapshot on a 15GB DB with 6000+ tables. It took approximately a painful 3 hours.
I asked around and I was pointed to the option to initialize subscription from backup.
Did some research and found this tutorial which was very helpful.
Replication: Initialize with Backup
So following it step by step and after several tries/tweaks, I was able to bring up my TR test in approximately 20 mins. I sampled some tables (add/delete) and it was replicating as desired.
I was wondering, why didn't he create a SNAPSHOT AGENT [REPL-Snapshot] (Remarked Out) at all even if he was using initialization from backup. Wouldn't there be any use of a snapshot agent once you have replication set up and running?
Is there anything I should be aware of using this option as well?
TIA