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

Prerequisites or requirement for configuring transaction replication.

$
0
0

Hi All,

What are the requirements for setting up Transactional Replication,

Server Configuration details ?

Connectivity ?

Can it is possible to create a replication by using only distributor database or without creating publisher ?

Scenario :- SERVER A ----Publisher , SERVER B---Distributor + Subscriber , Server C---Subscriber , can I add a 4th Server i:e SERVER D only using SERVER B i:e Distributor.  

  


Primary Key Violation at the time of Moving from primary range to secondary range.

$
0
0
Hi Experts,

I've observed a strange issue in our environment.
we are using sql server 2008 R2 with SP2.

whenever a table is moving from primary range to secondary range on it's identity values, application is getting crashed with the message as below. 

Violation of PRIMARY KEY constraint 'PK6'. Cannot insert duplicate key in object 'dbo.TD_TRANN'. The duplicate key value is (17868679).
The statement has been terminated.

OR

Violation of UNIQUE KEY constraint 'IX_TDS_COST'. Cannot insert duplicate key in object 'dbo.TDS_COST'. The duplicate key value is (17, 19431201).

identity ranges were auto managed by replication. agents are running continuous.

please suggest.

Cheers, Vinod Mallolu

Transaction replication blocking

$
0
0

Hello,

I am seeing that transaction replication inserts are causing a lot of blocking in the subscriber database. The blocked statements are select statements. Does Transaction replication lock tables when it inserts?Can this blocking be prevented?

Thanks

how to check whether the current snapshot is validated?

$
0
0

I have removed some articles of my publication in transactional replication. I use the script below, and contrary to what I have found in documentation, it does not invalidate the snapshot of that publication.

I normally test this by running the snapshot agent, which, after about 12 seconds, tells me that there is no need to run a full snapshot.

How can I test whether the snapshot is good, without running it?

I don't want to run it, because if it is not good, I don't want to stop it in the middle, and I don't want to run it during the office hours.

thanks and regards

Marcelo

-- the script to remove an article from the replication is: (1) and (2) below:
-- to be run at the publisher (in this case SERVER MYSERVER - DATABASE MYDATABASE
-- (1)
--use [MYDATABASE]
--exec sp_dropsubscription @publication = N'MYPUBLICATION', @article = N'tblTaxTransaction', @subscriber = N'all', @destination_db = N'all'
--GO

-- (2)
--use [MYDATABASE]
--exec sp_droparticle @publication = N'MYPUBLICATION', @article = N'tblTaxTransaction', @force_invalidate_snapshot = 1
--GO



--[ @force_invalidate_snapshot = ] force_invalidate_snapshot
--Acknowledges that the action taken by this stored procedure may invalidate an existing snapshot. 
--force_invalidate_snapshot is a bit, with a default of 0.
--0 specifies that changes to the article do not cause the snapshot to be invalid. 
--If the stored procedure detects that the change does require a new snapshot, an error occurs 
--and no changes are made.

--1 specifies that changes to the article may cause the snapshot to be invalid, 
--and if there are existing subscriptions that would require a new snapshot, 
--gives permission for the existing snapshot to be marked as obsolete and a new snapshot generated.


Refreshing a replicated database

$
0
0

how do you refresh a replicated db?

let us suppose the primary and replicate databases have gone out of sync.

so now I want to resync the data from the primary to replicated db.

appreciate the feedback.

DR Design for Tx Replication

$
0
0

Hello,

I am using SQL 2012 SE and I have transaction replication setup with publisher, subscriber and distributor in one server in an Active Passive cluster environment. 

If publisher goes down then I will have to rely on my full backup+all txlog backups and restart the entire replication.

If subscriber goes down then I will still have to restart the entire replication. The problem is replication is taking between 4 to 6 hours in our scenario and we want to avoid this down time. In the event of publisher/subscriber database goes down what is the best way to have applications/users connected to our database and still perform normal operations without me restoring backups and setting up replication?

Experts need your valuable design thoughts.

Thanks a ton.

Merge Replication issue - Unable to Perform DML operations. pls help

$
0
0
hi all,

we are getting below error msg in our Merge Replication in test environment.

its a simple DML query we used but getting the error -

Msg 207, Level 16, State 1, Procedure MSmerge_upd_21024DDE15DE4737BC61FC280B5A2DAA, Line 118
Invalid column name 'HOST_NAME_FN'.
Msg 4406, Level 16, State 1, Procedure MSmerge_upd_21024DDE15DE4737BC61FC280B5A2DAA, Line 116
Update or insert of view or function 'MSmerge_ppmv_21024DDE15DE4737BC61FC280B5A2DAA' failed because it contains a derived or constant field.

Details:

MSSQL server 2008 R2 with Replication (Push Publication).

we have sa rights, we have same set up in test/production environment .but not sure why we are getting the error.
can someone please help in this?

Replication taking longer time to apply command on subscriber

$
0
0

I am using transaction replication In my Environment. 
Question: At the time when batches completed from Application team, daily it will take  5  to 10min to apply all commands to replicated database, but from last one weak it is taking 2 to 3 and half hour.
Can anybody suggest what might be the reason and solution ?

Resone I think 
There are more indexes on replicated databae than Production
In Replicated mdf and ldf files are both on same serveranything else ? 


Environment on both servers prod as well as replicated
__________________________

SQL Server 2008 r2 Standard
Windows server 2008r2 enterprise
CPU 64 (Hyper threading Enable)
64 GB Memory


sp_addscriptexec is not working with FTP Snapshot delivery

$
0
0

Hi,

We have a SQL Server Merge Replication topology. Both Publisher a Subscribers are using SQL Server 2012.

As I have seen in http://msdn.microsoft.com/en-us/library/ms174360(v=sql.120).aspx

"Using sp_addscriptexec to post a script file for publications using FTP for snapshot delivery is only supported for Microsoft SQL Server Subscribers."

So we should be OK...

The problem is that the Merge Agent is looking for the Script in the local PC instead of download it form theFTP Server.

Here is the Code at the publisher:

exec sp_addscriptexec 'IPoint_Pub','C:\IPoint_Files\ReplicationScripts\User\reIndex.sql'

This is how the subscription was created:

use IPoint
exec sp_addmergepullsubscription @publisher = @Central_Server_Name, @publication = N'IPoint_Pub', @publisher_db = @MGR_DB, @subscriber_type = N'Local', @subscription_priority = 0, @description = N'', @sync_type = N'Automatic'

exec sp_addmergepullsubscription_agent 
 @publisher = @Central_Server_Name,
 @publisher_db = @MGR_DB,
 @publication = N'IPoint_Pub', 
 @distributor = @Central_Server_Name, 
 @distributor_security_mode = 0, @distributor_login = 'XXX', @distributor_password = 'XXX', 
 @enabled_for_syncmgr = N'True', 
 @frequency_type = 4, @frequency_interval = 1, @frequency_relative_interval = 1, @frequency_recurrence_factor = 1, @frequency_subday = 4, @frequency_subday_interval = 3, @active_start_time_of_day = 0, @active_end_time_of_day = 235959, @active_start_date = 20100527, @active_end_date = 99991231,
 @alt_snapshot_folder = N'', @working_directory = N'', 
 @use_ftp = N'True',
 @job_login = null, @job_password = null, 
 @publisher_security_mode = 0, @publisher_login = 'XXX',  @publisher_password = 'XXX',
 @use_interactive_resolver = N'False', @dynamic_snapshot_location = null, @use_web_sync = 0,
 @hostname =@SUCURSAL_ID
GO

And the log of the REPLMERG.EX

2014-03-29 13:01:49.009 Microsoft SQL Server Merge Agent 11.0.2100.60
2014-03-29 13:01:49.009 Copyright (c) 2008 Microsoft Corporation
2014-03-29 13:01:49.009 
2014-03-29 13:01:49.009 The timestamps prepended to the output lines are expressed in terms of UTC time.
2014-03-29 13:01:49.009 User-specified agent parameter values:
			-Publication Netul_Pub
			-Publisher SRV01
			-Subscriber NETUL-01\SQLEXPRESS
			-Distributor SRV01
			-PublisherDB IPoint_Netul
			-SubscriberDB IPoint
			-SubscriptionType 1
			-ParallelUploadDownload 1
			-DistributorLogin sucursal
			-DistributorPassword **********
			-DistributorSecurityMode 0
			-PublisherLogin sucursal
			-PublisherPassword **********
			-PublisherSecurityMode 0
			-SubscriberSecurityMode 1
			-OutputVerboseLevel 1
			-Validate 0
2014-03-29 13:01:49.019 Connecting to Subscriber 'NETUL-01\SQLEXPRESS'
2014-03-29 13:01:50.654 Connecting to Distributor 'SRV01'
2014-03-29 13:01:51.599 Initializing
2014-03-29 13:01:51.604 Validating publisher
2014-03-29 13:01:51.614 Connecting to Publisher 'SRV01'
2014-03-29 13:01:51.769 Retrieving publication information
2014-03-29 13:01:51.774 Retrieving subscription information.
2014-03-29 13:01:52.294 Connecting to Subscriber 'NETUL-01\SQLEXPRESS'
2014-03-29 13:01:52.304 Connecting to Distributor 'SRV01'
2014-03-29 13:01:52.414 Initializing
2014-03-29 13:01:52.429 Validating publisher
2014-03-29 13:01:52.439 Connecting to Publisher 'SRV01'
2014-03-29 13:01:52.604 Retrieving publication information
2014-03-29 13:01:52.619 Retrieving subscription information.
2014-03-29 13:01:53.274 [29%] [0 sec remaining] Snapshot files will be downloaded via ftp
2014-03-29 13:01:53.284 [29%] [0 sec remaining] Snapshot will be applied from a compressed cabinet file
2014-03-29 13:01:53.294 [29%] [0 sec remaining] Connecting to ftp site 'SRV01.real2b.com'
2014-03-29 13:01:55.019 [33%] [2 sec remaining] Extracting snapshot file 'Documento_Formc3f5d2f9_190.sch' from cabinet file
2014-03-29 13:01:55.064 [33%] [2 sec remaining] Extracted file 'Documento_Formc3f5d2f9_190.sch'
2014-03-29 13:01:57.299 [33%] [2 sec remaining] Applied script 'Documento_Formc3f5d2f9_190.sch'
2014-03-29 13:01:57.304 [33%] [2 sec remaining] Preparing table 'Documento_Formulario_Otros' for merge replication
2014-03-29 13:02:02.574 [51%] [8 sec remaining] Extracting snapshot file 'sysmergesubsetfilters_Documento_Formulario_Otros90.bcp' from cabinet file
2014-03-29 13:02:02.594 [51%] [8 sec remaining] Extracted file 'sysmergesubsetfilters_Documento_Formulario_Otros90.bcp'
2014-03-29 13:02:02.604 [55%] [7 sec remaining] Bulk copying data into table 'sysmergesubsetfilters'
2014-03-29 13:02:02.609 [55%] [7 sec remaining] Bulk copied data into table 'sysmergesubsetfilters' (0 rows)
2014-03-29 13:02:02.619 [55%] [7 sec remaining] Extracting snapshot file 'Documento_Formc3f5d2f9_190.dri' from cabinet file
2014-03-29 13:02:02.624 [55%] [7 sec remaining] Extracted file 'Documento_Formc3f5d2f9_190.dri'
2014-03-29 13:02:02.864 [55%] [7 sec remaining] Applied script 'Documento_Formc3f5d2f9_190.dri'
2014-03-29 13:02:02.874 [59%] [6 sec remaining] Extracting snapshot file 'Documento_Formc3f5d2f9_190.trg' from cabinet file
2014-03-29 13:02:02.884 [59%] [6 sec remaining] Extracted file 'Documento_Formc3f5d2f9_190.trg'
2014-03-29 13:02:02.889 [62%] [5 sec remaining] Applied script 'Documento_Formc3f5d2f9_190.trg'
2014-03-29 13:02:02.899 [62%] [5 sec remaining] Extracting snapshot file 'Documento_Formc3f5d2f9_190.prc' from cabinet file
2014-03-29 13:02:02.919 [62%] [5 sec remaining] Extracted file 'Documento_Formc3f5d2f9_190.prc'
2014-03-29 13:02:03.819 [62%] [5 sec remaining] Applied script 'Documento_Formc3f5d2f9_190.prc'
2014-03-29 13:02:09.334 [74%] [5 sec remaining] Launching sqlcmd to apply the script 'Create_Categorias_Tables.sql'
2014-03-29 13:02:09.974 [74%] [5 sec remaining] Applied script 'Create_Categorias_Tables.sql'
2014-03-29 13:02:09.979 [77%] [4 sec remaining] Launching sqlcmd to apply the script 'Create_Categorias_Tables.sql'
2014-03-29 13:02:10.144 [77%] [4 sec remaining] Applied script 'Create_Categorias_Tables.sql'
2014-03-29 13:02:10.174 [81%] [3 sec remaining] Launching sqlcmd to apply the script 'reIndex.sql'
2014-03-29 13:02:10.189 [81%] [3 sec remaining] Last 115 characters in 'sqlcmd' output buffer: Sqlcmd: 'C:\inetpub\ftproot\ReplData\ftp\SRV01_IPOINT_NETUL_NETUL_PUB\UserScripts\reIndex.sql': Invalid filename.

2014-03-29 13:02:10.194 [81%] [3 sec remaining] Failed to apply the script 'reIndex.sql' using the 'sqlcmd' utility.
2014-03-29 13:02:10.204 The schema script 'reIndex.sql' could not be propagated to the subscriber.
2014-03-29 13:02:10.254 Category:NULL
Source:  Merge Replication Provider
Number:  -2147201001
Message: The schema script 'reIndex.sql' could not be propagated to the subscriber.
2014-03-29 13:02:10.259 [100%] The process was successfully stopped.
2014-03-29 13:02:10.299 Category:NULL
Source:  Merge Replication Provider
Number:  -2147200963
Message: The process was successfully stopped.

As you can see, the FTP snapshot is working fine 

"Extracted Documento_Formc3f5d2f9_190.trg"

But the it is looking for a file that only exists in the server.

'C:\inetpub\ftproot\ReplData\ftp\SRV01_IPOINT_NETUL_NETUL_PUB\UserScripts\reIndex.sql'

Do you have any idea?



Best Regards, Daniel.



Does specified lsn should greater than or less than min_autonosync_lsn when setting up a "initialize from lsn" subscription?

$
0
0
Hello,

For setting up a "initialize from lsn" type subscription successfully, Does the lsn for @subscriptionlsn parameter need greater than or less than the  min_autonosync_lsn (syspublications) ?

I read two versions of this: one is lsn >min_autonosync_lsn ,the other is lsn <min_autonosync_lsn. I agree lsn >min_autonosync_lsn.

Thanks

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

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.

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?

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 


Prerequisites or requirement for configuring transaction replication.

$
0
0

Hi All,

What are the requirements for setting up Transactional Replication,

Server Configuration details ?

Connectivity ?

Can it is possible to create a replication by using only distributor database or without creating publisher ?

Scenario :- SERVER A ----Publisher , SERVER B---Distributor + Subscriber , Server C---Subscriber , can I add a 4th Server i:e SERVER D only using SERVER B i:e Distributor.  

  

Primary Key Violation at the time of Moving from primary range to secondary range.

$
0
0
Hi Experts,

I've observed a strange issue in our environment.
we are using sql server 2008 R2 with SP2.

whenever a table is moving from primary range to secondary range on it's identity values, application is getting crashed with the message as below. 

Violation of PRIMARY KEY constraint 'PK6'. Cannot insert duplicate key in object 'dbo.TD_TRANN'. The duplicate key value is (17868679).
The statement has been terminated.

OR

Violation of UNIQUE KEY constraint 'IX_TDS_COST'. Cannot insert duplicate key in object 'dbo.TDS_COST'. The duplicate key value is (17, 19431201).

identity ranges were auto managed by replication. agents are running continuous.

please suggest.

Cheers, Vinod Mallolu

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.






Refreshing a replicated database

$
0
0

how do you refresh a replicated db?

let us suppose the primary and replicate databases have gone out of sync.

so now I want to resync the data from the primary to replicated db.

appreciate the feedback.

Transaction replication blocking

$
0
0

Hello,

I am seeing that transaction replication inserts are causing a lot of blocking in the subscriber database. The blocked statements are select statements. Does Transaction replication lock tables when it inserts?Can this blocking be prevented?

Thanks

Viewing all 4054 articles
Browse latest View live




Latest Images