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

RMO MergePullSubscription.SynchronizationAgent cannot connect to PublisherFailoverPartner

$
0
0

Hi Brandon

I've  posted the problem below also on the forum http://www.sqlservercentral.com/Forums/Topic1601162-1549-1.aspx
but till now we had no respons, Is it possible to have a short look at our problem and provide us some advice how to proceed?

thanks in advance

for test purposes we used the example program from Brandon Williams on this url: http://code.msdn.microsoft.com/SQL-Server-Express-Merge-4e01e119
with as parameters for our testlab servers:
        // Define the server, subscription, publication, and database names.
        string subscriberName = "MORSWV447";
        string subscriptionDbName = "TicketOrdersSub";
        string publisherName = "MORSWV558";
        string publisherFailoverPartnerName = "MORSWV559";
        string publicationName = "TicketOrders";
        string publicationDbName = "TicketOrdersPub";
        //string distributorName = "MORSWV560";

to evaluate DRP scenarios we added the parameter agent.PublisherFailoverPartner = (Mirror server name)

If we do the failover while the program is running (but not replicating) it is working.   

Initializing
Connecting to Publisher 'MORSWV558'
Connecting to mirrored instance of Publisher 'MORSWV559'
Retrieving publication information
Retrieving subscription information.
Uploading data changes to the Publisher
No data needed to be merged.
Downloading data changes to the Subscriber
No data needed to be merged.
Merge completed with no data changes processed.
Done!


If we close and restart the program it can't find the failoverpartner anymore.      

Initializing
Connecting to Publisher 'MORSWV558'
The merge process could not connect to the Publisher 'MORSWV558:TicketOrdersPub'. Check to ensure that the server is running.
The merge process could not connect to the Publisher 'MORSWV558:TicketOrdersPub'. Check to ensure that the server is running.
The process could not access database 'TicketOrdersPub' on server 'MORSWV558'.
Cannot open database "TicketOrdersPub" requested by the login. The login failed.
Login failed for user 'xxx'.
Error: The subscription could not be synchronized. Verify that the subscription has been defined correctly.

InnerException = {"The merge process could not connect to the Publisher '(Primary Principal)PublicationDBName)'. Check to ensure that the server is running."}

What did we do wrong here? or is this a bug in the RMO MergePullSubscription.SynchronizationAgent?

We used for all server Microsoft SQL Server standard Edition 2008 R2 SP2 CU3 on Windows Server 2008 R2 Sp2 - 64 Bit.
By using the cmd line executable replmerge.exe we can use this parameter as expected.

thanks in advance for sorting this out.
Paul


Replication Log Reader stopped unexpectedly

$
0
0

This morning our websites stopped serving pages.  Whilst investigating I notice that the Replication Sql LogReader had stopped running and was reporting the error:

"SubSystem Message - Job 'XXX582060-XXXXX-1' (0x6D6877EFE4F8EA4D930F8C967FE49BE5), step 2 - A time out occurred while waiting for memory resources to execute the query. Rerun the query."

I have restarted the LogReader and it seems to be working fine but I'd really like to get to the bottom of why it stopped in the first place so I can prevent happening in the future.

Any help would be great.

Thanks

Mike


nc2MSmerge_genhistory and c1MSmerge_genhistory causing so many deadlocks

$
0
0

Hi Experts,

I've enabled 1222 trace to capture deadlock events in our database, and understood that more than 200 deadlocks occuring because of the two indexes, which are on MSmerge_genhistory.

when ever the table is getting updated, we are getting timeouts, and slowness. we are using sql server 2008 R2 sp2 on windows server 2008 R2 along. Merge replication with continuous syn we are running. please suggest. is that a good idea to drop these indexes? or any other alternate available?

nc2MSmerge_genhistory and c1MSmerge_genhistory

Thanks in Advance

Vinod Mallolu

Transactional replication triggers disabled after server restart

$
0
0

Hello Everyone,

I have been facing this issue since couple of days. I have configured transactional replication with updatable subscriber in sql server 2008 R2.  It was working fine till date. Recently we are facing an issue where subscriber whenever restarts, one of the table's replication triggers(insert, update and delete) are disabled automatically. We have to manually enable all the triggers for that table. Other tables are working fine. Please help. Thanks in advance.

Regards,

Sai


SQL Server 2012 Merge Replication - Delete operations on Merge Tables now require ALTER TRACE permisson due to Extended Stored Proceedure call master..sp_repl_generateevent. Some Advise would be appreciated.

$
0
0

Hi All,

In reference to http://dba.stackexchange.com/questions/29141/why-do-replication-deletes-require-sysadmin-access

I have the same issue as reported in the above link. The immediate issue has been bypassed in that I have granted ALTER TRACE permission to the main Applications account that does DELETE operations on the tables in question but in all honesty I don't want to grant that access just to bypass the error.

Msg 8189, Level 14, State 10,Procedure sp_repl_generateevent, Line 1
You do not have permission to run 'SP_TRACE_GENERATEEVENT'.

Has anyone else ran into this and come up with a better solution other than biting the bullet and giving all accounts that run DELETE operations on the merge Tables ALTER TRACE permission?

I could try some impersonation within the Replication Triggers to overcome this but of course if the replication is recreated then i would need to manually administrate the trigger code to manage the impersonation so that doesn't seem that practical to me.

Does this mean that its now a requirement for all accounts that run delete operations on Merge replication Tables to have Alter Trace Permission? o.O

Some advice would be greatly appreciated.

Kind regards,

killerchef

Need some help for choosing a replication type

$
0
0

My target is to create a replication process for the following

Please suggest which type of replication is suitable for this architecture


 




replication - questions

$
0
0

hello, I was able to successfully setup snapshot replication as demonstrated in :

http://www.codeproject.com/Articles/715550/SQL-Server-Replication-Step-by-Step

some questions :

1. if subscriptions can be pushed from publisher, why do you need a pull option at all? what is/are the reasons for having the pull option?

2. in the above step by step guide, 3 instances are used. one for publisher, one for subscriber and one for distributor. can we setup snapshot replication with only two instances - with the publisher instance acting as distributor as well?

3. in what practical cases is snapshot replication used?

4. in practical replication environments, is the sql server agent service account normally used for running the snapshot agent? or is a separate user created for this purpose?

appreciate the feedback.






Geo-Replication with SQL Server Standard

$
0
0

What are the options for asynchronous geo-replication in the Standard Edition of SQL Server 2008R2, 2012 and 2014?  We want to make sure that if the primary datacenter gets disabled, that the copy at the secondary datacenter (thousands of miles away) has lost the minimum number of recent transactions.  For that reason, we want to use a technology that constantly streams, instead of something that works in chunks, like log shipping.  Thank you in advance.


Uncaged


Always on along with replication not supported with automatic failover, Why?

$
0
0

I have AG configured along with replication [snapshot, transactional] as of now we have configured AG with manual failover and thinking to change setting to automatic failover but since replication is in picture we can’t do that because Publisher is supported with automatic failover whereas subscriber is supported with manual failover. Not sure why its not supported and if this possible in SQL 2014?


Rahul

merge replication error

$
0
0

Dear All,

today in replication monitor, i got below error and found row difference in publisher and subscriber end.

Error messages:
The Merge Agent failed after detecting that retention-based metadata cleanup has deleted metadata at the Subscriber for changes not yet sent to the Publisher. You must reinitialize the subscription (without upload). (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199401)
Get help: http://help/MSSQL_REPL-2147199401


mastanvali shaik

Identity Management

$
0
0
Hi All,

we are using merge replication on sql server 2008 R2.

Background:
our database is having around 500 tables, replicated. we are getting frequent application crashes because of Identity range completed and allocating new identity ranges (at subscriber database).

we have decided to increase the ranges which are sufficient for at least for an year.

Requirement:
could you help me with a query to get all the tables with current identity ranges (example like 10000 or 20000 etc), and how frequently they are getting new ranges? etc.

basically, what I'm looking is, if a table is having 5000 range, and it has allocated new ranges every week, it means, for an year, 53*5000 is the number which I'm going to assign for the table. to get like this for each table, it will take some good time.

could you please help me with a query for this.

Thanks in Advance

Hetrogenous replication in sql server 2008

$
0
0

I am trying to setup a transaction rpelication between a Oracle publisher (version 10.2) and sql server 2008 sp1 on windows 2008, 64 bit AMD Processor.
I have installed the oracle client 11.0.1 and followed the permissions for the login on the orcale server.
I was able to add the oracle publusher.
I am tryign to create the publication and atricles and i get the following error.


TITLE: Publication Properties
------------------------------

Cannot add article 'CACHE_LEVEL_LU'.

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

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

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

Cannot publish the table 'SAT.CACHE_LEVEL_LU' from the Publisher 'CD15'. Verify connection information and ensure that you can connect to the Publisher through a tool like SQL*PLUS. Ensure that the replication administrative user schema has the required permissions.
Cannot add the Publisher triggers and the article log table to the Oracle Publisher for the article 'CACHE_LEVEL_LU'. Verify connection information and ensure that you can connect to the Publisher through a tool like SQL*PLUS. Ensure that the replication administrative user schema has the required permissions.
Changed database context to 'distribution'.
OLE DB provider "OraOLEDB.ORACLE" for linked server "CD15" returned message "ORA-00936: missing expression
ORA-06512: at "BIA_REPL.HREPL", line 1722
ORA-06512: at line 1".
Error: 7215, Sev: 17, State: 1, Msg: Could not execute statement on remote server 'CD15'. (Microsoft SQL Server, Error: 21790)

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

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

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

Any idea?
Do you guys knwo fi the replication between Oracle and sql works?

thanks
uday

Replication problem with Cumulative Update 1 for SQL Server 2012 SP2

$
0
0

 

Hello,

Last week, I updated my SQL Server 2012 SP1 to SP2 and then Cumulative Update 1.
I did it without any reboot between SP2 and Cumulative Update 1.

Before the update, my replications (Merge and Transactional) were working fine.

After the update - Although data replicate, I get constantly these errors :

- Transactional Replication - Log Reader Agent : 
The last step did not log any message! (Source : MSSQL_REPL, Error number : MSSQL_REPL22037)

- Merge Replication (on all subscribers - All are SQL 2005 Express) : 
The merge process could not perform metadata cleanup by retention in the basis of "DatabaseName" data. If the problem persists, try increasing the query timeout process or reduce the retention period. When solving the problem, restart the synchronization with detailed and specify an output file to write to record history. (Source: MSSQL_REPL, Error Number: MSSQL_REPL-2147199466) 
Get help: http: // help / MSSQL_REPL-2147199466

Conflict of operand types: bigint is incompatible with uniqueidentifier (Source: MSSQLServer, Error number: 206) 
Get help: http: // help / 206 

Conflict of operand types: int is incompatible with uniqueidentifier (Source: MSSQLServer, Error number: 206) 
Get help: http: // help / 206


Also, if I execute the stored procedure : sp_mergemetadataretentioncleanup
I get these errors :
Msg 206, Level 16, State 2, Procedure sp_mergemetadataretentioncleanup, Line 63 
Conflict of operand types: bigint is incompatible with uniqueidentifier 
Msg 206, Level 16, State 2, Procedure sp_mergemetadataretentioncleanup, Line 65 
Conflict of operand types: int is incompatible with uniqueidentifier

Error messages translated from French.

So it seems seems related to this KB article : http://support.microsoft.com/kb/2982019/en-us
It should had been corrected in Cumultative Update 1 but for my case it is not !

To resolve the problem, I tried :

- Uninstalling 2012 SP2 - Cumulative Update 1
Reboot
Start SQL Server (no SQL Agent)
- Uninistalling 2012 SP2
Reboot
Start SQL Server (no SQL Agent)
- Install 2012 SP2
Reboot
Start SQL Server (no SQL Agent)
- Install 2012 SP2 - Cumulative Update 1
Reboot
Start SQL Server (no SQL Agent)
Start SQL Agent

No error during uninstall and install

Everything seems to have worked fine but the problem is still there (SQL is in version 11.0.5532)

So I don't know what to do to correct that except going back to 2012 SP1 but I'm worrying if it's a good idea ?

Does anybody has an idea on how to correct this ?

Thanks for reading and in advance for your help.

Best regards,

Olivier

What purpose does a Master Key serve in a replication topology?

$
0
0

Greetings. I'm on SS 2008. 

While recreating transaction replication from backup to one of our subscribers after a catastrophic even, I came across this in our internal documentation:

--To be ran on the subscriber
--Recreate Master Key since DB was moved:
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'myKey'
ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = 'myKey'
Close Master Key

It worked as expected. I've been doing a lot of testing with encryption/ TDE lately, and am positive this DB doesn't use it. That said, what does this key do/ what purpose does it serve?

The author of the doc has moved on so I can't ask him, but I'd really like to understand the benefit to this if there's no encryption on the DB.

Thanks!


TIA, ChrisRDBA

SQL server 2005 Job Result View Problem

$
0
0

Hi All,

We have SQL server 2005 and SQL server 2008 servers. 

we are facing problem for SQL server job result. We can able to see Maintenance Plan job results but we cant  See same maintenance plan Job's in SQL server Agent. Its showing result 0.

Kindly some one give me resolution.


system managed replication not adjusting identity range

$
0
0

I have a strange problem with SQL Server merge replication (push), the publisher is SQL Server 2008 R2 and the sub scriber is 2000. This has been working without any issues for several days, then rows stopped getting inserted into one of the published tables at the subscriber end.

Checking the primary key column on the published table revealed that its seed value had been adjusted but the repl constraint on had not, a simple call to sp_adjustpublisheridentityrange resolved the issue. 

Based on this I have two questions:-

1. sp_adjustpublisheridentityrange should have been called automatically (by the merge agent ?), are there any "Usual suspects" in terms of reasons for why this might not have happened ?.

2. Is there any way via any via a view / table I can check whether the identity value and the constraint are not in 'sync', so to speak ?, other than to parse the INFORMATION_SCHEMA.CHECK_CONSTRAINTS VIEW.

Identity range management issue in SQL server replication

$
0
0

Hello all,

I have a transactional replication with updatable subscription setup with 1 publisher, 1 distributor and 4 subscribers. All are SQL 2008 servers. From last few days I am facing lot of issues with automatic identity range allocations. Somehow SQL server is not allocating new ranges causing the inserts to fail at publishers and subscribers.

Could someone please let me know how to fix automatic identity range management issue and when this issue occurs.

Manual Cleanup for Change Tracking

$
0
0
How do you manually do a clean up for change tracking (ie: autocleanup is set to false) in SQL Server 2008?

Replication and High Availability in Azure - is it possible?

$
0
0

Hi SQL Gurus,

Our application utilises one-way transactional replication to move master data between databases. There is also a need for HA for this application. Currently on-premise we use SQL failover clusters to achieve this. We are now looking at Azure for hosting our application (as SQL2014 installed on IaaS) and have run into a hurdle.

For SQL HA in Azure, the option is to use AlwaysOn which we're perfectly comfortable with (unless we opt for a simulated FCI such as documented in http://msdn.microsoft.com/en-us/library/dn673536.aspx). According to BOL, AlwaysOn fully supports Subscribers and Publishers.. however not Distributor (see http://msdn.microsoft.com/en-us/library/hh403414.aspx).

So my question is - what options do we have for high availability for replication in Azure (the distributor in particular)?

Feel free to move this question to the Azure forums if need be.

Kind Regards,

Chris

XDESTSVERMGR

$
0
0

Hi,
I have a cluster with 3 nodes: one Primary and two Secondaries. Two nodes have the same configuration (cpu, memory, sql server configurations) and they are used as primary (SQL1) and the first secondary (SQL2). When SQL2 is primary the server responds very good, instead when SQL1 is primary the response times are 2-10 times greater. I checked the wait times. In top, on the first position is a wait type named XDESTSVERMGR. The query associated with this wait type is bellow. 
Could I have some documentation (link, pdf) or could you explain me what means: XDESTSVERMGR, which kind of operations are the cause of this wait type?

Thank you

--(@_msparam_0 nvarchar(4000))  
SELECT *  
INTO #tmpag_availability_groups  
FROM master.sys.availability_groups  
SELECT group_id,  
   replica_id,  
   replica_server_name, 
   create_date,  
   modify_date,  
   endpoint_url,  
   read_only_routing_url,  
   primary_role_allow_connections,  
   secondary_role_allow_connections,  
   availability_mode, 
   failover_mode,  
   session_timeout,  
   backup_priority,  
   owner_sid  
INTO #tmpar_availability_replicas  
FROM master.sys.availability_replicas 
/* BEGIN ACTIVE SECTION (inserted by Ignite) */  
SELECT group_id,  
   replica_id,  
   role, 
   operational_state, 
   recovery_health, 
   synchronization_health, 
   connected_state,  
   last_connect_error_number, 
   last_connect_error_description,  
   last_connect_error_timestamp  
INTO #tmpar_availability_replica_states  
FROM master.sys.dm_hadr_availability_replica_states 
/* END ACTIVE SECTION (inserted by Ignite) */  
SELECT replica_id, 
   join_state  
INTO #tmpar_availability_replica_cluster_states  
FROM master.sys.dm_hadr_availability_replica_cluster_states  
SELECT arrc.replica_server_name,  
   COUNT(cm.member_name) AS node_count,  
   SUM(cm.member_state) AS member_state_sum,  
   SUM(cm.number_of_quorum_votes) AS quorum_vote_sum  
INTO #tmpar_availability_replica_cluster_info  
FROM  
   ( 
   SELECT DISTINCT replica_server_name,  
      node_name  
   FROM master.sys.dm_hadr_availability_replica_cluster_nodes 
   ) AS arrc  
LEFT OUTER JOIN master.sys.dm_hadr_cluster_members AS cm  
ON UPPER(arrc.node_name) = UPPER(cm.member_name)  
GROUP BY arrc.replica_server_name  
SELECT *  
INTO #tmpar_ags  
FROM master.sys.dm_hadr_availability_group_states  
SELECT ar.group_id,  
   ar.replica_id,  
   ar.replica_server_name,  
   ar.availability_mode, ( 
   CASE  
      WHEN UPPER(ags.primary_replica) = UPPER(ar.replica_server_name) THEN 1  
      ELSE 0  
   END) as role,  
   ars.synchronization_health  
INTO #tmpar_availabilty_mode  
FROM #tmpar_availability_replicas as ar  
LEFT JOIN #tmpar_ags as ags  
ON ags.group_id = ar.group_id  
LEFT JOIN #tmpar_availability_replica_states as ars  
ON ar.group_id = ars.group_id  
AND ar.replica_id = ars.replica_id  
SELECT am1.replica_id,  
   am1.role, ( 
   CASE  
      WHEN (am1.synchronization_health is null) THEN 3  
      ELSE am1.synchronization_health  
   END) as sync_state, ( 
   CASE  
      WHEN (am1.availability_mode is NULL)  
      OR (am3.availability_mode is NULL) THEN null  
      WHEN (am1.role = 1)                THEN 1  
      WHEN (am1.availability_mode = 0  
      OR am3.availability_mode = 0) THEN 0  
      ELSE 1  
   END) as effective_availability_mode  
INTO #tmpar_replica_rollupstate  
FROM #tmpar_availabilty_mode as am1  
LEFT JOIN  
   ( 
   SELECT group_id,  
      role,  
      availability_mode  
   FROM #tmpar_availabilty_mode as am2  
   WHERE am2.role = 1 
   ) as am3  
ON am1.group_id = am3.group_id  
DROP table #tmpar_availabilty_mode  
DROP table #tmpar_ags  
SELECT AR.replica_server_name AS [Name],  
   ISNULL(AR.availability_mode, 2) AS [AvailabilityMode],  
   ISNULL(AR.backup_priority, -1) AS [BackupPriority],  
   ISNULL(AR.primary_role_allow_connections, 4) AS [ConnectionModeInPrimaryRole],  
   ISNULL(AR.secondary_role_allow_connections, 3) AS [ConnectionModeInSecondaryRole],  
   ISNULL(arstates.connected_state, 2) AS [ConnectionState],  
   ISNULL(AR.create_date, 0) AS [CreateDate],  
   ISNULL(AR.modify_date, 0) AS [DateLastModified],  
   ISNULL(AR.endpoint_url, N'') AS [EndpointUrl],  
   ISNULL(AR.failover_mode, 2) AS [FailoverMode],  
   ISNULL(arcs.join_state, 99) AS [JoinState],  
   ISNULL(arstates.last_connect_error_description, N'') AS [LastConnectErrorDescription],  
   ISNULL(arstates.last_connect_error_number,-1) AS [LastConnectErrorNumber],  
   ISNULL(arstates.last_connect_error_timestamp, 0) AS [LastConnectErrorTimestamp],   
   CASE  
      WHEN arci.member_state_sum IS NULL  
      OR arci.node_count = 0                       THEN 3  
      WHEN arci.member_state_sum = 0               THEN 0  
      WHEN arci.member_state_sum < arci.node_count THEN 2  
      WHEN arci.member_state_sum = arci.node_count THEN 1  
      ELSE 3  
   END AS [MemberState],  
   ISNULL(arstates.operational_state, 6) AS [OperationalState],  
   suser_sname(AR.owner_sid) AS [Owner],  
   ISNULL(arci.quorum_vote_sum, -1) AS [QuorumVoteCount],  
   ISNULL(AR.read_only_routing_url, '') AS [ReadonlyRoutingConnectionUrl],  
   ISNULL(arstates.role, 3) AS [Role],  
   ISNULL(arstates.recovery_health, 2) AS [RollupRecoveryState], ( 
   CASE  
      WHEN arrollupstates.sync_state = 3 THEN 3  
      WHEN (arrollupstates.effective_availability_mode = 1  
      OR arrollupstates.role = 1)        THEN arrollupstates.sync_state  
      WHEN arrollupstates.sync_state = 2 THEN 1  
      ELSE 0  
   END) AS [RollupSynchronizationState],  
   ISNULL(AR.session_timeout, -1) AS [SessionTimeout],  
   AR.replica_id AS [UniqueId]  
FROM #tmpag_availability_groups AS AG  
INNER JOIN #tmpar_availability_replicas AS AR  
ON (AR.replica_server_name IS NOT NULL)  
AND (AR.group_id=AG.group_id)  
LEFT OUTER JOIN #tmpar_availability_replica_states AS arstates  
ON AR.replica_id = arstates.replica_id  
LEFT OUTER JOIN #tmpar_availability_replica_cluster_states AS arcs  
ON AR.replica_id = arcs.replica_id  
LEFT OUTER JOIN #tmpar_availability_replica_cluster_info AS arci  
ON UPPER(AR.replica_server_name) = UPPER(arci.replica_server_name)  
LEFT OUTER JOIN #tmpar_replica_rollupstate AS arrollupstates  
ON AR.replica_id = arrollupstates.replica_id  
--WHERE (AG.name=@_msparam_0)  
ORDER BY [Name] ASC   
DROP TABLE #tmpar_availability_replicas  
DROP TABLE #tmpar_availability_replica_states  
DROP TABLE #tmpar_availability_replica_cluster_states  
DROP TABLE #tmpar_availability_replica_cluster_info  
DROP TABLE #tmpar_replica_rollupstate  
DROP table #tmpag_availability_groups 

Viewing all 4054 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>