Quantcast
Channel: SQL Server Replication forum
Viewing all 4054 articles
Browse latest View live

Max text replication Size - Interpretation

$
0
0

Fellow SQLers.

We just started setting up replication.

Realized that Max text replication Size was set to default of 65536.

We have since changed it to -1 because we do have lob fileds (ntext, max, etc). And app team got the lob error.

Accorging to the doco. It leads me to believe that this has nothing to do with replication. What it does is prevent someone updating a column that is flagged for replication and throws error for the lob column if they try to load more than 65536. Is my understanding correct?

thanks

MG



Replication - Identifying What Account Distributor is running under

$
0
0

Fellow SQLers.

sql 2016

Have setup Replication. All is running fine.

Noticed that the replication SQL Agent jobs (ie. snapshot, logreader, etc) all show job owner of the person that setup replication - Who is sysadmin.  That makes me believe that the internals might be running under that account too. I already have a domain account that is used on the box for this type of thing and want to use that.

I want to know how I can tell WHAT replication is actually using for distributor etc by way of t-sql. Obviously, I will be changing it to a proper domain account if distributor properites are under that persons sysadmin domain account.

Thanks,

MG

Merge Replication not deleting unmatched filter rows from Subscriber Database

$
0
0

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.

How to Handle Changes in PUBLISHER

$
0
0

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


 

issue with Peer-Peer Replaction in SQL Server 2016

$
0
0

Hi Team,

We have configured Peer-Peer Replication and everything is working fine but getting below issue.

Inorder to fix this issue , assigned Sysadmin role to Logreader account

But i don't want to to use Sysadmin role. Is there is anyway we can fix this?

2019-12-12 00:12:29.263 The process could not execute 'sp_MSadd_replcmds' on 'Server24'.
2019-12-12 00:12:29.263 Status: 0, code: 1007, text: 'Only members of the sysadmin fixed server role can perform this operation.'.

how to get notification email or other means when replication is down?

$
0
0

hi, Sir and madam,

i hit critical issues . finally i found out the reason is sql server 2014 peer to peer is down due to some reasons

to fix asap next time , how to get notification email or other means when replication is down?

thank you very much


delaynomore.

SQL Server Replication Configuration- Stuck at Replication Administrative Password step.

$
0
0

Hi everyone,

I have been struggling for the past one week to setup the replication in our environment and has been stuck on Administrative Password issue when adding Distributor on Publisher Server.

Replication Configuration I'm using:

  • Distributor: Remote Distributor(as we do not want any performance impact on our prod)
  • SQL Server Version 2017: Is same on all servers (Distributor, Publisher, and Subscriber).
  • Instance: Default instance (not named)
  • No firewall in our environment.
  • All servers are fully connected (Can connect to each other via SSMS).
  • Remote access is enabled.

Troubleshooting I have performed:

  1. Reset the Distributor password from Distributor Properties. (https://social.technet.microsoft.com/Forums/azure/en-US/dadf963d-9246-44ed-841a-10d27a6cdc4e/not-able-to-connect-to-remote-distributor-from-publisher-using-administrative-link-password?forum=sqlreplication)
  2. Removed publishers and added it back and reset the password.
  3. Deleted the whole distributor and reconfigured.
  4. Changed distributor_admin password from Security (GUI) and using the script method (sp_changedistributor_password [ @password = ] 'password')
  5. Tried the configuration on another server as distributor.
  6. Ensured password policy is met, even removed password policy enforcement.
  7. Removed distributor, changed SSMS version and configured the distributor again.
  8. Configured the whole setup using scripts only.
  9. Checked the Error log of target Server (No login or repl related errors)
  10. Searched for the issue exhaustively on forums.

No solution has worked so far, any input will be appreciated.

enter image description here

Thanks in advance. 

Switching properties without needing to reinitialize?

$
0
0

Greetings.

We've got transactional replication setup between a 3 TB database and several reporting servers. For very long winded reasons we want to remove large amounts of data from OLTP, and would be totally fine with it staying on the replication servers. A potentially important fun fact is that the Subscriptions are initiated from a backup, not from a snapshot.

My thought was to change the Publication properties for "DELETE delivery format" to "Do not replicate DELETE statements". However, when I make that change I get the following warning:

I hit Mark For Reinitialization as I have no option. Once complete, I attempt to launch a Tracer Token in Replication Monitor, and get the following error:

Is there any way to make this magic happen without needing to reinitialize?


Thanks in advance! ChrisRDBA


Peer-Peer Replication

$
0
0

Hi Team,

Getting below issue on Publisher in SQL 2016 Peer-Peer replication. But Subscriber is working fine:

Cannot insert duplicate key row in object 'dbo.MSpeer_lsns' with unique index 'uci_MSpeer_lsns'. The duplicate key value is (Serverdev01, rcs, 1, 1373081981, 0x000000bd00000ef1008f).

Check 'Copy non-clustered indexes' replication article property using T-SQL

$
0
0

I need to check the property of this setting at the article level across my full transactional replication environment (several servers, dozens of publications, hundreds of articles).

Tracing a change to this property, this is the call made:

use [StackOverflow]

exec sp_changearticle @publication = N'Users', @article = N'Users', @property = N'schema_option', @value = N'0x000000000803509F', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1

Any way to interpret that @value info?

I really don't want to do this by hand, despite it being billable hours.

Anyone know how to get to this in T-SQL?

Edit: scripting out the article just shows this: @schema_option = 0x000000000803509F

Thanks



22 years of database experience, most with SQL Server. Please 'Mark as answered' those posts that helped you.



duplicate key row in object 'dbo.MSsubscription_articles'

$
0
0

Getting below issue in SQL 2016 Peer-Peer Replication.

only 2 nodes in replicaittion.

getting below issue on only Subscriber, Publisher is working fine.

2019-12-14 20:45:36.681 Agent message code 2601. Cannot insert duplicate key row in object 'dbo.MSsubscription_articles' with unique index 'ucMSsubscription_articles'. The duplicate key value is (1, 354).
2019-12-14 20:45:36.696 Category:COMMAND
Source:  Failed Command
Number:  
Message: if @@trancount > 0 rollback tran
2019-12-14 20:45:36.696 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  2601
Message: Cannot insert duplicate key row in object 'dbo.MSsubscription_articles' with unique index 'ucMSsubscription_articles'. The duplicate key value is (1, 354).
2019-12-14 20:45:36.696 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  21499
Message: The procedure sys.sp_MSaddsubscriptionarticles failed to INSERT into the resource MSsubscription_articles.. Server error = 0.

SQL Server 2017 Replication Setup on Linux Server

$
0
0

Hi

I have installed SQL Server 2017 on Linux Ubuntu 18.04 LTS. But I am unable to configure replication , please advise how can we install  and configure SQL Server 2017 replication on Linux server.

Regards,

Suresh Kumar


Getting error adding new subscribers in Snapshot Agent.

$
0
0

Migrated from SQL 2012 to SQL 2016. Now getting error adding new subscribers in Snapshot Agent.

Error Message  One :
Error messages:
Message: Unable to complete login process due to delay in opening server connection
Stack:    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, Boolean usePageLockHint)
   at Microsoft.SqlServer.Replication.Snapshot.TransSnapshotProvider.InstantiateBcpOutProviderWorker(String strBcpConnectionName)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.InstantiateBcpOutProvider(String strBcpConnectionName) (Source: MSSQLServer, Error number: 0)
Get help: http://help/0
Message: Unable to complete login process due to delay in opening server connection
Stack:    at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowConnectionFailureException(CConnection* pNativeConnectionWrapper) (Source: MSSQLServer, Error number: 0)
Get help: http://help/0

Error Message 2:
Error messages:
Message: TCP Provider: The semaphore timeout period has expired.
Stack:    at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
   at Microsoft.SqlServer.Replicatio


Kiran

cannot insert value -Violation of PRIMARY KEY constraint 'PK_urls'.

$
0
0

using prod db backup file , restored a database to Dev.

this Prod db  is in replication (subscriberDB).

while try  to insert records in Urls tables @ dev getting below error,

Msg 2627, Level 14, State 1, Line 2
Violation of PRIMARY KEY constraint 'PK_urls'. Cannot insert duplicate key in object 'dbo.urls'. The duplicate key value is (187).
The statement has been terminated.


this is because of replication.. how to remove this from replication.

i used below , but not helps.

USE master
EXEC sp_removedbreplication @subscriptionDB
GO

replicate high volume bulk inserts

$
0
0

Hi all,

I am in a prestudy phase to investigate how to store large sets of parameter updates from numerous of PLCs into a historical database. Typically, we expect 5000 parameter updates per second.

My question: is it possible to use transactional replication in such a way that bulk inserts in the published database are replicated as bulk inserts in the subscriber database?

Some more background information on this question:

Currently, I have created the following setup that comes closest to the desired application architecture (SQL SERVER2019):

Buffer database [on SERVER01]:

-      Holds events of the last x days (e.g. last month) – sliding window.

-      User will not run queries on this database to be sure to maintain high INSERT performance (avoid table locks).

-      We use a buffer database to allow the historical database to be down.

-      I use partitioning to be able to switch out old data easily.

-      I have created a small test program in C# that uses the the Nuget package EFCore.BulkExtensions to bulk insert 5000 events every second. In SQL profiler, I can indeed verify that these records are bulk inserted. I use bulk insert because it offers me the best insert performance, compared to individual inserts.

Historical database [on SERVER02]:

-      Holds and remembers all events, records will never be deleted.

-      User will typically run any type of queries on this database.

Replication:

-      I have configured transactional replication to replicate the records from the buffer DB to the historical DB.

-      I only replicate INSERT commands (no UPDATE and DELETE commands).

-      The distribution DB is located on SERVER01.

Whenever I start my test program:

-      Records are inserted into the buffer database at a rate of 5000 records per second, no problem.

-      Publisher to distributor replication can catch up fast enough.

-      However, distributor to subscriber is VERY slow (1M records take > 30 minutes).

I experimented to change some settings in the distribution agent (BcpBatchSize, CommitBatchSize, CommitBatchThreshold), but this doesn’t really change the performance. I’m even not sure if they are really relevant for my use case.

I think that the fundament of the problem is that every insert of the bulk insert is a single command and that commands are replicated in the subscriber database one by one.

I know that I could consider doing the bulk inserts on both databases and avoid replication for the involved articles. However, this would require extra development to manage and monitor which records were correctly bulk inserted in which DB. If I can do I with replication, it comes ‘out of the box’.

Thanks in advance for your feedback,

Stephan




Invalid Object Name in p2p Replication in sql 2016

$
0
0

Hi Team,

We modified data in user_city table at publisher. This is Peer-Peer replication in SQL Server 2016 

after that we are getting this error :

Invalid object name 'dbo.app_config'. (Source: MSSQLServer, Error number: 208)
Get help: http://help/208



EMERGENCY - Enabling merge replication results in “DML statement cannot…” error

$
0
0
Having to set up Merge replication so that we can have SQL server in Europe and North America to reduce latency between our application servers and SQL.

After enabling Merge replication, my applications error out with the following...

19.12.20 00:44:32 SQLError: SQL Error:42000:334 in Item[23]: [Microsoft][ODBC SQL Server Driver][SQL Server]The target table 'Users' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause. 
19.12.20 00:44:32 SQLError: SQL Error:42000:8180 in Item[23]: [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.


SQL Server 2017. Any ideas? I need this to be working in 10 hours xD

Replication- Article Property

$
0
0

We have ServerA , TableA contains 10 columns  ( consider Publication)

& ServerB, TableB contains 15columns   ( consider Subscriber)

i want to replicate TableA to TableB , only 10 column. but remaining columns in TableB need to be there . ( using Transactional Replication)

in article property there is  "destinationObjects Property - Action if name is in use "Drop Existing object and  Create new one"  or  "Keep existing object unchanged"


which one i can choose?

Drop Existing object and  Create new one  -- drop tableB & create new with 10 columns? ( remove 5 columns?)

Keep existing object unchanged          -- only sycn 10 columns   , remaining 5 columns is there ?




SQl server Transaction replication -publisher shrink Transaction log

$
0
0

Hi 

I am having Transaction replication 2008 to 2014.  Now publisher side Trasaction log grown up to 100 GB and need to clear. I have noted that T log backup was failed for couple of days.  I need to clear the space.  Please confirm good to have following step

Which not break transaction replication 

1. Run transaction log backup

2 DBCC SHRINKFILE (N'DV_Log' , 0, TRUNCATEONLY)

3. shrink further if not release space physically to drive .

DBCC SHRINKFILE (N'DV_Log' , 10240)

Wish you  Merry Christmas and  have a safe holiday!!!!

Thanks 

Subscriber node down in transactional replication

$
0
0

1) I have 2 node which node 1 is publisher and distributor in same server and subscriber in node 2. In case publisher is down for few hours and i need to bring up the subscriber for read and write by disabling replication, will the transaction and commands in node 1 distribution database will be rolled back or i will lose certain data?

2) I have node 1 is publisher and node 2 have distributor and subscriber, in case publisher is down for few hours and i need to bring up subscriber for read and write. What happen to transaction marked for replication in publisher but not has been sent to distributor, will it be rolled back or i will lose certain data?

Thank you

Viewing all 4054 articles
Browse latest View live


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