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

Merge Replication Using Web Sync

$
0
0

Hi all,

My setup is this:

SQL 2008 Standard running on a server on domain.

IIS 7.0 running on server on domain.

SQL 2008 Express running on a client in the domain.

I want to sync the client to the server through websync.  I think I have everything functional.  I setup the publication and allowed it to use web synchronization.  I setup the web synchronization piece as well.  I then went to the client and walked through the steps to set it up as a subscriber through web sync but when i try to sync, I get nothing.  In Replication Monitor, it says uninitialized subscription.  

I don't see anything in my SQLReplication folder (that is the folder I created on the IIS server that is a virtual directory that is holding replisapi.dll and should be holding the snapshot, i would assume.  All i see in the directory is replisapi.dll and websync.txt

I almost feel like the snapshot isn't getting to the IIS server folder but I don't know how to test or verify that.

Any ideas would be greatly appreciated.

Thanks!


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


Dynamics AX Model Store Import Incompatibility with SQL Server Replication

$
0
0

We are using SQL Server Transactional Replication (SQL Server 2008 R2) to replicate a subset of Dynamics AX tables to a separate instance for reporting.  During monthly releases, we're encountering an error during Model Store Import that says a table cannot be dropped because it is used for replication.  However, this article states that Transactional Replication is supported:http://technet.microsoft.com/en-us/library/dd362068.aspx.  So, is it, or isn't it?  Right now, we have to drop the subscription, drop the publication, perform the import, then recreate both the publication and subscription, and re-initialize the subscription. 

Has anyone out there dealt with this issue?

MERGE REPLICATION - HIGH VOLUME OF CHANGES

$
0
0
Hi everybody, i wanna ask you if somebody can tell me some recomendations when you have setted a merge replication environment and you have to replicate millions of records to some suscribers.

Questions about Web Sync

$
0
0

Hi all,

I have what is hopefully a simple question that I'm just overlooking.  This is my setup:

SQL 2008 R2 on server.

SQL 2008 R2 Express on client.

Windows 2008 R2 running IIS.

I have configured IIS with replisapi and can see the webpage.  all of the tests come back as a "success".  

I have the publication created with the snapshot going to an FTP folder.  I can get to the FTP folder from the clients via simply browsing to the directory.

I can create the subscription on the client and it shows up on the server successfully. 

I can't get the synchronization to actually happen.  I'm not sure if I'm creating the subscription wrong and using the wrong security stuff or if I've got something else screwed up.  Its been baffling me for weeks now.

I'm new to web sync so please don't assume I've done everything perfectly.  Its very possible that I've screwed something up along the way.

Thanks for your help!

SQL Replication question

$
0
0

Hello everyone!

We have installed and working until today SQL 2008 r2 Enterprise on Production environment. Database contains many pictures and different type files. Pictures and different type files are located different volumes on same server.

Now, we need to replicate existing SQL database with all files(files, pictures, logs and etc.) to another new SQL Server 2008 r2 SP1 cluster environment. We are already mounted same size and same quantity volumes to the new SQL cluster environment. Is it possible to replicate all information without any downtime? How we can realize this solution?

Thank you very much!!!

SQL 2012 Mirror with SQL 2005

$
0
0

We need to move an SQL DB, so we decided to upgrade at the same time.

The upgrade will be both in software and hardware.

My question, can we setup a mirror between SQL 2012 and SQl 2005 in order to migrate the DB's to new hardware and SQL instance?

Thanks!

Why my p2p+transaction can't only replicate sp exec?

$
0
0

I have P2P with 3 nodes(A,B,C) , and hope to update lots of data at A,B,C, so I setup one transaction replication (one way) on A, and choose only replicate proc execution (not choose those based tables here) . When I run "exec proc" at A I can see same "exec proc" running at B and C, but after running done, the A node undelivered cmds show all cmds are waitting to deliver... (I use browsereplcmd to get the cmds are exactly contents of the stored proc! )  and then I have to do much clean up jobs.

Can I avoid such loop back replication? Thanks in advance!    version: sql 2012 



Transnational replication error

$
0
0

I am getting below error while initializing push transnational replication using backup. I am using SQL server 2008
R2 on both sides.

Command attempted: if @@trancount > 0 rollback tran (Transaction sequence number: 0x00093D2B00006137000100000003, Command ID: 1)

Error messages: Cannot update identity column 'id'. (Source: MSSQLServer, Error number: 8102) Get help: http: //help/8102

I have checked all tables and none of the article table have identity specified, where its specified its marked "not for replication"

Thanks, VP


Regards,
Vishal Patel
Blog: http://vspatel.co.uk
Site: http://lehrity.com

Always on Group and replications - offline usage

$
0
0

Dear All, Please can you assist me?  

We've two remote locations running windows 2012 r2 and sql 2012 which can sometimes be offline for up to 60 days.

Both sites have windows failover cluster and sql is configured with always on high availability group. 

We wish to replication two databases from site 1 to site 1. 

What is the best way forwards?? .. Any assistance would be great.

Thanks



ND

Transfer Data between 2 organizational domain

$
0
0

Hello,

Please consider the following scenario:

Company A manages the IT Infrastructure of Company B. Company A is located in US and has SQL Server 2014 Enterprise Edition. Company B is located in UK and has SQL Server 2008 R2 Enterprise Edition.

Company A uses Citrix Platform (Server located in Company B domain) as a secure access gateway.

Now, I would like to replicate data from Company B to Company A. I plan to install SQL Express 2014 on Citrix Platform gateway server and subscribe data from Company B SQL Server 2014.

Can I configure a pull subscription on Company A SQL Server box which will pick up data from Citrix Platform gateway server running SQL Server Express 2014?

Please advise.

Thanks in advance,

Rajiv

The replication agent has not logged a progress message in 5 minutes. This might indicate an unresponsive agent or high system activity. Verify that records are being replicated to the destination and that connections to the Subscriber, Publisher, and Dis

$
0
0

Does anyone know what is this mean and how to fix this?

I checked the records and they are not being replicated, and the connection to the subscriber are not active for some reason; but I don't know how to fix it.

Thanks


Philly Database developer

Oracle to SQL Server replication upgrade

$
0
0

We’re upgrading the hardware on our SQL Server distributor and the SQL version (from SQL 2005 and SQL 2012). My question is will we need to do anything to our Oracle servers which we are ‘pulling’ data from in our replication topology. Is there some agent we need to upgrade or perhaps a new driver we need to have installed so that replication will continue to work on this new SQL Server hardware running a new version of SQL 2012.

Thanks,

phil

Delete merge replication from distributor when distribution data has hard drive issue

$
0
0

We have a customer using merge replication for backup purposes only. The distribution database is on a bad spot on the hard drive so it is getting a cyclic redundancy check (and this error happens when stopping SQL Server and trying to copy the file to another hard drive). So it appears to be a hardware issue (yes, i know bigger issues).

So i want to completely remove replication on the distributor and the subscriber. I know how to do it on the subscriber. But when i try to disable and remove replication on the distributor all commands return the fact that the distribution database can't be opened.

So i am kind of stuck. i can't manually delete the database because it is a system database, and i can't remove replication which will delete it itself.

How can i manually delete the merge replication AND remove the entries that reference the distribution database when SQL can't open the distribution database.

I don't need to save any of the open transactions because i will backup the database and copy it to the backup machine and setup replication again after i get it removed.

This is merge replication on SQL 2008.


darin

remove merge replication on distributor when distribution database is on corrupt hard drive (hardware issues)

$
0
0

We have a customer using merge replication for backup purposes only. The distribution database is on a bad spot on the hard drive so it is getting a cyclic redundancy check (and this error happens when stopping SQL Server and trying to copy the file to another hard drive). So it appears to be a hardware issue (yes, i know bigger issues).

So i want to completely remove replication on the distributor and the subscriber. I know how to do it on the subscriber. But when i try to disable and remove replication on the distributor all commands return the fact that the distribution database can't be opened.

So i am kind of stuck. i can't manually delete the database because it is a system database, and i can't remove replication which will delete it itself.

How can i manually delete the merge replication AND remove the entries that reference the distribution database when SQL can't open the distribution database.

I don't need to save any of the open transactions because i will backup the database and copy it to the backup machine and setup replication again after i get it removed.

This is merge replication on SQL 2008.


darin


Merge Replication / Adding articles / Foreign Key constraint

$
0
0

I have been having an issue with SQL Merge replication that I have finally been
able to repeat and was wondering if anyone can give me any advice.

I am experiencing this issue with SQL 2008, SQL 2012 and SQL 2014.

I have SQL Standard as a Publisher/Distributor
I have SQL Express as a Subscriber

The Publisher and Distributor are on the same server and in each case,
the version of SQL server on the Publisher and Subscriber are matched, that is
if the Publisher is SQL 2014, then the Subscriber is also SQL 2014.

I have a merge pull subscription between the Publisher database and the Subscriber database.

This is working correctly.

I now attempt to add two new table objects with a foreign key relationship
between them for example a customer and transaction table.

I create the tables and the foreign key reference in the Publisher database.

CREATE TABLE [dbo].[Customer](
 [CustomerID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
  [Name] [varchar] (40) NULL,
 CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED
(
 [CustomerID] ASC
)
)

and

CREATE TABLE [dbo].[CustomerTransaction](
 [CustomerTransactionID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
 [CustomerID] [int] NOT NULL,
 [TransactionDetail] [varchar](100) NOT NULL,
 CONSTRAINT [PK_CustomerTransaction] PRIMARY KEY CLUSTERED
(
 [CustomerTransactionID] ASC
)
)

ALTER TABLE [dbo].[CustomerTransaction]  WITH NOCHECK ADD  CONSTRAINT [FK_CustomerTransaction_CustomerID_Customer] FOREIGN KEY([CustomerID])
REFERENCES [dbo].[Customer] ([CustomerID])
NOT FOR REPLICATION
GO

I then use sp_addmergearticle to add these two tables to the publication

This requires a generation of a snapshot.

At the next merge replication cycle, the two tables and the foreign key constraint are
added to the subscriber database and the tables are marked for replication and
data flows between publisher and subscriber.

Provided the replication cycle that applies the snapshot with the new articles
FULLY completes without any issue then this is what happens and the system continues on happily.

IF THE MERGE AGENT JOB FAILS during the cycle that is applying the new snapshot to
the subscriber, normally after the point where the replication monitor on the publisher is
reporting "preparing table for merge replication" then when the merge agent is started again
the snapshot is applied from the start begining with the REFERENCED table first, resulting in an error

"Could not drop object 'dbo.Customer because it is referenced by a FOREIGN KEY constraint"

This seems to happen even if the shapshot has been fully applied and the process is stopped in the
middle of the "uploading data to the publisher" or "downloading data changed to the subscriber" stages.

Furthermore, it does not seem to matter in which order I add the two above tables, I still get
the same error.

My only course of action has been to drop the foreign key reference at the subscriber, but this
requires manual interverntion.

I have had a further issue in that sometimes, when I attempt to recover from this issue I find that the tables have been added to replication (sysmergeartices) on the subscriber, but the identity range management has been left off.

There is no identity range constraint on the column and the column has an initial seed of 1. When
the transactions are merged this results in conflicts.  As I am unable to obtain a new identity
range my only option is to drop the article from the publication and add it back in, requiring
the table to be transferred to all subscribers. 

I do want foreign keys on the subscriber tables as the whole point of merge replication is that
the subscriber databases are "live", so can anybody point me in the direction I am going wrong
in trying to add tables to my publication.


Regards, Phil Doensen

TableDiff utility on 2 different Schemas

$
0
0

Hello All,

When I use below query, its successfully executing but not able to generate the file failing due to two different schemas, I have defult DBO schema on Publisger but schema on SUBSCRIBER is STG.

Is there any way i can generate the rows which are not existing on subscriber.

tablediff.exe -sourceserver SERVER1 -sourcedatabase POD -sourcetable GLNRL -sourceschema dbo -sourcelocked -destinationserver SERVER5 -destinationdatabase RPOD -destinationtable GLNTRL  -destinationschema stg -destinationlocked -f c:\temp\TableDiff_txt.txt

I dont want to use any 3rd party tool, as our environment doesnot have any.

Thanks in advance.


Regards, Pradyothana DP. Please Mark This As Answer if it solved your issue. Please Mark This As Helpful if it helps to solve your issue. ========================================================== http://www.dbainhouse.blogspot.in/

Latency monitoring without a Subscription?

$
0
0

Greetings. We're utilizing Transaction replication for Informatica Change Data Capture. To be clear, this means that we have a Publication with no Subscription. CDC grabs the data and processes it. 

This is making Latency monitoring very tough. I've taken a look at a couple ways to do this to no avail, the most recent the last solution posted here by sqlThinker. Works great on a Pub with a Subscription, not so much for one without it. I've tried modifying it and am still working on it, but so far it's not looking good.

Thoughts?


Thanks in advance! ChrisRDBA


Data Verification methods in replicated db

$
0
0

Hi All,

 We have replication setup in SQL 2000 (push ). We were getting replication errors with network related messages.

1)My understanding was that if distribution agent stops since it cannot connect to subscriber, I restart the synchronization and distribution agent will apply the pending changes at subscriber. Is it right to "start synchronizing " in this way.

2)Is there a mechanism where in which I can conclusively say that distribution agent has moved all changes to subscriber and when it starts synchronizing, it is continuing from where it stopped. I am looking for any alternative methods\solutions.

We are finding data loss at subscribers and hence trying to troubleshoot this.

Thanks

Distributor latency - slow sp_MSget_repl_commands performance

$
0
0

Hi,

 

One of our publishers is subscribed to by three subscribers, each subscriber is hosted on its own physical server. Two of those subscribers are 2008R2 and the third 2012. The 2012 subscriber is experiencing latency daily during peak times.

 

After running some extended event tracing for a couple of days I can see that the latency co-insides with slow sp_MSget_repl_commands execution times at the distributor, and more specifically the final select query found at line 724 "-- Mini join along. Only agent_id and article_id columns in dbo.MSsubscriptions". The execution time for this statement can run into >= 20 minutes.

 

Does the distributor reader thread wait for the entire execution of sp_MSget_repl_commands to complete before starting to write replicated commands to the command buffers? Or does it start writing replicated commands to the command buffers as soon as they are returned by the SP? I see that the problematic statement is hinted with OPTION (FAST 1) which might suggest that this is the case. If the reader thread does wait for sp_MSget_repl_commands to complete before starting to write replicated commands to the command buffer then that might explain the latency, otherwise I am unsure. Is there anything else obvious I can monitor?

 

The MSdistribution_history.comments suggest that the holdup is at the subscriber. However no replicated subscriber stored procedure are completing in >= 100 ms and there is no obvious physical server resource contention. I’ve ruled out the network because there are also other subscriber databases on the same physical server being populated across the same network which are not experiencing latency.

Viewing all 4054 articles
Browse latest View live