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

Speed of merge replication

$
0
0

 


I am using SQLMERGXLib.SQLMerge to do a merge.Basicaly there are three steps.

 

           SQLMerge .Initialize()
 
           SQLMerge .Run()
 
           SQLMerge .Terminate()

 

I display the progress bar and status as the merge is running.But the first 20% of the progress bar takes up about 80% of the total processing time.

Is there any way of finding out exactly what is happening at this point.

Is there anything I can tailor so that the replication will speed up.On average I have 8000 datachanges a day which results in 6MB of data transfer on the network.The replication usually takes more than ten minutes.

I badly need to improve performance.....


The process could not connect to Subscriber- replication

$
0
0

Folks, I'm having trouble setting up replication from a server hosted outside our domain that is hosted in south Dakota to a virtual box in our domain hosted locally here in Ohio.below is the error message I copied from replication monitor subscription status details: Error messages: The process could not connect to Subscriber 'xxx.x.x.00'. (Source: MSSQL_REPL, Error number: MSSQL_REPL0)

Does anyone give me some pointers on how to resolve this issue? Thanks.

BusinessLogicModule - How to debug in VS??

$
0
0

I have followed the instructions listed in this https://msdn.microsoft.com/en-us/library/ms365150.aspx MSDN article but cannot get it working.  Can anyone shed some light on how to debug?  I have insalled VS 2015 on the subscriber and have the DLL dropped into the C:\Program Files\Microsoft SQL Server\120\COM folder.  I have my code listed below

    public class ReplicationBusinessLogicModule : BusinessLogicModule
    {
        private string _PublisherName;
        private string _SubscriberName;
        private string _ArticleName;
        private string _ReplicationTime;

        public ReplicationBusinessLogicModule()
        {
            var sb = new StringBuilder();
            sb.AppendLine("-------------------------------------");
            sb.AppendLine("In ReplicationBusinessLogicModule: " + DateTime.Now);
            sb.AppendLine("-------------------------------------");
            sb.AppendLine();
            System.IO.File.AppendAllText(@"C:\Temp\ReplicationBusinessLogicModule.txt", sb.ToString());
        }

        public override void Initialize(string publisher, string subscriber, string distributor, string publisherDB, string subscriberDB, string articleName)
        {
            _PublisherName = publisher;
            _SubscriberName = subscriber;
            _ArticleName = articleName;
            _ReplicationTime = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fffffff", CultureInfo.InvariantCulture);

            var sb = new StringBuilder();
            sb.AppendLine("-------------------------------------");
            sb.AppendLine("In Initialize: " + DateTime.Now);
            sb.AppendLine("ArticleName: " + _ArticleName);
            sb.AppendLine("-------------------------------------");
            sb.AppendLine();
            System.IO.File.AppendAllText(@"C:\Temp\ReplicationBusinessLogicModule.txt", sb.ToString());

        }

        public override ChangeStates HandledChangeStates
        {
            get
            {
                return ChangeStates.SubscriberInserts | ChangeStates.SubscriberUpdates | ChangeStates.SubscriberDeletes | ChangeStates.UpdateConflicts |
                    ChangeStates.PublisherInserts | ChangeStates.PublisherUpdates | ChangeStates.PublisherDeletes;
            }
        }

        public override void CommitHandler(SourceIdentifier source, Guid rowGuid)
        {
            var sb = new StringBuilder();
            sb.AppendLine("-------------------------------------");
            sb.AppendLine("In CommitHandler: " + DateTime.Now);
            sb.AppendLine("Source: " + source.ToString());
            sb.AppendLine("ArticleName: " + _ArticleName);
            sb.AppendLine("RowGuid: " + rowGuid.ToString());
            sb.AppendLine("-------------------------------------");
            System.IO.File.AppendAllText(@"C:\Temp\ReplicationBusinessLogicModule.txt", sb.ToString());

            base.CommitHandler(source, rowGuid);
        }

        public override ActionOnDataChange InsertHandler(SourceIdentifier insertSource, DataSet insertedDataSet, ref DataSet customDataSet, ref int historyLogLevel, ref string historyLogMessage)
        {
            var sb = new StringBuilder();
            sb.AppendLine("-------------------------------------");
            sb.AppendLine("In InsertHandler: " + DateTime.Now);
            sb.AppendLine("Source: " + insertSource.ToString());
            sb.AppendLine("InsertHandler: " + _ArticleName);
            sb.AppendLine("-------------------------------------");
            System.IO.File.AppendAllText(@"C:\Temp\ReplicationBusinessLogicModule.txt", sb.ToString());

            return base.InsertHandler(insertSource, insertedDataSet, ref customDataSet, ref historyLogLevel, ref historyLogMessage);

        }

        public override ActionOnDataChange UpdateHandler(SourceIdentifier updateSource, DataSet updatedDataSet, ref DataSet customDataSet, ref int historyLogLevel, ref string historyLogMessage)
        {

            var sb = new StringBuilder();
            sb.AppendLine("-------------------------------------");
            sb.AppendLine("In UpdateHandler: " + DateTime.Now);
            sb.AppendLine("Source: " + updateSource.ToString());
            sb.AppendLine("ArticleName: " + _ArticleName);
            sb.AppendLine("-------------------------------------");
            System.IO.File.AppendAllText(@"C:\Temp\ReplicationBusinessLogicModule.txt", sb.ToString());


            customDataSet = updatedDataSet.Copy();
            customDataSet.Tables[0].Rows[0]["NVarCharColumn"] = string.Format("Repl({0})", _ReplicationTime);

            return ActionOnDataChange.AcceptCustomData;
        }

        public override ActionOnUpdateConflict UpdateConflictsHandler(DataSet publisherDataSet, DataSet subscriberDataSet, ref DataSet customDataSet, ref ConflictLogType conflictLogType, ref string customConflictMessage, ref int historyLogLevel, ref string historyLogMessage)
        {

            var sb = new StringBuilder();
            sb.AppendLine("-------------------------------------");
            sb.AppendLine("In UpdateConflictsHandler: " + DateTime.Now);
            sb.AppendLine("ConflictLogType: " + conflictLogType.ToString());
            sb.AppendLine("ArticleName: " + _ArticleName);
            sb.AppendLine("-------------------------------------");
            System.IO.File.AppendAllText(@"C:\Temp\ReplicationBusinessLogicModule.txt", sb.ToString());

            return base.UpdateConflictsHandler(publisherDataSet, subscriberDataSet, ref customDataSet, ref conflictLogType, ref customConflictMessage, ref historyLogLevel, ref historyLogMessage);
        }

        public override ActionOnDataDelete DeleteHandler(SourceIdentifier deleteSource, DataSet deletedDataSet, ref int historyLogLevel, ref string historyLogMessage)
        {
            var sb = new StringBuilder();
            sb.AppendLine("-------------------------------------");
            sb.AppendLine("In DeleteHandler: " + DateTime.Now);
            sb.AppendLine("Source: " + deleteSource.ToString());
            sb.AppendLine("DeleteHandler: " + _ArticleName);
            sb.AppendLine("-------------------------------------");
            System.IO.File.AppendAllText(@"C:\Temp\ReplicationBusinessLogicModule.txt", sb.ToString());

            return base.DeleteHandler(deleteSource, deletedDataSet, ref historyLogLevel, ref historyLogMessage);
        }
    }



Merge Replication fail with "The Merge Agent failed to apply replication metadata"

$
0
0

I have pull merge subscription. I incresed querytimout to 3000. 4 servers out of 19 fail syncing.

Verbose output with 4 level shows this error:

2016-02-04 13:59:08.936 OLE DB Subscriber 'KRG-HB-SRV-CPI': {call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}
2016-02-04 13:59:08.936 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:08.951 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:08.967 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:08.967 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 13:59:08.982 OLE DB Subscriber 'KRG-HB-SRV-CPI': {call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}
2016-02-04 13:59:08.982 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:09.006 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:09.006 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:09.022 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 13:59:09.037 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:09.037 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:09.053 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:09.069 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 13:59:09.084 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:09.084 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:09.100 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:09.100 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:09.100 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:09.100 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:09.115 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 13:59:09.115 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 13:59:09.131 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:09.131 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:09.131 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:09.147 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:09.147 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:09.147 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:09.147 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 13:59:09.162 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 13:59:09.162 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:09.178 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:09.178 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:09.194 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:09.194 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:09.194 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:09.194 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 13:59:09.209 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 13:59:09.209 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:09.225 OLE DB Publisher 'AST-CPI-SRV-001': {call sys.sp_MSgetmetadatabatch90new(?,?,?)}
2016-02-04 13:59:09.225 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:09.240 OLE DB Publisher 'AST-CPI-SRV-001': save transaction mergecommitbatch
2016-02-04 13:59:09.240 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:09.240 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_ins_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,?,?,?,?,?,NULL,'',?,?,?,90)}
2016-02-04 13:59:09.240 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 13:59:09.256 OLE DB Publisher 'AST-CPI-SRV-001': {?=call [dbo].[MSmerge_upd_sp_D37ED94E2DEC482C397881DCCCAE4AB6] ('23F41C2B-FA6F-45B8-843B-52C54AE166D4',?,?,2,?,?,?,?, , , ,?, ,90)}
2016-02-04 14:09:04.145 [0%] [1988666 sec remaining] Percent Complete: 0
2016-02-04 14:09:04.145 The process is waiting for a response from the query '{call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}'
2016-02-04 14:09:04.145 Repl Agent Status: 3
2016-02-04 14:09:04.145 OLE DB Distributor 'AST-CPI-SRV-001': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-02-04 14:14:04.164 [0%] [1988666 sec remaining] Percent Complete: 0
2016-02-04 14:14:04.164 The process is waiting for a response from the query '{call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}'
2016-02-04 14:14:04.164 Repl Agent Status: 3
2016-02-04 14:14:04.164 OLE DB Distributor 'AST-CPI-SRV-001': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-02-04 14:19:04.184 [0%] [1988666 sec remaining] Percent Complete: 0
2016-02-04 14:19:04.184 The process is waiting for a response from the query '{call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}'
2016-02-04 14:19:04.184 Repl Agent Status: 3
2016-02-04 14:19:04.184 OLE DB Distributor 'AST-CPI-SRV-001': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-02-04 14:24:04.202 [0%] [1988666 sec remaining] Percent Complete: 0
2016-02-04 14:24:04.202 The process is waiting for a response from the query '{call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}'
2016-02-04 14:24:04.202 Repl Agent Status: 3
2016-02-04 14:24:04.202 OLE DB Distributor 'AST-CPI-SRV-001': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-02-04 14:29:04.231 [0%] [1988666 sec remaining] Percent Complete: 0
2016-02-04 14:29:04.231 The process is waiting for a response from the query '{call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}'
2016-02-04 14:29:04.231 Repl Agent Status: 3
2016-02-04 14:29:04.231 OLE DB Distributor 'AST-CPI-SRV-001': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-02-04 14:34:04.267 [0%] [1988666 sec remaining] Percent Complete: 0
2016-02-04 14:34:04.272 The process is waiting for a response from the query '{call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}'
2016-02-04 14:34:04.272 Repl Agent Status: 3
2016-02-04 14:34:04.304 OLE DB Distributor 'AST-CPI-SRV-001': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-02-04 14:39:04.310 [0%] [1988666 sec remaining] Percent Complete: 0
2016-02-04 14:39:04.310 The process is waiting for a response from the query '{call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}'
2016-02-04 14:39:04.310 Repl Agent Status: 3
2016-02-04 14:39:04.310 OLE DB Distributor 'AST-CPI-SRV-001': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-02-04 14:44:04.329 [0%] [1988666 sec remaining] Percent Complete: 0
2016-02-04 14:44:04.329 The process is waiting for a response from the query '{call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}'
2016-02-04 14:44:04.329 Repl Agent Status: 3
2016-02-04 14:44:04.329 OLE DB Distributor 'AST-CPI-SRV-001': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2016-02-04 14:49:04.354 [0%] [1988666 sec remaining] Percent Complete: 0
2016-02-04 14:49:04.354 The process is waiting for a response from the query '{call sys.sp_MSproxiedmetadata(?,?,?,?,?,90)}'

It would be greate to have some advices on how to troubleshoot this issue. At this moment I increased the verbose level to 6, but I think I already have enough information where the problem is. Just need to understand what kind of parameters where called sys.sp_MSproxiedmetadata. Where I can see that? Suppose with Server Profiler? Even if I will catch parameters what's next step to resolve?

Change Data Capture - Questions on Retrieving LSN's with CDC Functions

$
0
0

Hi,

Why does the function to retrieve the minimum LSN allow you to specify a capture instance, but not the function to retrieve the maximum LSN?

If I wanted to find out the last change made to a row in a tracked table, I would want to use the max LSN for a table rather than for everything that is being tracked (i.e. same reasoning as for retrieving the min LSN).

I don't know enough about LSN's to know whether they increase numerically as they are created - for instance, if I query for the MAX(LSN) in the tracking table, does that give me the most recent row added?

I am also looking at determining the last update that was made to a particular column in a tracked table (to retrieve its previous value), so understanding how to work with max LSN values will be very useful!

I do understand that I can use the time mapping functions to convert to and from LSN values, but I am wondering if I can be more direct in the querying by using the LSN itself.

Thanks in advance!

Dan

Configure SQL Server 2012 AlwaysOn Availability Groups Listener problem

$
0
0

Hello,

I was trying to build SQL Server 2012 AlwaysOn Availability Groups, and I configured everything starting with DC and failover cluster and added the both database server in it and configured availability group and test it and everything is ok now I have problem with the Listener, Listener DNS Name do I need to configure it in the Domain controller if yes do I need configure A record for Listener DNS Name point to the static IP for the listener.

for example:

Listener DNS Name: Listener01

port: 1433

IP:10.1.1.60 what is this IP is it the static IP of the cluster server in the image bellow. and do I need A record with Listener01 and 10.1.1.60 ?? can someone explain to me please. 

Regards,

Ayesh

restoring from Log Shpping database

$
0
0

Hello,

I configure log shipping for on premise environment to restore it on windows azure, I want to ask you can we configure AlwaysOn for the restored databases.

For example:

(on-premise) DB01(Server) here we configure the log shipping to Azure MYDB1

(Azure) EuroDB01(Server) I have the database in restoring state can i configure AlwaysOn for database in restoring State ??

Regards,

Ayesh


SQl Server Disaster recovery

$
0
0

Hello,

I created on-premise SharePoint 2013 environment, I am planning disaster recovery for it, in the disaster recovery environment I use Log shipping to send the transaction and I configure DNS replica.

DREuroDB01,DREuroDB02: AlwaysOn + log shipping to DRJapanDB01

DRJapanDB01(will receive the transactions),DRJapanDB02: what availability method to configure here AlwaysOn and get the backups from DRJapanDB01 ??

Regards,

Ayesh


transactional replication repeatedly drops and recreates subscriber tables

$
0
0

I am using replication between SQL Server 2008R2 (publisher, push replication) and SQL Server 2012. The subscriber's tables are dropped and recreated EVERY TIME the replication process runs. I cannot change this in the replication article window in SQL Server Management Studio (2012). Looking at the properties of table articles on the publication, I see that "Action if name is in use" is set to "Drop existing object and create a new one". I have tried to change it to "keep existing object unchanged" but it reverts back immediately after I click OK and re-open the window.

Aside from when a table's structure has changed, I do not ever want transactional replication to drop the subscriber table. I want transactional replication to transmit inserts/updates/and deletes of rows that have changed since the previous run of replication. My replication typically runs on demand after data processing batches have been completed on the 2008R2 -- once an hour or once a day, depending on the publication. 

How can I correct this behavior? Is this a bug?

I believe it might be related to using 2008R2 as the publisher. (All instances are Enterprise edition).

Snapshot Replication - Adding AZURE SQL 2014 Server as Subscriber to 2012 Local Server

$
0
0

When attempting to add a Windows AZURE Test Server as Subscriber to a local Snapshot replication policy I receive the error below.  

The selected Subscriber does not satisfy the minimum version compatibility level of the selected publication.

The Source Server is a local SQL Server 2012 11.0.6020 running on Windows Server 2012.  The Target Server is an AZURE SQL Server 2014 12.0.4213 running on Windows Server 2012.   

There is no problem connecting to the AZURE SQL Box from the Local SQL Server Management Studio.   I receive the above error as soon as I attempt to add the AZURE SQL Server 2014 as a subscriber to the snapshot subscription on my local server.

Any thoughts would be appreciated.

Subscription reinitialized-Distribution job Failing

$
0
0

Hello,

Today I reinitialized our subscription because it had expired.  All of the published tables bcp'd over fine to the subscriber database, but a large number of undistributed commands has been growing all afternoon. The distribution job is showing the below error,

<dir>

The replication agent has not logged a progress message in 10 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 Distributor are still active.

I ran a trace at the subscriber and do not see any replicated transactions making it to the subscriber database.  The logreader is running and the distribution job shows to be running. 

Did I miss a step?  Any help would be great...this is day 2 of trying to get the Report Server working again.

Thanks!

</dir>

After restore publisher database on subscriber database errors in sql server?

$
0
0

Hi All,

i have restored the publisher database backup on subscriber database with keep replication option .

after restore database ,i rerun the distribution agent and i checked replication monitor for replication status.

replication status shows exlent but when i check the distribution ,error like : initial snapshot is not available  .

i try to rerun the snapshot agent but it's failed .then i checked the subscription server ,find  same publisher  and subscriber on server. 

Q: is it possible ?why it's created?

please help me on this.

Thanks,

Tirumala

Replication doesn't work after installed SQL 2012 SP3 to SQL 2005

$
0
0

Hi Sir/Madam,

I installed SQL 2012 SP3(Enterprise Edition,Microsoft SQL Server 2012 (SP3) (KB3072779) - 11.0.6020.0 (X64) ) in a prodcution database server, in which we are using transactional replications to

1). SQL 2012 database server , it works fine;

2). SQL 2005 database server(Standard Edition, Microsoft SQL Server 2005 - 9.00.4340.00 (X64) ), it doesn't work;

The error message is,

Message: declare @event_type SMALLINT = 0, @distributor_major_version SMALLINT = 11, @distributor_minor_version SMALLINT = 0, @distributor_build_number SMALLINT = 6020 if object_id(N'sys.sp_repl_generate_subscriber_event') is not null
exec sys.sp_repl_generate_subscriber_event @event_state = @event_type, @distributor_major_version = @distributor_major_version, @distributor_minor_version = @distributor_minor_version, @distributor_build_number = @distributor_build_number
2016-01-22 19:22:02.180 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  139
Message: Cannot assign a default value to a local variable.
2016-01-22 19:22:02.180 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  137
Message: Must declare the scalar variable "@event_type".

I couldn't found any solution to fix it.

Please advise,

Thanks,

Subscription not expiring

$
0
0

I have been trying to test that changing the value of the merge replication subscription expiration from 7 to 21 days will function correctly. It certainly seems like it works fine, and I’ve updated our refresh snapshot job to account for the added days too. There is a subscriber with a pull subscription that merges every 5 minutes.

My issue is that I want to force a subscriber to be expired and then resubscribe it and verify it works. No matter what I do, it does not seem to expire. The general steps I have tried to force the expiration is as follows (NOTE: I’m using the 7 day expiration just to see if I can get the subscriber to expire):

  1. Ensure there is a valid publication and a pull subscriber.

  2. Stop any subscriber merges by stopping the tool that performs that merge.

  3. On the publisher computer, make a change to a published table article. This is done after the last subscriber merge.

  4. Update the date of the server to 30 days in the future.

  5. Restart the SQL Server service (also restarts the SQL Server Agent).

  6. On the publisher, clean metadata using exec sp_mergemetadataretentioncleanup.

  7. Run the following jobs on the publisher:

    1. Agent history clean up:  distribution

    2. Distribution clean up:  distribution

    3. Expired subscription clean up

  8. Refresh the snapshot (sp_startpublication_snapshot).

  9. Update the subscriber’s computer to the same date as the publisher.

  10. On the subscriber’s computer, restart the SQL Server service.

  11. Perform a merge replication.

With all of this done, it continues. I would have expected the subscription to be expired being that the metadata should be gone (BTW - MSmerge_genhistory still shows the older data). I’ve even tried rearranging the cleanups and refreshing snapshot to no avail. Sometimes it just syncs, other times it seems to automatically reinitialize when I didn’t tell it to.

Can anyone help? Thanks.

Transaction Replication subscriber initialization not picking up the SnapShot

$
0
0

Team,

I am looking for help in SQL Replication 2008 R2 SP1. Before I start let me explain the scenario from Server prospective.

1. We have Transaction replication From Main Office (Server A Publisher) to Branch Office (Server B Subscriber) in Production.

2. Infra. team gave me Server A and Server B copy (From VMWare Snapshot) in different VLAN.

3. Server A VMWare Snapshot is bit older (around 30 Minutes) than Server B Snapshot.

Issue: After getting Server A and Server B to the different VLAN. I can connect both of the servers properly and can ping as well but when I am trying to initialize subscriber (Server B) Snapshot agent generating Snapshot properly but Distributor is not delivering to subscriber. I check all the network path and access from subscriber where my snapshot is sitting and it's accessible.

Note: Infra. team gave me the Domain Controller as well in different VLAN so everything is same from Infra. team prospective.Same time if my Server A VMWare snapshot is newer then Server B VMWare snapshot everything is working the we want.

I tried many ways to find out any show stopper at distributor but so far no luck. :( 

Appreciate any help on this.

Thanks,

Mehul


how to add witness server without breaking mirroring in sql server ?

$
0
0
 

Hi All,

I have get different request from my client side. Actually few months back we have configured Mirroring (2TB database) without witness server (without automatic failover ) .

Now I have get new request like without breaking the mirroring add the witness server to mirroring.

Please guide me, how to add witness server without breaking mirroring in sql server 2008.

 

Thanks in advance.


RAM

Stop Replicating one of the article in replication to few Subscribers

$
0
0

I have a publisher Server A, subscriber servers B C D

from publisher A, i have a Publication with 100 Articles replicating to 3 Subscribers 

Now, i want to stop Replicating 1 Article out of 100 to C and D 

but i still want to continue replicating to B 

how can i achieve this ? can any one help

Availability Group Failover General Question

$
0
0

Hello,

I Have Always on Availability group with Windows failover cluster I have 3 nodes and 3 Instances. SQLServerDB01(Primary), SQLServerDB02(Secondary Synchronous), SQLServerDB03(Secondary Asynchronous).

Now when Failover occur on SQLServerDB01(this server out), it will automatic go to server SQLServerDB02 if automatic failover was enabled.

what will happen to the solution will SQLServerDB02 become primary ?? and will it be Read-Only database or Read-Write ??

if the answer was Read-Only is there any way to make it Read-Write.

Regards,

Ayesh.

Programmatically check if Replication Components are installed on SQL Server 2008

$
0
0
Hi,

I am currently trying to programmatically check if replication components are installed on my machine.
If anyone has done this kindly pass on code snippet.

Hemal

RMO objects installing Distibution db on C drive and not in default location definr in SSMS

$
0
0
I am trying to set up replication through RMO objects using .NET, But the setup is creating mdf and ldf files in C drive instead of default location defined as a folder in D drive.Please help?
Viewing all 4054 articles
Browse latest View live




Latest Images