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

Backup&Restore initialize subscription with identity column

$
0
0

Hi Guys,

Just encountering a issue when using backup&restore to initialize a subscription where the publisher table contains identity column (and configured as "Not for replication"). As you known, after restoring the backup on the subscriber side, the identity property will be left. Under this situation, SQL Server tries to create the "sp_MSupd" stored procedure which tries to update this column. Did you try to initialize a subscription with backup&restore method, and the publisher table contains an identity column as primary key? If so, can you share your solution?


彼节者有间,而刀刃者无厚;以无厚入有间,恢恢乎其于游刃必有余地矣!


Error (possibly login related) when setting up publication

$
0
0

I am attempting to set up replication for several SQL Server 2005 databases that are used by our equipment.  The equipment is run from a computer with a SQL Server instance 'Cloverleaf'.

We have a second computer that also has SQL Server 2005 with instance name 'User'.  The computers are connected over our company network, and I can read and write data into the Cloverleaf databases from the User computer.  On the User computer, login is by Windows authentication.  To see the Cloverleaf databases from this computer, I have to enter a username and password.

I have setup the User computer as a distributor for the Cloverleaf server.  Sitting at the User computer, when I try to set up a publication on the Cloverleaf database, I get this error message:

SQL Server could not connect to the Distributor using the specified password.  Additional information: Connection to the server [USER-PC] failed... linked server... returned "Login timeout expired" and "An error has occurred while establishing a connection to the server..." (Microsoft SQL Server, Error: 21670)

I have also tried to go to the Cloverleaf computer to set up the publication.  However, when I get to the point where I need to connect to the distributor computer, Windows authentication gives a similar message to what is above, and I have no idea if SQL Server authentication would work or, if so, what username or password to try.

Both instances have remote connections enabled.  

Do I need to setup a new Windows authentication account on the User computer to enable the Cloverleaf computer to connect to it?  If so, how would I go about that?  Or is there something else I should look into to troubleshoot this problem?

SQL Server P2P replication failing when db name have space

$
0
0

Configuring P2P replication in database which have space in name, for ex [te st] instead of db name as [test].
 It throws the error as 
===================================================================
Cannot find a valid Queue Reader Agent ID for the subscription to Publisher <publisher>, database <database>, publication <publication>. The specified subscription to an updating Subscriber publication is not initialized. Run the Snapshot Agent, Distribution Agent, and Queue Reader Agent to initialize the subscription. (Source: MSSQLServer, Error number: 21758)
===================================================================
While this is not the case. If I configure the P2P replication on same database by just renaming it, it works fine.

Its know bug but do we have any alternate for this to overcome of this problem? I have a database which I cant rename and have to keep it as it is. I googled it lot but haven't found any solution so far.

Please need some solution.

Need Help Understanding Publisher/Distributor Version rule

$
0
0

The below comes from a link about SQL Server replication for 2008R2.  http://msdn.microsoft.com/en-us/library/ms143241%28v=sql.105%29.aspx.  However, I don't know if I understand it correctly.  Is it saying that the Distributor version can't be older than the Publisher or that it can't be newer than the Publisher version?  I have a SQL Server 2005 instance that I would like to replicate to a SQL Server 2012 instance that was set up as a new server for SSRS.  Since the 2005 instance is my Publisher, what I need to know is where can my Distribution database go? 

"For all types of replication, the Distributor version must be no earlier than
the Publisher version. (Frequently, the Distributor is the same instance as the
Publisher.)"

I also am wondering if I can even run replication from 2005 up to a 2012 instance because of this from the same link.

"For transactional replication, a Subscriber to a transactional publication can be any version within two versions of the Publisher version. For example, a SQL Server 2000 Publisher can have SQL Server 2008 Subscribers, and a SQL Server 2008 Publisher can have SQL Server 2000 Subscribers. "


Lee Markum

MSmerge_genvw_ can't be found on subscriber

$
0
0
Hi All Merge replication subscriber reports error Invalid object name 'dbo.MSmerge_genvw_DF2B86DA786A46E2A89AF08682E6A81D'. All subscribers have same error. I've tried to reinitialize subscription. Recently we upgraded from SQL2005 to SQL2008R2. After that we re-generate big snapshot and re-create and re-sync all subscriptions. Now publisher is SQL2008R2 and all subscribers are SQL2005. Replication work well for a while, but now we have this weird error. I know replication creates such views for all download-only articles. But I've never seen problems like this before. How we can troubleshoot and fix problems like this? Thank you in advance!
DBA

SQL Server 2008 R2: Backup and Restore Database Replication

$
0
0

Dear All, I has two node of SQL Server 2008 R2 running on Windows Server 2008 R2 SP1. I configured SQL Replication. On Node1 is publisher and Distributor. Node2 is subsriber. I'm planning to backup Node1 and Node2. Could you guide me the best pratice to backup SQL Database Replication for Fullback, Differential and Transcation Logs?


Khemarin333@hotmail.com

Log Reader Agent is not able to read Transaction Log of Publisher database.

$
0
0

Hi,

There is no restore or change in recovery model or detach-attach action performed on my production database but still I am seeing below error message from Log Reader Agent-

Error messages:
The process could not execute 'sp_repldone/sp_replcounters' on 'ProdInstance'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20011)
Get help:

An error occurred while processing the log for database 'MyDatabase'.  If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log. (Source: MSSQLServer, Error number: 9004)


The process could not set the last distributed transaction. (Source: MSSQL_REPL, Error number: MSSQL_REPL22017)
Get help: The process could not execute 'sp_repldone/sp_replcounters' on 'ProdInstance'. (Source: MSSQL_REPL, Error number: MSSQL_REPL22037)

Note- CheckDB on production and distribution database executed successfully. Also, I need subscriber to be a true copy of publisher so I think sp_replrestart is not an option for me.

My question is how to resolve this issue? I am thinking that reinitialization should resolve the problem but what if this is not going to resolve? Do I need to reconfigure the transaction replication? Please sugegst.


SQL SERVER 2008 R2 - REPLICATION BEGINNERS

$
0
0

Hi all Friends,

Am beginner to ms sql 2008 and i have installed sql Express edition and management studio and tried to do replication there some issues i have faced 

1) Cant use my host as distributor

2) SQL server agent Edition is running 

3)Cant create publisher also 

May i know which edition supports for all replication ( Merge,Transactional,Snapshot)

Thankful to repliers


how to use sp_startmergepushsubscription_agent?

$
0
0

I was looking for a way to start my on-demand merge sync  and found a reference to this system stored procedure. Only issue is I can not find much (virtually none) documentation or examples on how to use it.

So on my replication SQL instance (db-k\mirror) I have a publication called: [GLOBAL]:[Global merge publisher v032514]

which uses a remote distributor on server db-k\vps_stage to replicate (bidirectional) to servers db-j and db-k\production

so on db-k\mirror I'm trying to execute the following but I get the error "

Msg 20026, Level 16, State 1, Procedure sp_MSmergepushsubscriptionagentjobcontrol, Line 63

The publication '[GLOBAL]:[Global merge publisher v032514]' does not exist."

use GLOBAL
EXEC sp_startmergepushsubscription_agent
 @publication = N'[GLOBAL]:[Global merge publisher v032514]',
 @subscriber = N'[db-k\VPS_STAGE].[GLOBAL]',
 @subscriber_db = N'GLOBAL'

I've also tried this using just '[Global merge publisher v032514' with the same results. Obviously I'bve got the parameters wrong but I'm at a lost as to what this procedure wants.

Any help would be appreciated.


Developer Frog Haven Enterprises

reqirements to set up the replication between two domains

$
0
0

I have to create transactional replication between two servers on 2 different domains ('server-G' from domain1 and 'server-Y' from domain2) .

So please help me on reqirements to set up the replication between two domains

requirements to set up replication between domains

$
0
0
I have to create transactional replication between two servers on 2 different domains ('server-G' from domain1 and 'server-Y' from domain2) 

SQL SERVER 2008 R2 - TRANSACTIONAL REPLICATION

$
0
0

HI ALL,

IN TWO SERVER I HAVE INSTALLED MS-SQL 2008 R2(64 BIT),CREATED INSTANCE WITH SQL AUTHENTICATION/WINDOWS AUTHENTICATION, AFTER CREATING DATABASE, I TRIED TO DO TRANSACTIONAL REPLICATION,IN NEW SUBSCRIPTION WIZARD I ENTERED

SERVER NAME : COMPUTER NAME\INSTANCE NAME   

SQL SERVER AUTHENTICATION >> USERNAME : sa PASSWORD : ****

AFTER THIS AM GETTING ERROR AS CANT ABLE TO CONNECT ERROR 29

CAN ANY ONE HELP ME OUT FOR THIS , THANKS IN ADVANCE

SQL Server Replication Error occured during the new article addtion

$
0
0

HI All,

We are facing the Sql Server Replication error during the new article addition.

Msg 20027, Level 11, State 1, Procedure sp_MSadd_subscription, Line 223
The article '(null)' does not exist.
Msg 14070, Level 16, State 1, Procedure sp_MSrepl_changesubstatus, Line 1208
Could not update the distribution database subscription table. The subscription status could not be changed.
Msg 14057, Level 16, State 1, Procedure sp_MSrepl_addsubscription_article, Line 383
The subscription could not be created.
Msg 266, Level 16, State 2, Procedure sp_MSrepl_addsubscription, Line 0
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0.
Msg 266, Level 16, State 2, Procedure sp_addsubscription, Line 0
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0. 

Please help us to fix the error.

Regards,

Pawan Singh


Thanks

How to set up Continues Replication from Log shipping read only Database to Active Database

$
0
0

We are applying logs in every 30 min to one SQL db which has to be in Restoration Mode/Read only mode as we are applying logs continuously. Now we have to Set up Replication of this Read only Db to other SQL db provided that other db will be active one Transaction Replication seems to be doesn't work here as one db is always in Restoration mode Please help How to achieve same

Highlight
Log Shipping Db is read only -- Other db should be Active
As we apply new log to first one we can get same data update on other database that should be in Active mode 

unable to delete a publication

$
0
0

I have an errant publication I want to remove from my SQL instance but when I try to I get a message to the effect that the publication does not exist, the distributor in not set up correctly, or it can not find some procedure (but in typical SQL exception reporting never says what procedure it can not find).

I've tried several things.

attempt to delete using the object explore delete menu option:

   this process errors out with the following error --

TITLE: Microsoft SQL Server Management Studio
------------------------------

Could not delete publication 'Freescale merge publication v031414'.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1&EvtSrc=Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.Replication.ReplicationMenuItem&EvtID=CantDeletePublication&LinkId=20476

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

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

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

Could not find stored procedure ''. (Microsoft SQL Server, Error: 2812)

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

------------------------------
BUTTONS:

OK
------------------------------

The t-sql attempt: executing the following

se [FREESCALE]
EXEC sp_changedbowner 'sa'
exec sp_removedbreplication N'Freescale merge publication v031414'
exec sp_droppublication @publication = N'Freescale merge publication v031414'
GO

results in this error:

Msg 20026, Level 11, State 1, Procedure sp_MSrepl_droppublication, Line 146

The publication 'Freescale merge publication v031414' does not exist.

attempting to remove it using the following:

EXEC

sp_replicationdboption'FREESCALE','publish','false'

results in the following error:

Msg 20029, Level 16, State 1, Procedure sp_MSpublishdb, Line 58

The Distributor has not been installed correctly. Could not disable database for publishing

Looking at the properties of the distributor gives no clue to what's wrong.

I've tried to drop the subscribers but with similar results. using the delete from the object explorer menu gives the error about not finding some unspecified stored procedure, using the script:

EXEC sp_dropsubscription @publication = N'Freescale merge publication v031414', @article = N'all',
 @subscriber = N'db-j.freescale',
  @ignore_distributor = ignore_distributor

and results in this error:

Msg 8114, Level 16, State 5, Procedure sp_dropsubscription, Line 0

Error converting data type nvarchar to bit.

I've also tried the suggestion from this posting: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/56f4dccb-fd88-40d8-8428-f7c6a48fbafe/unable-to-disable-publishing-and-distribution?forum=sqlreplication

witout success.

Anyone have some ideas on how I can get his cleaned up?


Developer Frog Haven Enterprises



Replicated database deadlocks.

$
0
0

We have a production database that sits on server1.

This database has transactional replication. There is a replicated database that sits on server2. On server2 there are other databases that READ from the replicated database.

Our admins have noticed that there are deadlocks getting created in the replicated database. So the developers have requested for a second replicated instances. This request has been turned down with a note - Another replicated instance would put a load on the production database that sits on sqlserver1.

How do you collect stats to prove or disprove this statement?

This is SQL Server 2008 (not R2)

Changing two publications at the same time causes deadlock in distribution database

$
0
0

I have transactional replication setup.  Let's say three databases on server A replicate to corresponding three databases on Server B.  The databases are identical (same structure for different clients).  Server B also acts as a distributor.  Everything is working fine.  Now I need to change one of the tables (which is also a publication article).  I need to do it in all databases at the same time.  I follow this process (it is scripted):


    This is where I run into deadlocks.  The deadlock takes place in the distribution database when this stored procedure is executed: sp_MSdrop_subscription.  I don't call this procedure directly, but apparently it gets executed when I run sp_dropsubscription (see step #1 above).  Once again, I modify all publication databases at the same time
    and they all use the same distribution database, so this is where the problem lies.  The two conflicting statements are captured by the deadlock trace (1222) and apparently come from inside sp_MSdrop_subscription. 

    First connection runs:

    if not exists (select * from dbo.MSsubscriptions    where
    publisher_id = @publisher_id and
    publisher_db = @publisher_db and
    (publication_id = @publication_id or @publication_id is NULL or @independent_agent = 0 ) and
    independent_agent = @independent_agent and
    subscriber_id = @subscriber_id and
    subscriber_db = @subscriber_db and
    subscription_type = @subscription_type)

    Second connection runs:

    delete from dbo.MSsubscriptions where
    publisher_id = @publisher_id and
    publisher_db = @publisher_db and
    (publication_id = @publication_id or
    @publication_id is NULL) and
    (@article_id is NULL or
    article_id = @article_id) and
    Message
    ((subscriber_id = @subscriber_id and
    (subscriber_db = @subscriber_db or @subscriber_id = @virtual)) or
    -- Delete virtual anonymous subscription
    -- if deleting virtual subscription for a anonymous publication
    (@subscriber_id = @virtual and subscriber_id = @virtual_anonymous))

    and here is the resource list of what's being locked:

    resource-list

    keylock hobtid=72057594039959552 dbid=34
    objectname=distribution.dbo.MSsubscriptions indexname=ucMSsubscriptions
    id=lock13563b300 mode=X associatedObjectId=72057594039959552

    owner-list
    owner id=process2d7241498 mode=X
    waiter-list
    waiter id=process212b58188 mode=S requestType=wait

    keylock hobtid=72057594040025088 dbid=34
    objectname=distribution.dbo.MSsubscriptions indexname=iMSsubscriptions
    id=lock17ff3af80 mode=X associatedObjectId=72057594040025088

    owner-list
    owner id=process212b58188 mode=X
    waiter-list
    waiter id=process2d7241498 mode=U requestType=wait

    I appreciate any pointers on how to avoid this.  The only work-around  I can think of right now is to have separate distribution databases per publication database, but I can't believe that replication doesn't support modifying multiple publishers at the same time.

    Thank you!

    Distribution agent skipping replication commands

    $
    0
    0

    Hi All

    We have transaction replication configured for multiple databases between two servers. The replication configuration is standard, with no custom procedures, all agent profiles are set to default, etc. The only non-standard configuration is that CDC is configured on some of the destination objects. A snapshot publication is also configured, which we will get to later. 


    We've come across a bizarre incident with transactional replication where the distribution agent would just skip a number of replication commands. Initially this was a rare occurrence and we would manually fix the data on the subscriber. The missing data was only occurring for one specific publisher database. Our initial thoughts were that the data was just being deleted by the users of the replicated data. As the occurrence of missing replication data increased we investigated by making use of one of the destination tables that had CDC configured. But we could not find evidence of the missing data being deleted by the users.

    After this we went through all possible reasons why the data would not be replicated to the subscriber, following all suggestions in this article: http://technet.microsoft.com/en-us/library/ms152532(v=sql.105).aspx

    After exhausting all options, we ran a trace on the subscriber, focusing on a single article publication. The trace was setup to return the events SQL:BatchStarting and RPC:Starting. When the distribution agent failed, being unable to update a row that did not exist at the subscriber, the corresponding insert command was found in the distribution database (using sp_browsereplcmds) but not in the trace. We noticed that the distribution agent had in fact skipped few xact_seqno’s. This was occurring for many of the distribution agents.

    Checking the missed xact_seqno’s against  MSrepl_transactions, we noticed that the missed replication commands were always at around 11PM every day. The snapshot replication publication was scheduled to run at this time. The schedule was changed to run daily at 4PM, after which the skipped replication commands occurred at around this time. We have since disabled the snapshot replication job and will be able to determine whether this is the cause tomorrow.

    So I guess my question is, is there a reason why a snapshot publication (presuming this is the cause) would cause a transaction replication distribution agent to skip replication commands?

    Initial snapshot not ready, can I list these subscriptions?

    $
    0
    0

    Hi,

    I am creating a procedure that monitors my replication subscriptions and sends out emails if something is wrong. We have ~150 (transactional replication) subscriptions so manual monitoring is a pain.

    I found a useful procedure that helps,  sp_replmonitorhelpsubscription. My problem is that I can't filter out subscriptions with the following status: "The initial snapshot for publication 'xxx' is not yet available."

    Any way I can list these subscriptions with sql or some nice procedures?

    br/Agust

    Identical Rows causing conflicts

    $
    0
    0

    I have a merge replication job that has a record on the publisher and a record on the subscriber. I am getting a conflict:

    A row insert at 'Publisher.CustomersMasters' could not be propagated to 'Subscriber.CustomersMasters'. This failure can be caused by a constraint violation.  Violation of PRIMARY KEY constraint 'PK_Customers'. Cannot insert duplicate key in object 'dbo.Customers'.

    I have done a union all on the publisher's and the subscriber's record and they are identical in every column.  I have no idea how to fix this.  There are over 1,000 conflicts so far and most of them are just like this one.  I have recently dropped all subscriptions and rebuilt them hoping to get rid of all conflicts.

    We have spent lots of money with outside vendors to help with this but, so far, they are no help at all.


    Steve

    Viewing all 4054 articles
    Browse latest View live




    Latest Images