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

Merge Agent Failed

$
0
0

One of my merge failed with the following error.

"The Merge Agent failed because the schema of the article at the Publisher does not match the schema of the article at the Subscriber. This can occur when there are pending DDL changes waiting to be applied at the Subscriber. Restart the Merge Agent to apply the DDL changes and synchronize the subscription. "

There is no spartial data type assigned to any of the column

It is sql server 2008 R2 SP1.


 - Kerobin



multiple replication instances on the same instance of sqlserver 2012 SE

$
0
0
Hello,

I am currently having publisher(database A), subscriber (database B) and distributor on the same instance for a test environment that is using a uni directional transactional replication. 

Now I need to setup another unidirectional transactional replication in the same test instance but for a different database. Publisher database is D and subcsirber database is E.

thanks a ton

sp_adjustpublisheridentityrange will not create new constraint range for subscriber

$
0
0

I have a merge replication in place.  I increased the identity_range to 100000 for a table.  I have done this both ways, via the properties of the publication on SSMS, and via TSQL.  I have call sp_adjustpublisheridentityrange.  Then I recreated the sanpshot.

 EXEC sp_adjustpublisheridentityrange @table_name = N'Label', @table_owner = N'caseup';

but after synchronization, the range defined in the table's constraint has not changed and now all of the identity values are used up.  All inserts are failing.

What needs to be done to force the publisher to recreate the identity range on a subscriber(s).



TX replication issue

$
0
0
Hello,

This morning I noticed that transactionalreplication distrubtion agent crashed on my SQL Server 2012 SE production. I was looking at the distribution history and I was seeing the below:

Messages:
The replication agent encountered a failure. See the previous job step history message or Replication Monitor for more information.  The step failed.

Executed as user: <username> . String or binary data would be truncated. [SQLSTATE 22001] (Error 8152).  The step failed.

A replication agent encountered a fatal error and was shut down. A mini-dump has been generated at the following location:

C:\Program Files\Microsoft SQL Server\110\Shared\ErrorDumps\ReplAgent20150713043222_0.mdmp



So I started the distribution agent and commands are getting replicated now. due to the volume of transaction it says unditribution commands 200000 and time to distribute based on past performance as 1:10:00

I am trying to look at the minicrash dump. However what could have caused this problem is a mystery for now as it has been running for the past 3 years without issue?

Expers I need your valuable inputs.

Thanks a ton.

Merge rep schema change and processing order

$
0
0

Hi all.
Question re Merge rep (pull) and processing order.  

We have a group of changes associated with an app upgrade, the scripts run fine on the publisher.   

Part of the change includes creation of a new table , followed by altering a view to use new table.

Following the change at the publisher, when the sync is kicked off from the subscriber, it fails - the alter of the view throws an
'invalid object' error with regard to the new table. 

Seems as if the view alter is attempted before the dependant table has been created. 

I have tried to amend the processing order of the view using sp_changearticle, which executes (quickly) with a 0 return code.

But it is to no avail , the error still occurs.  

Can anyone give me any pointers as to how to deal with this , is it possible to change the processing order for a view article , which will be applied to schema changes ? Have I hit a buggy bit ? Any pointers advice welcome.
Thank you!

Problem inizialiting a large Merge Replication

$
0
0

Hi folks,

whe have had a problem in the initialization of a Merge replication of 3.600.000 rows on SQL Server 2014.

The sp_MSmakegeneration was generating a large number of X locks and the replication process was unable to start.

Finally we solved the issue modifying the generation_leveling_threshold parameter to0

But, by knowledge this was a known issue with older SQL Server Version.

Does anyone know why this problem persist, or if is mandatory to set it to 0 due to ininizialize large Relicas?

Thanks in advance for your answers


Ruggiero Lauria
MCT-MCITP-MCSA-MCSE-MS SQL DBA

Distribution database is huge in size

$
0
0

i have transnational replication setup on two environments,

on one server distribution database is tiny, but on the second server the distribution database is 5 times bigger, and taking up lot of space,

both environments have almost same size of data.

please advise the solution.


k


Can I update how many commands or the batching size from an Oracle Publisher?

$
0
0

Hi,

We have an Oracle to SQL transactional replication process set up and this process has been running fine until our business user decided to ran a large single batch update (60+ million records) which slowed down replication.  Is there a way to update the number of commands the log reader is getting from the Oracle change tracking tables?  I know that -ReadBatchSize is not supported for Oracle publishers, but what about -ReadBatchThreshold? To allow this large batch to replicate over, we had to stop SQL apply on the Oracle primary server and wait.  It took about a day and a half for replication to get caught up.  By default, how many transactions/rows/commands are in a batch and can we change this number?  Any help will be appreciated. Thank you.

- Tae      


tae yang


Msg 14004 $s must be in the current database - but it is

$
0
0

Hi, I'm using sp_addarticle to help manage table replication.  This works very nicely - for most tables.  For some, it inexplicably (to me at least!) fails with a Msg 14004 error.

   Msg 14004, Level 16, State 1, Procedure sp_MSrepl_addarticle, Line 290

   <table name> must be in the current database.

I can run the same code for tables alphabetically before or after those that fail.  The same tables always have the same result, either the article is added or it doesn't. For example, it works for NAV table 'Purch. Cr. Memo Hdr.' and 'Posted Document Dimension' but not for 'Purch. Cr. Memo Line', 'Purch. Inv. Header' or 'Purch. Inv. Line'.

Note: This is NAV multi-company.  The results are the same for all companies - i.e. adding an article for table Purch. Cr. Memo Line fails for each of the companies in the database. Adding an article for Purch. Cr. Memo Hdr. works for exah of the companies!

Can anyone shed any light on this?

The alternative is to use the GUI which is painfully slow due to the large number of items displayed in the Objects to Publish panel.


Reg remote publisher and distribuator set up

$
0
0

Greetings Guys,

I am setting up  transaction replication in SQL Server 2012 with three individual servers for Distribuator, Publisher, Subscriber, But I want to know how to set the folder for Snapshot agent like whether the folder should be a network shared folder or normal local folder. Please let me know.

With regards,

Gopinath.


With regards, Gopinath.

Replication Issue

$
0
0

Hi All,

I am facing the issue from distributor to subscriber and show to you history:-

Retries Attempted0

Message
2015-07-20 08:48:52.081 11 transaction(s) with 20 command(s) were delivered.
2015-07-20 08:49:02.127 24 transaction(s) with 46 command(s) were delivered.
2015-07-20 08:49:11.066 16 transaction(s) with 30 command(s) were delivered.
2015-07-20 08:49:20.894 21 transaction(s) with 40 command(s) were delivered.
2015-07-20 08:49:29.599 13 transaction(s) with 22 command(s) were delivered.
2015-07-20 08:49:54.153 25 transaction(s) with 43 command(s) were delivered.
2015-07-20 08:51:23.682 63 transaction(s) with 90 command(s) were delivered.
*******************************************************************************

2015-07-20 08:52:05.958 <stats state="1" work="2387" idle="881"><reader fetch="2" wait="1139"/><writer write="2387" wait="2"/><sincelaststats elapsedtime="341" work="277" cmds="1127" cmdspersec="4.000000"><reader fetch="0" wait="141"/><writer write="277" wait="0"/></sincelaststats></stats>
2015-07-20 08:52:05.958 ************************ STATISTICS SINCE AGENT STARTED ***********************
07-20-2015 14:22:05

Total Run Time (ms) : 3309670 Total Work Time  : 2387760
Total Num Trans     : 9664 Num Trans/Sec    : 4.05
Total Num Cmds      : 17836 Num Cmds/Sec     : 7.47
Total Idle Time     : 881333 

Writer Thread Stats
  Total Number of Retries   : 0 
  Time Spent on Exec        : 2422076 
  Time Spent on Commits (ms): 1035 Commits/Sec         : 0.16
  Time to Apply Cmds (ms)   : 2387760 Cmds/Sec            : 7.47
  Time Cmd Queue Empty (ms) : 2853 Empty Q Waits > 10ms: 199
  Total Time Request Blk(ms): 884186 
  P2P Work Time (ms)        : 0 P2P Cmds Skipped    : 0

Reader Thread Stats
  Calls to Retrieve Cmds    : 391 
  Time to Retrieve Cmds (ms): 410172 Cmds/Sec            : 43.48
  Time Cmd Queue Full (ms)  : 731976 Full Q Waits > 10ms : 34

2015-07-20 08:52:27.595 155 transaction(s) with 282 command(s) were delivered.
2015-07-20 08:53:04.895 108 transaction(s) with 200 command(s) were delivered.
2015-07-20 08:54:05.080 82 transaction(s) with 152 command(s) were delivered.
2015-07-20 08:55:14.235 48 transaction(s) with 70 command(s) were delivered.
2015-07-20 08:56:13.515 117 transaction(s) with 227 command(s) were delivered.
2015-07-20 08:57:31.749 61 transaction(s) with 106 command(s) were delivered.
*******************************************************************************

2015-07-20 08:57:31.749 <stats state="1" work="2750" idle="881"><reader fetch="2" wait="1465"/><writer write="2750" wait="2"/><sincelaststats elapsedtime="325" work="362" cmds="1037" cmdspersec="2.000000"><reader fetch="0" wait="325"/><writer write="362" wait="0"/></sincelaststats></stats>
2015-07-20 08:57:31.764 ************************ STATISTICS SINCE AGENT STARTED ***********************
07-20-2015 14:27:31

Total Run Time (ms) : 3635463 Total Work Time  : 2750447
Total Num Trans     : 10235 Num Trans/Sec    : 3.72
Total Num Cmds      : 18873 Num Cmds/Sec     : 6.86
Total Idle Time     : 881333 

Writer Thread Stats
  Total Number of Retries   : 0 
  Time Spent on Exec        : 2747526 
  Time Spent on Commits (ms): 1098 Commits/Sec         : 0.14
  Time to Apply Cmds (ms)   : 2750447 Cmds/Sec            : 6.86
  Time Cmd Queue Empty (ms) : 2900 Empty Q Waits > 10ms: 203
  Total Time Request Blk(ms): 884233 
  P2P Work Time (ms)        : 0 P2P Cmds Skipped    : 0

Reader Thread Stats
  Calls to Retrieve Cmds    : 403 
  Time to Retrieve Cmds (ms): 703361 Cmds/Sec            : 26.83
  Time Cmd Queue Full (ms)  : 764580 Full Q Waits > 10ms : 35

I don't know where is issue but from my thinking issue is on writing the command on replicated server.

Issue is not occurred continuously but sometime and when the issue is occurred then active time is 100% of the disk, check through resource monitor. so please let me know what to do for resolving this issue.

My distribution database is on subscriber .I have already  change the disk for distribution db and replication db and I havent restart the sql server so in resource monitor it show on the same drive but it change the drive the system catalog.

Thanks in advance

SQL Server 2008 Replication “between retries” or “worker thread no available”

$
0
0

Hi,

All our existing servers are in SQL 2008 and I am in the process of upgrading to SQL 2014 and as well moving SAN to different SAN storage.

As part of it I have to upgrade my distributor.

We got about 7 production database servers and data from all that servers are replicated using a separate distributor to multiple subscribers. Totally got about 78 publications going to multiple subscribers for various reasons!!!

So I started with creating a new VM with Windows 2012 and SQL 2014, made that as the distributor and started changing the distributor of each publisher to the new one and eventually once everything is moved the old distributor can be dropped.

We setup replication from first 2 servers (about 30 publications or assume x publications) to multiple subscribers and things worked fine. It is all Transaction replication with pull subscription. NO delays in replication things working great.

The moment I add a one more publication replication goes into “between retries” or sql agent jobs complains about no worker threads to start. I tested by deleting one of the existing publication and the new one works fine. So I digged around and read that the number of worker threads on the server level and subsystem level needs to be high enough to run mulitiple SQL agents jobs continously.

So I updated the worker threads on server level setting, restarted server, and that didn’t help. I found the subsystem worker thread information in msdb.dbo.subsystems and updated the worker threads as defined here http://blogs.msdn.com/b/karthick_pk/archive/2011/02/01/sql-agent-maxworkerthreads-and-agent-subsystem.aspx and that doesn’t seem to help.

I also found about Desktop Heap issue and updated the Shared allocation of member in registry as specified @ https://support.microsoft.com/en-us/kb/949296

My distributor is a VM, 2 processors and 8GB ram on it. It is same as the existing SQL 2008 box. I do see that the existing 2008 has a high desktop heap and as well subsystem processor count updated. One issue in updating msdb.dbo.syssubsystems table is it gets reset whenever SQL server restarts by this proc: dbo.sp_verify_subsystems. So I tried adding a startup proc that updates the worker threads and that doesn’t help. This issue has been discussed @ http://dba.stackexchange.com/questions/78191/sql-server-2012-replication-subsystem-increase-number-of-working-threads

One thing that seems to work in the new server is, after I setup more replication if I restart the server then it works. But, the moment I add a new replication the new server doesn’t work. In my older server I could as much new replication I want and it doesn't require any restarts. So restart doesn’t sound right.

Any help is appreciated. Should I update the worker threads or other settings for Agent jobs? or Do I have to rely on restarts?

If nothing works then I will open a support ticket.

Thanks,
Nachi

Finding history of a non-replicated transaction

$
0
0

Hi All,

Using transactional replication between 2 remote sites. I am trying to find the history of a transaction from the publisher side, which did not make its way to the subscriber side.

I can't find any errors in the Agents for the subscription.

Basically we inserted a row in one table on the publisher side and it is not there on subscriber side. In Replication Monitor, under 'Number of commands waiting to be applied to Subscriber' - it is 0.

I know there are a few tables in distribution database to possibly track its history (i.e. from log reader agent to distribution agent..) but not exactly sure where to start and what commands/sps to use.

First this is I think I need to find the xact_seqno for the INSERT command? Where can I get this and then from that point how can I track it to see where it disappeared or errored out to?

Thanks in advance!

Subscriber database having missing Index

$
0
0

Dear all,

At my subscriber database I found some missing Indexes if I update all the missing Indexes on subscriber DB, does it impact at on publisher side?

Please let me what to do thanks!

Changing password for remote distributor (distributor_admin)

$
0
0
We have inherited a remote distribution db where the password has been lost.  I would like to confirm that if you change the password in the distributor properties-->publishers--> administrative link password that the password will be changed on all publishers without having to resnap the publications?

Replication subscriber versions can I have ?

$
0
0
Hi All,

I am little confused with the below statement. Regarding Subscriber version which depends on the type of publication.

As per msdn documentation, i am interested in Transactional replication. So, it says: A Subscriber to a transactional publication can be any version within two versions of the Publisher version. What does it mean?

Reference link: https://msdn.microsoft.com/en-us/library/ms143699%28v=sql.120%29.aspx

To be more specific, consider below cases and expecting answers for below:

case 1: if Publisher is on SQL 2005, what all SQL versions can I have as subscribers?
case 2: if Publisher is on SQL 2008/2008 R2, what all SQL versions can I have as subscribers?
case 3: if Publisher is on SQL 2012, what all SQL versions can I have as subscribers?
case 4: if Publisher is on SQL 2014, what all SQL versions can I have as subscribers?

Thanks in advance.

Ability to use Query hint in Transactional Replication filtered articles

$
0
0

Really frustrated with this piece and hence sharing my experience with the product team.
I am setting up filtered replication(tran repl) for a table that is 2+ TB in size. The filtered rows are less than 1% of total size.

When I run the snapshot, sometimes it complete in 27 mins(I have already optimized the snapshot agent profile) and sometimes it runs for ever. Mostly it runs forever, so the chances of it finishing soon are really very less.

I have infact created filtered index just to cater to the query in the filter i.e. on the filter predicates. The reason its flipping flopping is due to the incorrect plan that it chooses. I can force the right index and the filtered query runs just fine but I cannot use the query hints when I am adding the filter in replication as its not allowed.

I then went ahead and created the plan guides to force the best plan. But the plan guide was not used because even if there is a single space in the actual query that replication runs in the background the plan guide will not be used(testing on plan guides has proved this).

The query needs to be ditto same including whitespaces and carriage returns. I then ran profiler and found that there is a view that replication creates and executes to extract the filtered rows and BCP it. Got the text of the view and created the plan guide on it but it was still not used because sp_helptext output seems to be different than what is actually being fired by replication internally.

Further, I collected the verbose log with level 2 and tried to find out if the main query shows up there with no success. So now I'm stuck. I know the solution but I cannot use it because:
(a) I can't use the plan guide because I do not know the exact syntax(I mean I have the query but I do not know the white spaces, carriage returns, etc) and
(b) I cannot use query hint while filtering the article.

1. I cannot afford to have downtime.
2. I cannot use backup and restore option either.

Submitted the feature request on connect as well:

https://connect.microsoft.com/SQLServer/feedback/details/1577872/ability-to-use-query-hint-in-transactional-replication-filtered-articles


Abhay Chaudhary OCP 9i, MCTS/MCITP (SQL Server 2005, 2008, 2005 BI) ms-abhay.blogspot.com/

SQL Server Transactional Replication and Double Take software - help

$
0
0

Hi

Need help understanding Double take software working with Sql Server Transactional Replication.

Not sure if I placed this in the right category..............

OS - WIN SERVER 2008R2 

SQL - 2008R2

May I begin by saying that I have never used DOUBLE TAKE before. But we are
in the process of outsourcing our systems to a 3rd party company.  What we have
existing at the moment is 3 servers, one is a primary (publisher) A (LIVE) Server and one is
a secondary B (sql server mirrored ) server and a 3rd server which is using sql
server transactional replication to server C  (from A)(SUBSCRIBER - Which is used for
LIVE real time reporting).

In moving to the new outsourced environment we are moving to again 3 servers,
Server A and Server B are this time using (double take mirroring/replication)
and Server C is still using SQL SERVER Transactional replication FOR live REAL
TIME REPORTING from server A.

My question/problem is that the outsourced company are dealing with the
double take side of things and I am dealing with the SQL Server tranactional
replication. So I created a database on server A, double take to Server B and
and I setup sql transactional replication to Server C. Changes I amde on Server
A were reflected in Server A and I could see it immediately on Server C. As
server B is in a recovery state I didn't want to continue with with other 30
databases until I knew that the double take was working. So I got the 3rd party
to failover the double take to Server B, but just say 30 seconds before  I asked
them to failover I made a further change in the databse on Server A. On failover
to B, the initial change made on Server A was seen on Server B, but the second
change wasn't. But both changes were seen on the sql replicated Server C.
Changes were then made to the database on Server B which were not seen on Server
C and when it was all failback to server A, the changes that were made at server
B were not reflected in A.

Can anyone help me understand how I configure sql server transactional
replication to work with double take.? Has anyone got such an environment? It
also seems to me that the double take wasn't working correctly. Any help would
be greatly appreciated.


Regards David McGarry

Monitoring replication from external system with PHP

$
0
0

Hi,

So I am trying to monitor the status of a replication using php on a Linux system. I set up a user account that has the replmonitor role on the distribution database.

----

Via SMSS and logged as the specific user account, I can execute:

sp_executesql

N'use distribution; exec sp_replmonitorhelpsubscription @publication=''DBNAME'', @publication_type=2'

And I get 2 rows as a result since I have 2 subscription.

----

However when trying it from the Linux box with php, I get the following:

PHP Warning:  mssql_query(): message: Cannot insert the value NULL into column 'agentstoptime', table 'tempdb.dbo.#tmp_replication_monitordata________________________________________________________________________________________000000029230'; column does not allow nulls. INSERT fails. (severity 16) in ....

----

So what could cause the insert issue in one case but not the other especially on a temp table ?

Regards,

Olivier

SQL 2014 High Availability (Always On)

$
0
0

Greetings

I have two SQL 2014 Servers configured with a handful of Availability Groups. Everything on this front is working well. My question is in relation to the replication and the underlying network. The Servers currently have one network card each. I would like to separate the client connectivity from the replication network.

I can obviously add an additional NIC to the machine and configure for replication network but how do I tell SQL Server to use this link over the other? Does anyone have any pointers please on how to do this?

Many thanks

Keeka

Viewing all 4054 articles
Browse latest View live




Latest Images