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

delivering replicated transactions no update on subscriber

$
0
0

hi 

i have this error on my replication server (delivering replicated transactions) at publisher server and not updating subscriber

any help for this issue 

thanks

 


replication update statement takes long time

$
0
0

Hi Replication experts,

I have a issue and please suggest if my understanding and solution is correct.

We have a transactional replication setup for data warehouse, from today morning replication got huge latency so when I looked into it I saw the "sp_MSupd_< tablename >" was running for very long time and by this time it was running for 9 hours still no data was updated, Latency went very high. What we feel is that the index maintenance was not done in subscriber also it was not replicated too. So due to high fragmentation the update statement could take very long.
As there was no error message or blocks found all we see is the update taking very long. So to avoid this we are planning to remove the index, as this is just data warehouse index maintenance is not required by removing we can gain some space too. Is this a good Idea to implement?

When we ran profiler nothing was found, no error or alert logged.
Please let me know your suggestions

Thanks


Best Regards Moug


Appropriate Type of Replication for filtering data

$
0
0

First of all thanks for reading.

I need to replicate a subset of data that is based on a join filter; filter based on a join with another table (Microsoft:"Using join filters, you can extend a row filter from one published table to another."). This is the setting:

  • SQL Server 2012 R2;
  • replication needs to be one-direction sync (from publisher to subscriber);
  • only one subscriber/subscription;
  • small dataset with not many transactions;
  • WAN network.

What I established so far:

Option 1 - Create views and replicate those to tables via Transactional replication.

Option 2 - Use Merge replication with the join filter and set @subscriber_upload_options = 2 (download only).

The results of these two approaches are exactly the same. However the technique differs, for example the different Agents that are used. To my understanding Merge replication is especially for server - client architectures, which is not my case but.. it works..

I am a bit in doubt which approach I should follow. I was hoping that you can give me some points to consider or advise me which approach fits more to my needs.

Thanks in advance.



SQL Server Merge Agent Error

$
0
0
Hi.
We have SQL Server 2008 R2 Merge replication in Windows Server 2008 R2 Cluster.
Everything was working fine, till today when I made some changes to one of the Stored Procedures, then I started getting errors for the Merge Agents.
I added the following command to the end of one of the merge agents:
OutputVerboseLevel 4 -Output C:\agent.log
This is a link for the log: http://www.khayata.com/agent.log
It seems that the system SP sp_MSenumschemachange is causing the problem, but I don't know why ??!!
What could be the problem?

Snapshot replication : no replication transactions are available.

$
0
0

Hi All,

We have the snapshot replication set up. I see that publisher has 221 records and subscriber has 113 records. When i tried to run the replication job .  job succeded but as out put i got no replicated transactions are available.

Then i re ran the snapshot agent. and i checked that snapshot generated with 221 records. Again i started the replication from view synchronization status and increased the -outputverboselevel 2 and I see that.

2014-11-25 12:01:02.526 OLE DB Distributor '': {call sp_MSget_subscription_guid(130)}
2014-11-25 12:01:04.307 sp_MSget_repl_commands timestamp  value is: 0x0x00005ad30000001600020000064a
2014-11-25 12:01:04.307 The commit timestamp  value is: 0x00005ad30000001600020000064a
2014-11-25 12:01:04.307 No replicated transactions are available.
2014-11-25 12:01:04.932 Adding alert to msdb..sysreplicationalerts: ErrorId = 0, 
Transaction Seqno = 0000000000000000000000000000, Command ID = -1 

Please suggest why data is not replicated. I can do the re initialization here.. but i don't want to do it.

I want to understand the problem here. Why the 90+ records are not getting replicated.

Please help 

Thank you!!

SQL Merge replication destination table

$
0
0

Hi all,

is it possibile to have a merge replication that synchronize a table with different name on publisher and on subscriber (but with the same schema)? Thanks.

"Number of commands in the distribution database waiting to be applied to this Subscriber" is way off

$
0
0
"SQL Replication Monitor 2008" is showing 576664 and this number keeps growing, never going down even though the replication is working OK and the data gets delivered to the subscribers. It has been the case over the last 3 days. It is a mystery to why the "Number of commands in the distribution database waiting to be applied to this Subscriber" does not go down. Any insight/help is welcome and much appreciated.

Merge Replication with Web Synchronization always gives permission error

$
0
0

I am using an Azure virtual machine with SQL Server 2008 Standard Edition as a publisher and distributor. To enable this to work over the public Internet I have set it up to use Web Synchronization though IIS. Using a browser on my client machine I can access the https://machine.cloudapp.net/SQLReplication/replisapi.dll?diag file and it returns correctly with diagnostic information and with success messages.

My client is able to create a subscription to the server and begin the synchronization process but then gives the following error...

    You do not have the required permissions to complete the operation.

The full log from synchronizing is as follows...

   Checking for resolver dll
   Resolver dll found
   Checking resolver connectivity
   Resolver connectivity verified
   The upload message to be sent to Publisher 'machine.cloudapp.net' is being generated
   The merge process is using Exchange ID 'DEC300A9-3C95-4AB9-81D6-664B70FA5400' for this web synchronization session.
   No data needed to be merged.
   Request message generated, now making it ready for upload.
   Upload request size is 1877 bytes.
   Uploaded a total of 1 chunks.
   The request message was sent to 'https://machine.cloudapp.net/SQLReplication/replisapi.dll'
   Downloaded a total of 3 chunks.
   The response message was received from 'https://machine.cloudapp.net/SQLReplication/replisapi.dll' and is being processed.
   The remote server "machine.cloudapp.net" does not exist, or has not been designated as a valid Publisher, or you may not have    permission to see available Publishers.
   The remote server "machine.cloudapp.net" does not exist, or has not been designated as a valid Publisher, or you may not have    permission to see available Publishers.
   {call sp_helpdistpublisher (N'machine.cloudapp.net') }
   You do not have the required permissions to complete the operation.

On the server the the ReplData directory has full access for everyone and the synchronization login provides the machine administrator username and password so I am not sure how it can actually not have permission to work.

Any ideas?



Restore database came up with orphaned replication

$
0
0

Hi All,I have a strange issue in DB restore, I was building a log-shipping to a new secondary server. I backed up a database which is already replicated to another server and restored the database to the new secondary server with standby readonly state,then Built the log shipping and everything was fine, until 2 days earlier I noticed a publication appearing though I did not even enable the distributor database in this server. When I try to remove the publication I can not remove and I received a message 'Subscription does not exists' or 'publication can not be dropped as the database is in read only state'
Please let me know a good way to remove this, I do not want to break the existing log shipping setup.


Best Regards Moug

Merge replication hostname change

$
0
0

Hi ALl,

I was having the problem same as in below link

http://dba.stackexchange.com/questions/69881/sql-server-merge-replication-change-partition-definition

One more thread posted by me last week

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/fe735dd1-3493-499c-938c-cff43617b6d9/merge-replication-hostname-change?forum=sqlreplication#b6545ed0-7be5-4a70-aa96-29e15afbf450

I tried solution as below. now the data is not replicating. If i restart the merge agent it is replicating. I can not do that every time . please suggest

How to resolve this problem.

sql server agent is not highlighting start and stop options

$
0
0

I configured snapshot replication , after that sql server agent is not highlighting start and stop options in instance.

But I can start & stop it in services.msc

how I can solve this?

sp_replstart

$
0
0

Hi,

 Due to a disaster, I had to restore production publisher database (which was a transactional publisher as well a merge publisher) to an earlier point of time. Before restoring the database, I had stopped distribution agent which resulted in lot of undistributed commands.

I deleted those records using the script given in https://sqlship.wordpress.com/2010/04/23/get-undistributed-transaction-list-transactional-replication/

That is records were deleted from distribution.dbo.msrepl_commands for the particular published database.

After that production database was restored and then the stored procedure exec sp_replrestart is executed on publisher database.

This stored procedure is running for almost 2 hours. Databasesize (mdf) is 7GB.Is it normal that exec sp_replrestart will run for this time?

Do I stop the stored procedure execution.

Any suggestions , please help.

Thanks

Deadlock on sp_MSacquireHeadofQueueLock when syncing subscirbers with same "HOST_NAME"

$
0
0

Hi,
We have a SQL Server 2008 Merge Publication (Merge Pull Replication) with about 40 subscribers.
All subscribers are running SQL Server Express 2008.
When creating the subscription we set the hostname for each subscription as the [branch_ID] in order to then use Dynamic Filters.

exec sp_addmergepullsubscription_agent ....  @hostname ='ID_BRANCH_[#]'

Everything was working fine until we decided to have more than one subscriber with the same host_name for backup purposes.

Now, when 2 subscribers with the same host_name begin to sync, we get deadlocks involving the SP:sp_MSacquireHeadofQueueLock.
The worst thing is that these 2 processes lock all the subscribers so we end in super big deadlock.
We have already set the Maximum concurrent processes to 5, but this is not helping much.
This is the lock executing locked process info:

waittime       : 25853
lastwaittype   : LCK_M_X
waitresource   : APP: 8:7:[ReplicationMergeAgent047a5d7a17b]:(6f5dd27c)
dbid           : 8
uid            : 6
cpu            : 0
physical_io    : 0
memusage       : 3
login_time     : 01/12/2014 06:16:04 p.m.
last_batch     : 01/12/2014 06:20:21 p.m.
ecid           : 0
open_tran      : 0
status         : suspended
hostname       : ID_BRANCH_15
program_name   : SRVR-XXX_Pub-PORTAL-01\SQLEXPRESS-73
hostprocess    : 4756
cmd            : EXECUTE
nt_domain      :
nt_username    :
net_address    : 001CC096C970
net_library    : TCP/IP
loginame       : Xxxxxxxxx
stmt_start     : 0
stmt_end       : 0
inputbuffer    : sys.sp_MSacquireHeadofQueueLock;1 

Any advice is very welcome,
Thanks in advance


Best Regards, Daniel.



How can we submit merge replication conflict winner thorugh TSQL

$
0
0

Hello,

Currently I am seeing lot of conflicts in my merge replication. We can clean these conflicts by submitting winner through GUI (one by one),  would like to know is there any way that we can do by tsql or code so that can do all at once ? I am not looking to remove the conflicts.. It will come again..  I am looking for for submit the winner or looser.

Appreciate your help


Kumar

The distribution agent failed to create temporary files in 'C:\Program Files\Microsoft SQL Server\110\COM' directory. System returned errorcode 5.

$
0
0

One of my replication job failed with below error, which means job failed because of permission issue on the folder. To resolve that, I have granted the permission and it started working fine. Now the question is as my job was running fine since long time without any issue then how suddenly the permission of the folder got omitted automatically? I am sure that no one deleted the permission from the folder and as the server is part of SQL cluster no failover occurs.

Error:-The distribution agent failed to create temporary files in 'C:\Program Files\Microsoft SQL Server\110\COM' directory. System returned errorcode 5.


Rahul


SWITCH table partition failure

$
0
0

Hi,

I am getting a sql error during DDL change to a table. The following statement is executed on SQL server 2008 R2 SP2 database which is enabled for replication:

:CONNECT PublisherServer
GO
USE MyProfile
GO
declare @PurgePartition int =5
alter table DBAAdmin.PersonCoreAudit switch partition @PurgePartition to DBAAdmin.PersonCoreAudit_PartitionSwitch partition @PurgePartition

--Both tables DBAAdmin.PersonCoreAudit and DBAAdmin.PersonCoreAudit_PartitionSwitch have the same structure, partition key  and are not replicated.

Error:
"

Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@PurgePartition".
Msg 3609, Level 16, State 2, Line 3
The transaction ended in the trigger. The batch has been aborted."

It obvious that error is thrown inside replication system routines.  I would appreciate if someone can help to understand this failure and fix this issue.

Thanks,
Valerij


Commands in Distributor Not Replicating to Subscriber Database

$
0
0


Due to an increase in network utilization and more data, replication was backed up   The [MSrepl_commands] table in the distribution database has about 39 million rows to apply to the subscriber table.  The distributor agent keeps on timing out along with the following message "The process is running and is waiting for a response from the server". Is there any way to send smaller batches over to the subscriber?  I believe timeout is set to 30 minutes.  All 39 million rows does need to be applied.  Any help will be appreciated, thank you.

Ted


tae yang


Failure of a single article prevents the distribution of all articles in a publication to a subscriber

$
0
0

We have a SQL Server 2012 R2 SP2 environment and Transactional Replication configured with 1 instance publishing all tables in a database via a single publication (circa 150 articles in the one publication). We have a separate distribution instance, and a third subscription instance. All articles in the publication are configured to copy all data, with no advanced filtering configured. It is also noted that Alerts were not configured in Replication Monitor.

We had an issue whereby, inexplicably, a table on the subscriber vanished (I use this term because I could not find any record in the log file of a DELETE statement being issued against that table - regrettably I wasn't in the position to query the distribution database for any such commands either).

In Replication monitor we saw that the article for the table in question was failing, but no others.

The issue was that no other articles were being replicated to the subscriber, and this was evident via stalled rowcounts on the subscriber database, but increasing rowcounts on the publishing database.

When we removed the offending article from the publication, all other articles started getting applied to the subscriber database - and we could observe both publication and subscription rowcounts increasing in lockstep.

My questions are:

1) in a single publication with many articles, are the articles applied to the subscription in a single batch - meaning that if a discreet transaction for one article fails, that all other articles will be rolled back with this transaction until it is cleared.

2) Why would Replication Monitor not start showing widespread warnings for every other table (article) that was not successfully being replicated to the subscriber?

3) Aside from configuring alerts in Replication Monitor (which has happened already) and a bespoke rowcount checking 'monitor', how could Transactional Replication be configured so that the failure of the publication of an obscure article doesn't fail all articles --> I note that creating multiple publications with smaller number of articles would limit the exposure, but from what I've observed, this would only limit the exposure to those articles in the same publication.

Many thnaks

The subscription(s) have been marked inactive and must be reinitialized

$
0
0
Hi,

I keep getting the following error on Transactional Replication setup in SQL 2005.

Error messages:

The subscription(s) have been marked inactive and must be reinitialized. NoSync subscriptions will need to be dropped and recreated. (Source: MSSQLServer, Error number: 21074)
Get help: http://help/21074


The subscription expiration option has been set to
"Subscriptions never expire, but they can be deactivated until they are reinitialized."

I know we should not update the system tables but updating distribution..MSSubscriptions status to 2 resolves the issue.

Is there a fix for this problem?


Thanks

Replication over the internet using Static IP

$
0
0
our company have 15 number of point of sales outlets and everyday doing transaction by using standalone application and that app DB also locate same machine..now we have requirement to get all DB data to central head office SQL DB..(Head Office have a Static IP) No VPN connections.so i tried to do it using SQL replication but problem is i can't connect Head office DB as subscriber from out let.

normally can open head office DB from outlet by port forwarding
Them i'm kindly request please teach me how to do replication over the internet using Static IP

Thank you
Viewing all 4054 articles
Browse latest View live


Latest Images