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

Production database has been set to be the distribution database in Server 2005.

0
0

Hello all and thank you in advance.

Recently we were attempting to setup database replication so we would have a copy of our production environment to run reports against. In the process of setting the production server up as the distribution server, the main production database was set as the distribution database. This resulted in our production database being moved under into the system database area. It is now treated as a system database. The database still works correctly, everything it was doing before it is still doing. 

So the question I have is this. What is the best method to extricate it? I've been looking for hours for a solution to this problem and not found anything I'm thrilled with. The only thing I can think of would be to backup the table, kill the connections to it, drop it, then restore it to a blank db.

Has anyone seen this happen before, from what I can tell this is supposed to be pretty much impossible. I tried recreating the problem on a few of our test servers and they displayed errors even trying to get this to happen. Any help would be greatly appreciated!


Cannot set incompatible publication properties

0
0

I have tried to add the table automatically to transactional replication by using below script.However, I am getting the error.Could you please help me to solve this problem.

use AAAEXEC sp_changepublication@publication ='AAA',@property ='allow_anonymous',@value ='False'
GOEXEC sp_changepublication@publication ='AAA',@property ='immediate_sync',@value ='false'createtable#rtables(name varchar(100))insertinto#rtables(name)select objectname from ddl_log where is_replicated=0declare@count int;declare@table varchar(100);declare@flag_pk int;select@count=count(*)from#rtablesWHILE@count >0BEGINselecttop1@table=name from#rtablesSELECT@flag_pk =1FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE  CONSTRAINT_TYPE ='PRIMARY KEY'AND TABLE_NAME = N'@table'AND TABLE_SCHEMA ='dbo'If@flag_pk =1BEGINexec sp_addarticle @publication = N'AAA',@article = N'@table',@source_owner = N'dbo',@source_object ='@table'EXEC sp_addsubscription@publication = N'AAA',@article = N'@table',@subscriber = N'AAA',@destination_db = N'AAA'ENDSET@count =@count -1;deletefrom#rtables where name=@tableEND;droptable#rtablesEXEC sp_refreshsubscriptions @publication = N'AAA'-- Start the Snapshot Agent job.EXEC sp_startpublication_snapshot @publication = N'AAA'EXEC sp_changepublication@publication ='AAA',@property ='allow_anonymous',@value ='True'EXEC sp_changepublication@publication ='AAA',@property ='immediate_sync',@value ='true'

Here is the Output:

The publication was updated successfully.

The publication was updated successfully.

(41 row(s) affected)

(1 row(s) affected)

(5 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

Job ‘servername-AAA-AAA-26' started successfully.

Msg 20011, Level 16, State 1, Procedure sp_MSrepl_changepublication, Line 1319

Cannot set incompatible publication properties. The 'allow_anonymous' property of a publication depends on the 'immediate_sync' property.

The publication was updated successfully.

Replicate a Read/Only database to a live database

0
0

I have an environment that I need to be able to replicate (somehow) a read-only database to a live/online database.

From the source database (database1) I'm using "manual" log shipping to database2; logs are pulled manually to the database2 server then restored, at that point the database2 is left in standby mode, so that an hour later more logs can be restored.

From there, I need to be able to somehow replicate database2 to database3 where the database can be read and/or manipulated...without having access to database1 server.

I know that some people have used a third party tool such as SQL Examiner, but I'd really need to be able to do this without using a third party tool.

Is there any way of doing this?  Can I use Availability Groups or something such as that?

Database2 is on a VM on the Azure platform...if that makes any difference in a possible solution.  Also, I'm using SQL 2014.

Thanks.


Archiving Solution in Replication enviornment for SQL Server 2014

0
0
Application - MS Dynamics CRM 2013
DB - SQL Server Enterprise 2014
Objective - The CRM DB has grown very large & it is proposed that we should do data archiving to improve the performance & reduce overheads.
Archival Solution proposed - Create a parallel instance of CRM & keep all the data older than 12 months in the archival instance. Make this a Read Only instance with a separate URL for users. All the data older than 12 months then can be deleted from the production DB.
Current problem/Help needed on - Mechanism for replicating the data on a ongoing basis. For first time we can backup & restore but going forward how the incremental data moves into the Archival instance?
Options explored so far - 
1) SQL replication - problem is that when data is purged from publisher, it will also be purged from subscriber
2) Third party tools - Scribe etc.. but they have license implication plus not sure which tool will fit requirement unless we do a POC
3) ETL jobs - It will be a very huge effort considering there are 350+ tables 

Bidirectional Transactional Replication with More than 50,000 Tables

0
0

Hello,
I have a database with more than 50,000 tables that needs to be replicated to another site. The database size is around 1.2 TB. Transactional replication has a limitation of approximately 32,000 articles. How would I get around this limitation to replicate the database? What options are there for replicating such a database? Please note we have SQL Server Enterprise Edition 2014.
Thank you for your help,
Ephraim Shurpin

Replicating from 2008 R2 to 2016

0
0

According to this article https://msdn.microsoft.com/en-us/library/ms143550.aspx SQL Server replication from a 2008 R2 publisher to a 2016 subscriber is not supported.

We need to replicate from 2008 R2 to 2016 for a short period of time. I am proposing that we Republish via SQL Server 2014 to accomplish this with a 2016 distributor. I have tried the following but didn't get it to work:

SERVER1: Windows 2008 R2, SQL 2008 R2. Publisher.

SERVER2: Windows 2012 R2, SQL 2014 named instance. Subscribed to SERVER1. Distributor for SERVER1. Republisher.

SERVER2: SQL 2016 named instance. Distributor for 2014 instance. Subscriber to 2014 named instance.

I couldn't get the publication on the 2014 named instance to use the 2016 distributor. I could only get it to work with the 2014 distributor, so I tried the following solution which DOES work where the only difference is there is one distributor (instead of two) on the 2016 instance:

SERVER1: Windows 2008 R2, SQL 2008 R2. Publisher.

SERVER2: Windows 2012 R2, SQL 2014 named instance. Subscribed to SERVER1. Republisher.

SERVER2: SQL 2016 named instance. Distributor for 2008 R2 and 2014 instances. Subscriber to 2014 named instance.

Does anyone see an issue with solution 2 proposed? Will this be supported by Microsoft?

Merge process could not enumerate changes at the subscriber

0
0

Hi,

First of all, saddened for my level of English.

I've seen quite a few posts about this error message but so far no answers.I'm merge replicating between SQL Server 2014 (distributor) and SQL Server 2012 SP3 (publisher and suscriber). I've many merge replications on différent database. The distributor, publisher and suscriber are all the same. All is working except one. This replication have 175 articles, only tables, no filter, and 3 suscribers.

Regularly, i've this error :

2016-11-29 15:01:53.514 OLE DB Abonné 'database_b': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-11-29 15:01:53.514 OLE DB Serveur de publication 'DATABASE_A': {call sys.sp_MSenumcolumns (?,?,'CAEF8727-163A-42A9-919E-1684A8BD55CD')}
2016-11-29 15:01:53.561 OLE DB Serveur de publication 'DATABASE_A': {call sys.sp_MSenumdeletesmetadata(?,?,?,?,?,0,0,?,?,90,1)}
2016-11-29 15:01:53.561 OLE DB Abonné 'database_b': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-11-29 15:01:53.561 Percent Complete: 0
2016-11-29 15:01:53.576 Énumération des suppressions dans tous les articles (lot de génération 1)
2016-11-29 15:01:53.592 Repl Agent Status: 3
2016-11-29 15:01:53.592 OLE DB Serveur de distribution 'DATABASEREPL-A': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-11-29 15:01:53.608 OLE DB Abonné 'database_b': {call sp_MSenumcolumns (?,?)}
2016-11-29 15:01:53.608 Percent Complete: 0
2016-11-29 15:01:53.608 Énumération des insertions et des mises à jour dans l'article « TMachineEditionBatchMonitoring » (lot de génération 1)
2016-11-29 15:01:57.420 OLE DB Serveur de distribution 'DATABASEREPL-A': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-11-29 15:01:57.436 OLE DB Serveur de publication 'DATABASE_A': {call sys.sp_MSenumchangesdirect(?,?,?,?,?,?,?,?,90,1,0,'932A1F53-9324-466C-948D-34A230C56786')}
2016-11-29 15:01:57.452 Le processus de fusion n'a pas pu énumérer les modifications sur le « Publisher ». Lors de la résolution du problème, redémarrez la synchronisation avec un enregistrement d'historique détaillé et spécifiez un fichier de sortie dans lequel écrire.
2016-11-29 15:01:57.452 OLE DB Abonné 'database_b': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-11-29 15:01:57.483 Percent Complete: 83
2016-11-29 15:01:57.498 Le processus de fusion n'a pas pu énumérer les modifications sur le « Publisher ». Lors de la résolution du problème, redémarrez la synchronisation avec un enregistrement d'historique détaillé et spécifiez un fichier de sortie dans lequel écrire.
2016-11-29 15:01:57.498 Repl Agent Status: 6
2016-11-29 15:01:57.498 OLE DB Serveur de distribution 'DATABASEREPL-A': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-11-29 15:01:57.498 OLE DB Abonné 'database_b': {call sp_MSmergeupdatelastsyncinfo (?,?,?)}
2016-11-29 15:01:57.530 Percent Complete: 0
2016-11-29 15:01:57.530 Category:NULL
Source:  Fournisseur de réplication de fusion
Number:  -2147200999
Message: Le processus de fusion n'a pas pu énumérer les modifications sur le « Publisher ». Lors de la résolution du problème, redémarrez la synchronisation avec un enregistrement d'historique détaillé et spécifiez un fichier de sortie dans lequel écrire.
2016-11-29 15:01:57.530 Repl Agent Status: 3
2016-11-29 15:01:57.530 OLE DB Abonné 'database_b': {call sp_MSmergeupdatelastsyncinfo (?,?,?)}
2016-11-29 15:01:57.530 L'Agent de fusion n'a pas réussi à mettre à jour les informations sur la dernière synchronisation sur l'Abonné. Vérifiez que l'abonnement existe sur l'Abonné, et redémarrez l'Agent de fusion. 
2016-11-29 15:01:57.545 OLE DB Serveur de publication 'DATABASE_A': {call sp_MSmergeupdatelastsyncinfo (?,?,?)}
2016-11-29 15:01:57.545 Le processus de fusion n'a pas pu mettre à jour les dernières informations de synchronisation sur le serveur de publication.

I've delete and create the publication, i've tried to change the profile. Query and loging timeout are at the maximum level.

Any ideas ??

Regards

Stéphane

peer-to-peer transactional replication on sql 2014

0
0

This is what I did to setup the replication.

I ensured that databases on both servers are identical.

1. configure the distribution db this configured distributor and enabled publisher on the first machine.

1a. configure the distribution db this configured distributor and enabled publisher on the second machine.

2. Create new local publication on the first machine

3. Create new local publication on the second machine

4.  On the first machine, in the peep-to-peer topology, add the second machine.

I understood, that this all that was needed to setup peer-to-peer replication.   I looked at the replication monitor on both machines and found status to be ok and replication was excellent.

I made a change to a row on one server and this change propagated to the remote server.  Last synchronization date is current.  Awaiting synchronizations is 0.

However, I am not getting replication history.  In fact, looking at msdistribution_history, no replicated transactions are available.  I there a way to see what got synced?   Is there an issue with my replication setup?

Thanks in advance



Agent Last Action error

0
0
What does: the process could not execute 'sp_repldone/sp_replcounters' on SERVERNAME mean??

Can we create indexes for View on Subscriber DB

0
0

Hi All,

We have replication in place and We have one view in subscriber db..

So, can we have indexes on views in Subscriber db without having them in the Publisher db?

Replication is a Transactional Replication

We are using Microsoft SQL Server 2008 R2 standard Edition

Thanks

Raghu


SQL 2008. Merge replication. Snapshot agent. Access Denied

0
0
Windows Server 2008 Standard x64 SP1, SQL Server 2008 Enterprise Edition x64 SP1
Snapshot agent has read-write permissions to ReplData folder but cannot access local snapshot folder. How to resolve this error?

Error messages:
Source: mscorlib
Target Site: Void WinIOError(Int32, System.String)
Message: Access to the path 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\ReplData\unc\ServerName_DatabaseName_PublicationName\DateTime\' is denied.
Stack:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity)
   at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity)
   at Microsoft.SqlServer.Replication.Utilities.CreateDirectoryWithExtendedErrorInformation(String directory)
   at Microsoft.SqlServer.Replication.Snapshot.SnapshotProvider.CreateSnapshotFolders()
   at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.CreateSnapshotFolders()
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
   at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
   at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: mscorlib, Error number: 0)
Get help: http://help/0

High CPU usage occurs periodically on the subscriber - SQL Server 2008 Sp4

0
0

Hello,

I have setup a merge publication and a subscriber with push subscription mode.

On the subscriber, I notice the CPU usage is going high periodically.

It may take about 40 seconds for the CPU Usage come back to 0%. And it occurs at same time as long as theSynchronization Status display : "Uploading data changes to the Publisher" . This only occurs at subscriber, the publisher is normally.


I've go to  Reports > Top Queries by Total CPU time at the subscriber to see which queries make the CPU usage go high and below is the result:



I don't know what to do next to fix this issue. Anyone please help me. Thank you all very much.

Unwanted Objects

0
0

Hi,

I am new to replication, please help.

Need to set up two servers, one replicating all transactions to the other. Eventually I want to replicate approximately 200 tables, views, etc. To get started I have specified only one table to be replicated, to see if I can set up the plumbing. After some trial and error, reading of documentation, and harsh language I got it to work, but I am getting these errors which I cannot understand.

My test table is called SMService_Cfg - it was selected for its simplicity and independence - no relations whatsoever to any other table. No foreign keys, no anything else that would tie it to other tables, except that it is in the same database.

Database is called NYBTE, primary server doing publishing is POINCARE, secondary server doing a pull subscription is called LORENZ. I am running SQL Server 2012 Developer Edition (equivalent to Enterprise edition?) on both machines.

When I first turn on the subscription I get these messages:

------------------------------------------------------------------------------------------------------------------------------------------------------

Snapshot will be applied from the alternate folder '\\POINCARE\SMReplication\unc\POINCARE$SMARTMASTER_NYBTE_SMARTMASTER\20161202081029\'

Initializing

Applied script 'SMService_Cfg_2.pre'

Applied script 'SMService_Cfg_2.sch'

Bulk copying data into table 'SMService_Cfg'

Bulk copied data into table 'SMService_Cfg' (1 rows)

Delivered snapshot from the 'unc\POINCARE$SMARTMASTER_NYBTE_SMARTMASTER\20161202081029\' sub-folder in 78 milliseconds

-------------------------------------------------------------------------------------------------------------------------------------------------

So far so good. But then there comes this error message:

The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_RemoteStations_DNP_30_AL_Channel__DNP_RemoteStations". The conflict occurred in database "NYBTE", table "RSExec.RemoteStations", column 'Name'.

Subscription keeps retrying, repeating the same error. While these objects ARE in database NYBTE, I have NOTasked for them to be replicated. Anybody have any ideas?

Any thoughts would be greatly appreciated.

Thank you in advance.

Peter


PMBT

merge replication data sync issue

0
0

Hi,

I just completed setting up merge replication, but when I am testing, the data is not getting synced up. How do I go about troubleshooting the issue. I am new to merge replication. Any articles for reference would be great.

Thanks.


sqldev

To replicate or not

0
0

I have a SQL 2012 server in production which I don't want to touch. I have a department who want to modify a .net program to modify the data on tables.  So we have another SQL Server 2008.  In SQL2012 production, there is a database with 20+tables that are being modified on daily basis.  I want that department access the SQLServer2008 instead for their own purpose and reporting so the real data can still reside in production.

Is it better to setup a one-way replication from SQL2014 to SQL2008 and select that entire database to replicate at all times?  Is LinkServer the answer or what other alternatives do i have to get this done? This way that particular department can have real data at all time to play with.

Thanks in advance.

Sean


How to provide disaster recovery protection for a SQL Server Distributor?

0
0

I have a complicated replication set up with a separate distributor server. I would like to provide HA and DR protection for the distributor and am trying to set this up in a lab. I have the following so far (see image for clarity):

HA for the distributor at the primary site by using a SQL Server Failover Clustered instance:

SQL Node Names: LUPIN, MARIGOLD

SQL Network Name: SWEETPEA

I have placed the distribution files on a file share called \\TULIP\SWEETPEA_DISTRIBUTION and used DFS replication to replicate the distribution files to the DR site (for lab purposes). So far so good.

What I'd like to do is create a clustered instance at the DR site, and replicate at the disk level, the files from the primary file server to the DR file server. Leave the DR FCI stopped until we need to invoke DR, and then start the DR server.

Here's the topology I'm trying to create:

I'm wondering if this topology is even possible?

Indexes on Subscriber Database

0
0

Hello All,
I have transactional replication setup from Production server to another server for reporting purposes. We also created some extra indexes on subscriber database for query performance. So when there is any change in replication and our DBA re-initialize replication, indexes on subscriber database lost everytime. We have to create them manually and application run into performance issue. Can we avoid not to drop indexes when replication in reset? Also can we automatically create index once replication is reinitialized?

Please help.

Transnational Replication not continuing after the subscriber Database Restart

0
0

My transnational replication is connected to 8 branches from a head office database. It is continuously running subscription from HO to Branch. But it is not continuing after if any branch database is restarted. it showing error message like

"Agent '' is retrying after an error. retries attempted. See agent job history in the Jobs folder for more details."

but if we try to connect that database from HO is possible, as well as if we restart the agent in Head office it will work.

Please give me a solution


sp_changepublication allow_anonymous unable to complete

0
0
I was trying to add an article to current transnational replication and don't want to recreate the whole snapshot so I ran below script to change the publication properties allow_anonymous and immediate_sync, but it was stuck and unable to complete even over 30 minutes, the database is not big (30GB, creating snapshot for the whole db takes only 15 minutes). I have tried recreating the whole publication then run it again, but no luck. 

sp_changepublication @publication = ‘BIDB’,
@property = ‘allow_anonymous’,
@value = ‘false’
GO

EXEC sp_changepublication @publication = ‘BIDB’,
@property = ‘immediate_sync’,
@value = ‘false’
GO

what's going on with changing these 2 properties? and it was blocking other normal user sessions, have to cancel and rollback with 'ROLLBACK TRANSACTION' as described here:
https://social.msdn.microsoft.com/Forums/en-US/201a4c22-db83-402e-a99f-8bdbf119cd12/exec-spchangepublication-long-time-to-be-executed?forum=sqlreplication'

Stop Pull Subscription Programatically

0
0

Hi,

Is there a store procedure that one can use to stop a pull transaction subscription programaticaly from subscription machine? Any other way to do that (except via management studio)?I was digging through documentation and could not see anything obvious.

Thanks in advance.

Peter


PMBT

Viewing all 4054 articles
Browse latest View live




Latest Images