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

Does Log reader agent use sa in sp_replcmds?

$
0
0

We have publisher, subscriber, and distributor on separate servers. Replication is Push Transactional with replication agents setup to run under SQL Agent account context. We are in the process of disabling sa from everywhere and I am monitoring sessions that use sa to make sure there is no impact.

I see that log reader agent session sometimes uses sa as login name in its sessions on publisher. In sys.dm_exec_sessions, there are two columns for login: Login_Name and Original_Login_Name. The Login_Name shows sa. Most of the time the SPID of log reader agent on publisher shows the SQL agent service account as login name of the session. But sometimes the same SPID shows sa as login name. This always coincides with session running SP_REPLCMDS without any parameters and also messages like "The Log Reader Agent is scanning the transaction log for command to be replicated. Approximately...." in Replication Monitor. Normally, the session would run SP_REPLCMDS giving some parameters. When this happens, in sys.dm_exec_sessions, the log reader SPID keeps showing Original Login name as that of Distributor agent service account but login_name sa.

Does sp_replcmds run as sa? If I disable sa on publisher, distributor, and subscriber, will it break replication?


TCP Provider: The semaphore timeout period has expired.

$
0
0

Hello,

I have a branch office (Server 2008 R2) server running SQL 2005 SP4 (9.0.5057) that is getting the following error message

Replication-Replication Distribution Subsystem: agent BRANCH1-JOBNAME-HEADOFFICE-10 scheduled for retry. TCP Provider: The semaphore timeout period has expired.

It is replicating data over VPN to our Head Office server (Server 2008 R2) running SQL Server 2008 R2 SP1 (Cluster). The connection between the two serves is stable. The issue arose about a week ago but had been working for over a year before that. 

Everything I seem to read points to a network issue but I haven't been able to find a cause of it is indeed network related.Any recommendations would be appreciated!

Thanks!

A Deadlock during a Delta Snapshot creation has left my transactional replication Publisher and Subscriber out of sync

$
0
0

Replication Snapshot was chosen as a victim.  The transaction integrity within Replication is suspect since the Publisher saw the articles as published yet none of the Snapshot was applied to the Subscriber.  

Log Reader Agent continued to work (including tokens) even though the Snapshot laid in wait.  The Distribution agent continued to apply updates until a transaction affecting one of the newly added articles appeared and then poof (missing Update Stored Procedure for the new article).  I think I'm cooked and must rebuild our Report database from Scratch.

Q: is have others seen this behaviour?  

Q: How common is this?

Q: Why is this still a thing after so many years (lack of transactional integrity, have the repl folks not read about ACID?

Q: Is there a way to overcome without starting replication from scratch again?

Thanks

...Ray


...Ray

Initializing Transactional Replication from Backup

$
0
0

Our reporting database is a subset (400GB) of our production 1TB+ OLTP database.   

Even with the gentlest of settings (locking, threading, etc.) , the minimal locks taken during the Snapshot process STILL cause some pretty heavy blocking for about an hour.

Q: Any chance the Log Reader Agent can read from an availability Group Secondary (I doubt it but must ask)?

Which leads me once again to consider the From Backup option.  

Q: What cleanup is required to bring the DB to the same state it would have been if built from a clean Snapshot?

I have to remove all Triggers, many FKs, 600GB of data over 400+ table and so on.  How is this not a huge problem for people creating Reporting databases?

Q: Is there a better way?

Thanks all

...Ray



...Ray

ReadCertificateThumprint : Failed to get SSB certificate thumbprint

$
0
0

Hello, 

I am installing a secondary site for SCCM and having issues in the SQL portion when it gets to setting up SSB. I'm not sure if it's directly pertinent to the SQL portion but here is what I've done so far on the config mgr side. 

    • -       SCCM 2012 Primary Site in datacenter
    • -       SQL Server 2012 hosted on the primary site server
    • -       Firewall ports opened for 80, 135, 443, 445, 1433, 4022, 8530 on cisco and host firewalls
    • -    I then opened up all firewall ports in the network and host(s) in each direction for troubleshooting when the above didn't work.
    • -       Attempting to have secondary site at each branch office
    • -       Secondary site server computer account is in local admin group on primary
    • -       Primary site server computer account is in local admin group on secondary
    • -       Secondary site server has full access to system management container in AD
    • -       Secondary site server computer account is in a security group which has sysadmin rights on the primary SQL Server
    • -       Utilizing Secondary Site Server pre-existing SQL 2008 R2 instance
    • -       Confirmed 1433, and 4022 accessibility with telnet from secondary to primary

    I run the secondary site wizard from the console, it passes all prereqs and runs setup for about 5 minutes on the secondary site server and fails here (ConfigMgrSetup.log):

    • ***Select dbo.fnConverBinaryToBase64String9thumbprint) FROM master.sys.certificates WHERE name='ConfigMgrEndpointCert"
    • CSControlSetup::ReadCertificateThumbprint : Failed to get SSB certificate thumbprint.
    • Error: Failed to setup SQL Server certificate for service broker "%NameOfMySecondarySiteServer%"
    • Error:Failed to initialize site control data.

I've searched around and the only thing I can find is in relevance to an LSA password filter reg key, but I do not have on that box. 

Any ideas? 

Thanks! 

Error appeared while upload data to server but data uploaded succesfully

$
0
0

Hello All,

I am facing a critical issue in my application using windows mobile while synchronizing data with the server, the problem is that while uploading an error "not enough storage is available to complete this operation" but what made me amazed that data has been uploaded successfully, the issue now is that sometimes not all data uploaded which may cause conflict in data in the future.

I am using Merge replication through web synchronization.

Sql server 2012 and merge replication with 4 servers or more (performance)

$
0
0

Hi All,

I have a client who has 2 stores that uses Sql server standard 2012 with merge replication and everything was working fine, then we added a 3rd store (server), and after a couple of days we started to note that the server that controls the replica and distribution DB in store 1, was getting a little slow in the performance. This server besides has 20 users connected to it working almost all the week with the POS system. And we noted that there are more conflicts almost every day, which are resolved manually.


Apart of that, in the next week we will be adding a 4rd store (server) to the replication and will be added to this server 1 too.

The question is if this is a normal situation/performance ? What are the recomendations in general in this configuration/situation of having 4 servers with merge replication.

Will this server get slower in performance ? It will help if we add more ram (actually all the servers have 16GB of ram) ?

Can we add more severs in the future or there is a limit in the number of servers replicating ?

Thanks you very much for your help

James

Unable to start execution of step 2 (reason: The LogReader subsystem failed to load [see the file for details]; The job has been suspended). The step failed.

$
0
0

Recently we rebuilt one of the cluster node (due to some issues with SP), where distribution agent resource or instance was running after rebuilding that node, we failed over distribution resource to that (newly built) node and after that log reader agent jobs were in suspended status. After checking the job history, we got the below error "Unable to start execution of step 2 (reason: The LogReader subsystem failed to load [see the  file for details]; The job has been suspended).  The step failed." 

After getting lot of search did not get exact solution which matches to the environment


Updatable subscription - view pending log from subscriber to publisher

$
0
0
Hello
I have setup Transnational replication with updatable subscription.
There was around 7000 rows update at subscriber from one query which was executed at subscriber side.
But this update has not taken place at publisher yet and so to other subscribers.
Is there any way i can monitor pending log or where is the issue?
I find so many ways to see pending logs or statistics for - "Publisher to Subscriber" but not for "subscriber to publisher"
what is the way to see subscriber to publisher pending and issues?
Pls help.

thanx

Can a Merge Publication have (2 different types of subscribers) a web subscriber and a non-web subscriber ?

$
0
0
Can a Merge Publication have (2 different types of subscribers) a web subscriber and a non-web subscriber ?

Ranga

Oracle Publisher - Transactional Replication - SQL Server 2005

$
0
0

hi.

I am trying to create a ORACLE Publisher. It is giving me below message. How can i Drop the Publisher or drop the public synonym [MSSQLSERVERDISTRIBUTOR] as suggested in the error message?
I have to careful as i already have one replication setup on the server.
Please advice


TITLE: Distributor Properties
------------------------------

An error occurred applying the changes to the Distributor.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server+Management+Studio&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.UI.DistributorPropertiesErrorSR&EvtID=ErrorApplyingDistributor&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

SQL Server could not enable 'MP5T' as a Publisher. (Microsoft.SqlServer.ConnectionInfo)

The Oracle server [MP5T] is already defined as the Publisher [MP5_SQLPUB] on the Distributor [SDOHHQDEV02].[distribution]. Drop the Publisher or drop the public synonym [MSSQLSERVERDISTRIBUTOR].
Changed database context to 'master'. (Microsoft SQL Server, Error: 21646)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3077&EvtSrc=MSSQLServer&EvtID=21646&LinkId=20476

Availability group

$
0
0

I have a Database A on one instance, and database B on the same instance.
A is publisher and B is subscriber in transactional replication.

can i setup Availablility group and keep both the DBs in the same group ?? and after failover my replication between A to B will be continue??

Transactional Replication - Backfil Data after failed publications

$
0
0

We have setup Transactional Replication that was originally initialized from a backup. Our subscriber recently had some hardware failures causing the publications to fail. We now have the server back up however the transactions for a few days have been missed, and data is now out of sync.

How do I go about resyncing that missing data? We have too many table to manually resync the data, and I cannot restore the database directly from a backup due to some permission issues and differences from the publisher. I've attempted to generate a new snapshot however I get a message "[0%] A snapshot was not generated because no subscriptions need initialization."  My current understanding that is that I should be able to take a snapshot from the publisher and apply it to the subscriber, thus syncing all the data.

Initializing Transactional Replication from Backup

$
0
0

Q1: How are the Update Procs (msIns, MsDel, etc.) generated when you use this option? Does Distributor do this automagically or do they have to be generated/applied manually?

Q2: If you initialize with backup can you add individual articles later and generate a delta Snapshot to keep things in sync?  If not I gather the idea here is to create a separate publication for this purpose until a full regen is required in the future?

Q3: Am I correct in assuming that the distributor will have to retain all transactions from the time the first subscription is created to the time all subscribers have been initialized by backup?

Thanks for you help, it's much appreciated.


...Ray

The process could not execute 'sp_replcmds during Transactional Replication

$
0
0

Log reader job failing with this error below using this command:

-Publisher [Pub_Server] -PublisherDB [Pub_Database] -Distributor [Dist_Server] -DistributorSecurityMode 1  -Continuous -ReadBatchSize 1 -OutputVerboseLevel 3  -QueryTimeOut 3600

It has never worked all though 2 other log readers on same servers work without problem.  Only activity is once a week for archiving from one database to another on the same server.  The database being archived to fails: Pub_Database.

Publisher is Sql Server 2008 R2 on Win 2008 and distrbutor and subscriber are SQL Server 2014 and windows 2012.

We had a similar error with TOE on 2008 windows, but can find no reference that it should be off on 2012 and Systems says they are disabled:

Just fyi…TCP offloading and RSS are disabled at the NIC-level on Dist_Server.  The ‘InHost’ means that offloading is not in use for any connection.

Date5/8/2015 11:42:20 AM
LogJob History (Pub_Server-Pub_Database-38)

Step ID2
ServerDist_Server
Job NamePub_Server-Pub_Database-38


Step NameRun agent.
Duration08:18:05
Sql Severity0
Sql Message ID0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted0

Message
2015-05-09 00:58:24.850 Publisher: exec sp_replcounters N'Pub_Database'
2015-05-09 00:58:24.850 OLE DB Publisher 'Pub_Server': exec sp_replcounters N'Pub_Database'
2015-05-09 00:58:24.851 Status: 16384, code: 20007, text: 'No replicated transactions are available.'.
2015-05-09 00:58:29.851 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:58:34.852 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:58:39.854 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:58:44.855 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:58:49.857 Publisher: {call sp_replcmds (1, 0, 0, , 5016, 500000)}
2015-05-09 00:58:54.858 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:58:59.859 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:04.861 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:09.862 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:14.863 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:19.865 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:24.866 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:29.868 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:29.869 OLE DB DISTOLE 'Dist_Server': sp_MSget_last_transaction @publisher_id = 2, @publisher_db = N'Pub_Database', @for_truncate = 0x1
2015-05-09 00:59:29.869 Publisher: exec sp_replcounters N'Pub_Database'
2015-05-09 00:59:29.869 OLE DB Publisher 'Pub_Server': exec sp_replcounters N'Pub_Database'
2015-05-09 00:59:29.870 Status: 16384, code: 20007, text: 'No replicated transactions are available.'.
2015-05-09 00:59:34.870 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:39.871 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:44.873 Publisher: {call sp_replcmds (1, 0, 0, , 5015, 500000)}
2015-05-09 00:59:49.873 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:54.875 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 00:59:59.876 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 01:00:04.877 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 01:00:09.883 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 01:00:14.884 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 01:00:19.885 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 01:00:24.887 Publisher: {call sp_replcmds (1, 0, 0, , 5000, 500000)}
2015-05-09 01:00:24.887 Status: 2, code: 20011, text: 'The process could not execute 'sp_replcmds' on 'Pub_Server'.'.
2015-05-09 01:00:24.887 The process could not execute 'sp_replcmds' on 'Pub_Server'.
2015-05-09 01:00:24.887 Status: 2, code: 10054, text: 'TCP Provider: An existing connection was forcibly closed by the remote host.'.
2015-05-09 01:00:24.887 Status: 2, code: 10054, text: 'Communication link failure'.


******************** STATISTICS SINCE AGENT STARTED ***************************
05-08-2015 20:00:24

Execution time (ms): 29884000
Work time (ms): 7084
Distribute Repl Cmds Time(ms): 750
Fetch time(ms): 2404
Repldone time(ms): 187
Write time(ms): 125
   Num Trans: 26  Num Trans/Sec: 3.670243
   Num Cmds: 26  Num Cmds/Sec: 3.670243
*******************************************************************************

2015-05-09 01:00:24.887 Status: 0, code: 22037, text: 'The process could not execute 'sp_replcmds' on 'Pub_Server'.'.
2015-05-09 01:00:24.887 Disconnecting from OLE DB DISTOLE 'Dist_Server'
2015-05-09 01:00:24.995 Disconnecting from OLE DB Publisher 'Pub_Server'
2015-05-09 01:00:24.996 Disconnecting from OLE DB Dist_Server 'Dist_Server'

Note monitoring in Spotlight on the Dist showed it was sleepng for 5 hrs and the whole time blocking sys.sp_MSadd_distribution_history and sp_MSsubscription_cleanup

Any help would be much appreciated. 

Thks!



Minimizing Locks during Transactional replication Snapshots - I'm running out of hair to pull

$
0
0

Found this while reading about Concurrent Snapshots

"Foreign key constraints, check constraints, and triggers at the Subscriber do not require the NOT FOR REPLICATION option because they will be disabled during the concurrent snapshot generation and will be enabled after the snapshot is generated".

Disabled where at the publisher?  Surely this would involve a significant amount of locking to accomplish and would explain the Blocking and Deadlocks I have been getting while attempting to generate a partial Snapshot.  Is this still the case with SQL2012 and later?

Is there a deep dive into the Snapshot process and locks it takes?

Here are my settings.  Can you spot any glaring mistakes?  Is there more I can do to prevent locking/blocking on my publisher during full and partial snapshots?  All I can think of now is that I should haveMaxBcpThreads at 16 or something to minimize the time it takes to create the BCP files for each article. 

:SETVAR filterClause 1=1-- 1=0 no rows to move just structure for Fast Staging DW Build and compare
:SETVAR MaxBcpThreads 1-- Used to set the Agent Profile for the Snapshot Agent.  Set to 1 for Prod to avoid the locking we saw using the default since Sql Server 2012
:SETVAR SyncMethod Concurrent-- Concurrent Concurrent for Tx Minimal Locking on Snapshot Single Thread Distribution;


exec sp_addpublication @Publication=N'$(PublicationName)', 
@description = N'Transactional publication of database ''$(PublicationDatabaseName)'' from Publisher ''$(PublicationServerName)''.',
@sync_method = N'$(SyncMethod)',   -- Concurrent for Tx publ only is Native Mode with no Locks;  
 @retention = 0, 
 @allow_push = N'true',  
 @allow_pull = N'false',-- May 2015 Should this not be false?  not sure what impacts this might have on locking
 @allow_anonymous = N'false',     -- Must be False to have immediate_sync be false which is important (see immediate sync)
 @enabled_for_internet = N'false', 
 @snapshot_in_defaultfolder = N'true', 
 @compress_snapshot = N'false', 
 @ftp_port = 21, @ftp_login = N'anonymous', 
 @allow_subscription_copy = N'false', 
 @add_to_active_directory = N'false', 
 @repl_freq = N'continuous', 
 @status = N'active', 
 @independent_agent = N'true', 
 @immediate_sync = N'false',    -- *** use false to support Delta Snapshots.  
 @allow_sync_tran = N'false', 
 @autogen_sync_procs = N'false', 
 @allow_queued_tran = N'false', 
 @allow_dts = N'false', 
 @replicate_ddl = 1,-- *** To replicate DDL changes such as Column Changes to existing Tables.  FKs and Defaults suppressed by the Schema_Option 0x200, 0x800 in sp_addArticle calls
 @allow_initialize_from_backup = N'true', 
 @enabled_for_p2p = N'false', 
 @enabled_for_het_sub = N'false'

As for my articles I do this for all of them

exec sp_addarticle @Publication=N'$(PublicationName)',@Filter_Clause = '$(FilterClause)',  @article = N'Attachments', @source_owner = N'dbo', @source_object = N'Attachments', @type = N'logbased', @description = N'', @creation_script = N'', @pre_creation_cmd = N'drop', @schema_option = 0x00000004080350DF, @identityrangemanagementoption = N'manual', @destination_table = N'Attachments', @destination_owner = N'dbo', @status = 24, @vertical_partition = N'false',  @ins_cmd = N'CALL [dbo].[sp_MSins_dboAttachments]', @del_cmd = N'CALL [dbo].[sp_MSdel_dboAttachments]', @upd_cmd = N'SCALL [dbo].[sp_MSupd_dboAttachments]'

@schema_option

--HexValueSchema Options Enabled
--0x01 Generates object creation script
--0x02 Generates procs that propogate changes for the article
--0x04 Identity columns are scripted using the IDENTITY property
--0x08 Replicate timestamp columns (if not set timestamps are replicated as binary)
--0x10 Generates corresponding clustered index
--0x40 Create corresponding nonclustered indexes
--0x80 Replicate pk constraints
--0x1000 Replicates column-level collation
--0x4000 Replicates UNIQUE constraints
--0x010000 Replicates CHECK constraints as NOT FOR REPLICATION so are not enforced during sync
--0x020000 Replicates FOREIGN KEY constraints as NOT FOR REPLICATION so are not enforced during sync
--0x08000000 Creates schemas not present on subscriber
--0x0400000000Replicates compression option for data & indexes

Any suggestions as to what to try next to avoid Blocking/Deadlocks?


...Ray

Transit Time of Merge Replication

$
0
0

Hi Experts,

we have tracer tokens for Transactional replication to know the transit time of a record. is there a way to know the same thing in merge replication?

thanks in advance.


Cheers, Vinod Mallolu

What all replicates in SQL server 2014 transactional replication

$
0
0

Hello experts,

I have a quick question on one of our ERP Database where we would be setting transactional replication on a server B.

We would like to know what all can we replicate?

Initially we would be taking the full backup and checking the option of re-initializing from backup onto server B.

But would it be complete replica of db on server A, means all SP, functions , tables, views etc will get replicated or do i have some constraints that would not go?

Please suggest how this will work and what measures can be taken?

DB still be usable whilst server perform replication

$
0
0

We have an idea to replicate SQL DB from server1 to server2 using Transactional type with push subscription.

Can we use server1 database while the replication is running?  Will it affect performance of server1?

Thanks


Publishing subscriber model

$
0
0
A ---> B ---> C

I have SQL server "A" with a transactional publication to sql server "B" , then a transactional publication to server "B", with a subscriber "C" (All servers are SQL 2008). 

Server A is the only distributor. 

When I do an insert/update at A, it reaches B, but never C; unless I re-create the snapshot at B, then C is updated.

Why is C not getting any updates/inserts?
Viewing all 4054 articles
Browse latest View live




Latest Images

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