Showing posts with label Replication. Show all posts
Showing posts with label Replication. Show all posts

Friday, November 26, 2010

Some changes are not replicated to the subscribers on Transactional Replication SQL Server 2005

You can insert the deleted row in the subscriber database( if you have a backup of table)

Then start the replication agent , It will fix the problem.
http://support.microsoft.com/kb/954054

Thursday, November 25, 2010

Replication in SQL Server

Replication is one of typical functionality in SQL Server. Basically Replication lets you to copying and distributing data and database objects like table, stored procedure, view and UDF to one publisher database to multiple subscription database/server on different location.


There are three types of replication

1. Snapshot
2. Transactional
3. Merge.

Replication need a special database called distribution to copying data to another server.
Main components in Replication

Distributor : Main functionality is distributing data between Publisher and Subscriber.

Publisher : Publisher is main Database Server which has database to replicating data to subscriber
You can create many publications from Publisher. There is limit for publishing articles. Maximum number of articles can be published under one publication is 256.

Subscriber : Always receiving data from publisher and in merge replication subscriber also sending back data changes to publisher

Articles : Articles nothing but Tables

There are five agents are there

1. Snapshot agent
2. Log Reader agent
3. Queue Reader agent
4. Distribution agent
5. Merge agent

Thursday, October 14, 2010

Check the Merge Replication Generation by date wise

select convert(varchar(12),coldate)as Dates , count(*) as generation
from MSmerge_genhistory (nolock)
where year(convert(varchar(12),coldate))= '2010'
group by convert(varchar(12),coldate)
order by convert(varchar(12),coldate)

Tuesday, October 12, 2010

Monitor Replication in SQL 2005

The following list of sps really useful to get more information from distribution database to monitor replication.

use distribution

go
select * from MSPublisher_databases
Sp_browsereplcmds
sp_MSenum_snapshot
sp_MSenum_logreader
sp_MSenum_distribution
sp_MSenum_qreader

Check Merge Replication Confilicts 2005

CREATE PROCEDURE [dbo].[DBA_MonitorMergeConflicts]
AS
/****************************************************
Purpose : Check Merge Replication Confilicts and send
an email notification to DBA
*****************************************************/
SET NOCOUNT ON
Declare @iCnt int
Select @iCnt = count(*) from NorthWind.dbo.MSmerge_conflicts_info
--Print @iCnt


If @iCnt > 0
Begin
 EXEC msdb.dbo.sp_notify_operator
 @profile_name = N'DBAMail',
 @name = N'dba',
 @subject = N'Merge Conflicts Notification',
 @body = N'There are Merge Replication Conflicts Please check the  View Conflicts to Resolve' ;
End


Friday, October 08, 2010

The merge process was unable to deliver the snapshot to the Subscriber



C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\ReplData

Solution : Change default snapshot folder settings to full qualified network name
\\SRVSQL001\C$\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\ReplData

Remove Distribution Database

-- In SQL 2005
exec sp_dropdistributor @no_checks =1, @ignore_distributor = 1;

go

Find Replicated Database

--SQL 2005/2008
sp_helpreplicationdboption


--SQL 2000
select name, databasepropertyex (name,'IsMergePublished') from
master..sysdatabases
select name, databasepropertyex (name,'IsPublished') from
master..sysdatabases

Thursday, June 10, 2010

Setting up new subscription for Merge Publication Server

Setting up new subscription for Merge Publication Server in SQL 2000

Issue : Schema Definition of base Table at Subscriber Does Not Match with Table in Publisher Database




Solutions:
1. Check the table structure of the Publisher database and Subscriber database are same.