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

SQL 2012 Replication Clear Old repldata from server

$
0
0

I setup image based replication for our ERP system DB a while back.  My goal was to create copies of each company DB on each local server as a reference to the users onsite and everything about the replication side works fine.  My problem is that almost all of the servers don't flush the old repldata out and it eats up a lot of drive space.  I can't seem to find the difference between the server that does flush old repldata out and the ones that don't.  Can anyone tell me is there a config for flushing old repldata out automatically?  I'm running the full version of SQL 2012 on Window Server 2008 R2.  The images are created nightly 5 days a week.

Thank you for any responses in advance.


Replication: Getting Cannot Apply Value 'NULL' to Property ServerInstance

$
0
0

I have set up replication between a SQL 2012 and a SQL 2016 server.  On the 2016 Server in SSMS when I right click on the Local Subscription I get the error below. Does anyone know how to correct this? I am logged in with a domain account that is admin on the server and sysadmin in the database.

Cannot apply value 'null' to property ServerInstance: Value cannot be null

Thanks!

Mark.

merge replication - error message when initializing

$
0
0

I am trying to set up a merge replication using code similar to the following for the filtered tables:

exec sp_addmergearticle @publication = N'MaxLoadBalance_Repl', @article = N'INVOICEMATCH', @source_owner = N'dbo', @source_object = N'invoicematch', @type = N'table', @description = N'', @creation_script = N'', @pre_creation_cmd = N'truncate', @schema_option = 0x000000010C034FD1, @identityrangemanagementoption = N'none', @destination_owner = N'dbo', @force_reinit_subscription = 1, @column_tracking = N'false', @subset_filterclause = N'Siteid like ''11%'' and Orgid=''PMV''', @vertical_partition = N'false', @verify_resolver_signature = 1, @allow_interactive_resolver = N'false', @fast_multicol_updateproc = N'true', @check_permissions = 0, @subscriber_upload_options = 0, @delete_tracking = N'true', @compensate_for_errors = N'false', @stream_blob_columns = N'true', @partition_options = 0

and similar to the following for the the tables of some not all columns:

exec sp_mergearticlecolumn @publication = N'MaxLoadBalance_Repl', @article = N'workorder', @column = N'c_pmcounter', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1

The snapshot creation completes successfully, but when it's start initializing/sync the subscriber, I'm getting the following error:

Command attempted:
{call sp_MSsetconflicttable (N'A_INVRESERVE', N'MSmerge_conflict_MaxLoadBalance_Repl_A_INVRESERVE', N'TheServer\SQL2014', N'MaxTest', N'MaxLoadBalance_Repl')}

Error messages:
Incorrect syntax near 'actualqty'. (Source: MSSQLServer, Error number: 102)
Get help: http://help/102
The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001

after that the agent keeps just retrying and retrying.

I have tried to find where is the problem using the profiler, but with no luck. I could not get more details.

What could be the problem? and how it can be solved?

SQL: TLog Shipping

$
0
0
Howdi,

Pretty simple set up and question but after some experiences, I am testing as we speak.

Current setup:

Server A -> DB1 Tlogs -> Server B DB2 - every 15 mins

Moving to:

Server A -> DB1 Tlogs -> Server B DB2 - every 15 mins
Server A -> DB1 Tlogs -> Server C DB3 - every 15mins - additional secondary

Adding the additional secondary server is not an issue, and there is a complete 24 hr period were the DB will be in minimal use.

My question is what will happen to the original Tlog shipping process.
-Does it continue as normal?
-Does it get a larger log shipped when backup for 2nd secondary finishes?
-Does it need recreating?

We will be copying the log files to different physical locations.

Hopefully that makes sense, I don't ever recall doing this without recreating the shipping so just after some advice/experiences.

Cheers

The article cannot be created on table '[dbo].[XYZ]' because it has more than 246 columns.

$
0
0

I'm trying to create a merge publication using script. For example:

exec sp_addmergearticle @publication = N'MaxLoadBalance_Repl', @article = N'workorder', @source_owner = N'dbo', @source_object = N'workorder', @type = N'table', @description = N'', @creation_script = N'', @pre_creation_cmd = N'truncate', @schema_option = 0x000000010C034FD1, @identityrangemanagementoption = N'none', @destination_owner = N'dbo', @force_reinit_subscription = 1, @column_tracking = N'false', @subset_filterclause = N'', @vertical_partition = N'true', @verify_resolver_signature = 1, @allow_interactive_resolver = N'false', @fast_multicol_updateproc = N'true', @check_permissions = 0, @subscriber_upload_options = 0, @delete_tracking = N'true', @compensate_for_errors = N'false', @stream_blob_columns = N'true', @partition_options = 0
exec sp_mergearticlecolumn @publication = N'MaxLoadBalance_Repl', @article = N'workorder', @column = N'wonum', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'MaxLoadBalance_Repl', @article = N'workorder', @column = N'parent', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
.
.
.
.
.

Although I have removed a number of columns from the article; so the total number of columns be less than 246, still I'm getting the following error:

Msg 20068, Level 16, State 1, Procedure sp_addmergearticle, Line 831 [Batch Start Line 296]
The article cannot be created on table '[dbo].[WORKORDER]' because it has more than 246 columns.

When I count the number of columns I've added to that specific article, they are not more than 220! then why I'm getting this error?! and how to solve it?

Replication Install Mess

$
0
0

I believe something is wrong with my Replication Server

exec sp_replicationdboption N'VPIReporting', N'publish', N'true'
use master

Msg 20028, Level 16, State 1, Procedure sp_MSpublishdb, Line 56 [Batch Start Line 3]
The Distributor has not been installed correctly. Could not enable database for publishing.
The replication option 'publish' of database 'VPIReporting' has been set to false.

Is this a bug in merge replication or what?!

$
0
0

I'm trying to setup a merge replication between two SQL Servers as follows:

  • The publisher is SQL Server 2014 (SP2) Developer edition 
  • The subscriber is SQL Server 2012 (SP3) Developer edition

Generating the snapshot completed successfully, however when applying the snapshot on the subscriber I am getting the following error:

Command attempted:
{call sp_MSsetconflicttable (N'DMCOLLPKGEXCEPTION', N'MSmerge_conflict_MaxLoadBalance_Repl_DMCOLLPKGEXCEPTION', N'MAXIMO-1-RND\SQL2014', N'MaxTest', N'MaxLoadBalance_Repl')}

Error messages:
Incorrect syntax near 'exception'. (Source: MSSQLServer, Error number: 102)
Get help: http://help/102
The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001

I've opened the profiler to find where this syntax error is happening, and the following is what I found:

as you can see the statement starts with the name of the column with no select nor update and ends with from and where clause! ... the following is a copy of the whole script:

Create procedure dbo.[MSmerge_cft_sp_BAAC1138E0234F895E23FB4F2043447C] (  @p1 varchar(30),
        @p2 varchar(255),
        @p3 smallint,
        @p4 smallint,
        @p5 varchar(20),
        @p6 varchar(20),
        @p7 text,
        @p8 text,
        @p9 bigint,
        @p11 smallint,
        @p12 varchar(4),
        @p13 uniqueidentifier,
        @p14  nvarchar(255)  , @conflict_type int,  @reason_code int,  @reason_text nvarchar(720) , @pubid uniqueidentifier, @create_time datetime = NULL , @tablenick int = 0, @source_id uniqueidentifier = NULL, @check_conflicttable_existence bit = 0  ) as
declare @retcode int
-- security check
exec @retcode = sys.sp_MSrepl_PAL_rolecheck @objid = 1804646999, @pubid = '5E23FB4F-2043-447C-BDBE-E1689887F970'
if @@error <> 0 or @retcode <> 0 return 1
if 1 = @check_conflicttable_existence
begin
    if 1804646999 is null return 0
end

    if @source_id is NULL
        select @source_id = subid from dbo.sysmergesubscriptions
            where lower(@p14) = LOWER(subscriber_server) + '.' + LOWER(db_name)
    if @source_id is NULL select @source_id = newid()
    set @create_time=getdate()[exception] = @p1 ,
        [description] = @p2 ,
        [userdefined] = @p3 ,
        [enabled] = @p4 ,
        [exceptioncfgobject] = @p5 ,
        [dependentcfgobject] = @p6 ,
        [exceptioncondition] = @p7 ,
        [exceptioninstr] = @p8 ,
        [dmcollpkgexceptionid] = @p9 ,
        [hasld] = @p11 ,
        [langcode] = @p12 ,
        [rowguid] = @p13  from [dbo].[MSmerge_conflict_MaxLoadBalance_Repl_DMCOLLPKGEXCEPTION] ct inner join MSmerge_conflicts_info info
        on ct.rowguidcol=info.rowguid and
           ct.origin_datasource_id = info.origin_datasource_id
    end
    else
    begin
        insert into [dbo].[MSmerge_conflict_MaxLoadBalance_Repl_DMCOLLPKGEXCEPTION] ( [exception] ,
        [description] ,
        [userdefined] ,
        [enabled] ,
        [exceptioncfgobject] ,
        [dependentcfgobject] ,
        [exceptioncondition] ,
        [exceptioninstr] ,
        [dmcollpkgexceptionid] ,
        [hasld] ,
        [langcode] ,
        [rowguid] ,
        [origin_datasource_id] ) values (
@p1 ,
        @p2 ,
        @p3 ,
        @p4 ,
        @p5 ,
        @p6 ,
        @p7 ,
        @p8 ,
        @p9 ,
        @p11 ,
        @p12 ,
        @p13 ,
         @source_id  )
    end
        declare @error    int
        set @error= @reason_code

    declare @REPOLEExtErrorDupKey            int
    declare @REPOLEExtErrorDupUniqueIndex    int

    set @REPOLEExtErrorDupKey= 2627
    set @REPOLEExtErrorDupUniqueIndex= 2601

    if @error in (@REPOLEExtErrorDupUniqueIndex, @REPOLEExtErrorDupKey)
    begin
        update mc
            set mc.generation= 0
            from dbo.MSmerge_contents mc join [dbo].[dmcollpkgexception] t on mc.rowguid=t.rowguidcol
            where
                mc.tablenick = 6399000 and
                (
                         (t.[dmcollpkgexceptionid]=@p9)  or
                        (t.[exception]=@p1)
                        )
            end 

I went to the publisher snapshot folder and in all the files titled with something like "DMCOLLPKGEXCEPTION" I have searched for "Create proceduredbo.[MSmerge_cft_sp_BAAC1138E0234F895E23FB4F2043447C]" (which is the first line of the script) and I found the following (the part that I think it is missing is in bold):

Create procedure dbo.[MSmerge_cft_sp_BAAC1138E0234F895E23FB4F2043447C] (
@p1 varchar(30),
        @p2 varchar(255),
        @p3 smallint,
        @p4 smallint,
        @p5 varchar(20),
        @p6 varchar(20),
        @p7 text,
        @p8 text,
        @p9 bigint,
        @p11 smallint,
        @p12 varchar(4),
        @p13 uniqueidentifier,
        @p14  nvarchar(255)
, @conflict_type int,  @reason_code int,  @reason_text nvarchar(720)
, @pubid uniqueidentifier, @create_time datetime = NULL
, @tablenick int = 0, @source_id uniqueidentifier = NULL, @check_conflicttable_existence bit = 0
) as
declare @retcode int
-- security check
exec @retcode = sys.sp_MSrepl_PAL_rolecheck @objid = 1096460707, @pubid = '5E23FB4F-2043-447C-BDBE-E1689887F970'
if @@error <> 0 or @retcode <> 0 return 1

if 1 = @check_conflicttable_existence
begin
    if 1096460707 is null return 0
end


    if @source_id is NULL
        select @source_id = subid from dbo.sysmergesubscriptions
            where lower(@p14) = LOWER(subscriber_server) + '.' + LOWER(db_name)

    if @source_id is NULL select @source_id = newid()

    set @create_time=getdate()

  if exists (select * from MSmerge_conflicts_info info inner join [dbo].[MSmerge_conflict_MaxLoadBalance_Repl_DMCOLLPKGEXCEPTION] ct
    on ct.rowguidcol=info.rowguid and
       ct.origin_datasource_id = info.origin_datasource_id
     where info.rowguid = @p13 and info.origin_datasource = @p14 and info.tablenick = @tablenick)
    begin
        update [dbo].[MSmerge_conflict_MaxLoadBalance_Repl_DMCOLLPKGEXCEPTION] with (rowlock) set
[exception] = @p1
,
        [description] = @p2
,
        [userdefined] = @p3
,
        [enabled] = @p4
,
        [exceptioncfgobject] = @p5
,
        [dependentcfgobject] = @p6
,
        [exceptioncondition] = @p7
,
        [exceptioninstr] = @p8
,
        [dmcollpkgexceptionid] = @p9
,
        [hasld] = @p11
,
        [langcode] = @p12
 from [dbo].[MSmerge_conflict_MaxLoadBalance_Repl_DMCOLLPKGEXCEPTION] ct inner join MSmerge_conflicts_info info
        on ct.rowguidcol=info.rowguid and
           ct.origin_datasource_id = info.origin_datasource_id
 where info.rowguid = @p13 and info.origin_datasource = @p14 and info.tablenick = @tablenick


    end
    else
    begin
        insert into [dbo].[MSmerge_conflict_MaxLoadBalance_Repl_DMCOLLPKGEXCEPTION] (
[exception]
,
        [description]
,
        [userdefined]
,
        [enabled]
,
        [exceptioncfgobject]
,
        [dependentcfgobject]
,
        [exceptioncondition]
,
        [exceptioninstr]
,
        [dmcollpkgexceptionid]
,
        [hasld]
,
        [langcode]
,
        [rowguid]
,
        [origin_datasource_id]
) values (

@p1
,
        @p2
,
        @p3
,
        @p4
,
        @p5
,
        @p6
,
        @p7
,
        @p8
,
        @p9
,
        @p11
,
        @p12
,
        @p13
,
         @source_id
)

    end


    if exists (select * from MSmerge_conflicts_info info where tablenick=@tablenick and rowguid=@p13 and info.origin_datasource= @p14 and info.conflict_type not in (4,7,8,12))
    begin
        update MSmerge_conflicts_info with (rowlock)
            set conflict_type=@conflict_type,
                reason_code=@reason_code,
                reason_text=@reason_text,
                pubid=@pubid,
                MSrepl_create_time=@create_time
            where tablenick=@tablenick and rowguid=@p13 and origin_datasource= @p14
            and conflict_type not in (4,7,8,12)
    end
    else
    begin

        insert MSmerge_conflicts_info with (rowlock)
            values(@tablenick, @p13, @p14, @conflict_type, @reason_code, @reason_text,  @pubid, @create_time, @source_id)
    end

        declare @error    int
        set @error= @reason_code

    declare @REPOLEExtErrorDupKey            int
    declare @REPOLEExtErrorDupUniqueIndex    int

    set @REPOLEExtErrorDupKey= 2627
    set @REPOLEExtErrorDupUniqueIndex= 2601

    if @error in (@REPOLEExtErrorDupUniqueIndex, @REPOLEExtErrorDupKey)
    begin
        update mc
            set mc.generation= 0
            from dbo.MSmerge_contents mc join [dbo].[dmcollpkgexception] t on mc.rowguid=t.rowguidcol
            where
                mc.tablenick = 6399000 and
                (

                        (t.[dmcollpkgexceptionid]=@p9)
 or
                        (t.[exception]=@p1)

                        )
            end

I am no sure if I'm looking to the right places, but anyway, is this a bug? or it is me who did something wrong? ... how can this be fixed anyway?

Azure SQL database sync (old portal)

$
0
0

Hello,

We are using Azure SQL databases and we have sync set up for a number of them.  One of them was showing as not synced since October.  We kicked off a sync which lasted at least 8 hours.  We are not seeing the sync as in progress any longer and the last sync is still showing as from October.

Also, I tried to make a slight alteration to the sync rules and got the error below.  I need to know if this can be overcome, and how to properly force a sync for our dbs.  Also, since this is a preview feature, I need to know a way to accomplish this with a feature that Azure fully supports.

Many thanks.

The sync group is not in a valid state for re-provisioning. The sync group cannot be re-provisioned if members are currently provisioning, re-provisioning, de-provisioning, canceling sync, synchronizing, or have local agents that do not support re-provisioning. TracingId=f7120a70-af29-3727-a103-553aeb86a6bb



Replication Speed between SQLServer and Oracle

$
0
0
Hi All,
I have following situation:
NYC office has Oracle and SqlServer databases. NJ office has Oracle database. 
Currently replication is going on between two oracle instance and it's healthy. **Both oracle instances are in the "Full" log mode.**

We plan to move NYC Oracle instance to MSSqlServe 2014. Now I need to replicate about 40+ tables to NJ Oracle instance from NYC MSSqlServe 2014 database using **transactional replication**.

Initial setup revealed replication was breaking after sometime due to timeout issues. We are past that issue now.
My real problem is the speed and size of some tables. I have about 15 tables with more than 1M rows. I did some basic benchmarking and realize the rate of propogation is about 6000 rows per minute. This will take more than 9 hours just for 1 table.

**The above speed is on a test oracle instance which is running in non-log mode.** I believe removing indexes on the Oracle (receiver side) could help but I also think doing that invalidates the replication and it begins all over again.

What could I do to improve this speed?
How you pros out there measure and keep tab on the process?
Any queries that you guys use for overall replication management?


Thanks!
DP

Distributor Agent failing with error- Incorrect syntax near the keyword 'EXECUTE'. "

$
0
0

Hi All,

Distributor Agent failing with below error in Transactional replication.

Error:-

Replication-Replication Distribution Subsystem: agent ABC-CDE-EFG-result-Repl_ABST_ContactsDelta-ABC-CDE-EFG-54 failed. Incorrect syntax near the keyword 'EXECUTE'.

Message
Error: 14151, Severity: 18, State: 1.

SQL Server version - 2000

I ran tracer token in which it shows Distributor to subscriber pending.

Other replication configured under same database is running fine.

Any help would be more appreciated.

Thanks,

Aman

High CPU usage occurs periodically on the subscriber - SQL Server 2008 Sp4

$
0
0

Hello,

I have setup a merge publication and a subscriber with push subscription mode.

On the subscriber, I notice the CPU usage is going high periodically.

It may take about 40 seconds for the CPU Usage come back to 0%. And it occurs at same time as long as theSynchronization Status display : "Uploading data changes to the Publisher" . This only occurs at subscriber, the publisher is normally.


I've go to  Reports > Top Queries by Total CPU time at the subscriber to see which queries make the CPU usage go high and below is the result:



I don't know what to do next to fix this issue. Anyone please help me. Thank you all very much.

Merge Replication setup with sp_adddistributor error

$
0
0

We have a customer's server that is setup and running SQL Server 2014 with no issues.

They then changed the server name (from SERVER1 to SERVER1-OH) and i ran the commands to get SQL Server setup correctly.

Now, SELECT @@servername returns SERVER1-OH as it should.

but, when trying to setup SQL Merge Replication:

exec sp_adddistributor @distributor='SERVER1-OH'

it returns an error:

When executing sp_adddistributor for a remote Distributor, you must use a password. The password specified for the @password parameter must be the same when the procedure is executed at the Publisher and at the Distributor.

I have also tried:

exec sp_adddistributor @distributor=@@servername

And that also fails with the same message. I honestly can't remember, but i might have tried to setup replication before the server name was changed (I didn't request the server name change, their IT people did it themselves).

So, where in the internals of SQL could the old name still be in there so it is thinking that its name is SERVER1 instead of SERVER1-OH, that the @@servername is returning.

No idea where to go.

Thanks in advance.


darin

Column 'rowguid' in table 'aTable' is invalid for creating a default constraint. (Source: MSSQLServer, Error number: 1752)

$
0
0

I'm trying to setup a merge replication between database on SQL Server 2014 and SQL 2012. Creating the publisher, the subscriber, and the snapshot went successfully. However when "Applying the snapshot on subscriber.." I'm getting the following error:

Error messages:
The schema script 'DMCOLLPKGEXCEPTION_2.sch' could not be propagated to the subscriber. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001
Column 'rowguid' in table 'DMCOLLPKGEXCEPTION' is invalid for creating a default constraint. (Source: MSSQLServer, Error number: 1752)
Get help: http://help/1752
Could not create constraint. See previous errors. (Source: MSSQLServer, Error number: 1750)
Get help: http://help/1750

Why? and what should I do to fix this?


Peer-To-Peer Transaction Replication Errors

$
0
0

I've had Peer-to-peer Transactional Replication working great for the past few months.  Just this past week, I've encountered the following error:

 

Date  3/26/2008 10:35:40 AM
Log  Job History (SC1WV5431-LIMS-LIMS_Replication-MA1WV1302-11)

Step ID  2
Server  SC1WV5431
Job Name  SC1WV5431-LIMS-LIMS_Replication-MA1WV1302-11
Step Name  Run agent.
Duration  00:00:10
Sql Severity  0
Sql Message ID  0
Operator Emailed  
Operator Net sent  
Operator Paged  
Retries Attempted  0

Message
2008-03-26 14:35:50.109 Category:COMMAND
Source:  Failed Command
Number: 
Message: if @@trancount > 0 rollback tran
2008-03-26 14:35:50.109 Category:NULL
Source:  Microsoft SQL Native Client
Number:  20807
Message: No peers were found for SC1WV5431:LIMS:1. If you encounter this error when executing the stored procedure sp_requestpeerresponse, verify that subscriptions have been created before attempting to call the procedure again. If you encounter this error in other circumstances, contact Customer Support Services.
2008-03-26 14:35:50.109 Category:NULL
Source:  Microsoft SQL Native Client
Number:  21499
Message: The procedure sys.sp_MSupdatepeerlsn failed to UPDATE the resource MSpeer_lsns.. Server error = 0.

 

This is the error from the Agent Job.  The job from the other server runs perfectly with no errors.  I cannot find any help on this from Technet or google.

 

Has anyone encountered this before?

 

Thanks-

Jason Spangler

 

Column 'rowguid' in table 'Table_1' is invalid for creating a default constraint.

$
0
0

 

 

 

Howdy

I have a merge replication publication on a SQL 2008 R2 CU3 machine I am trying to replicate to a subscriber that is same SQL version.

When I create publication ,all is fine. When I run the subscription the first time to blank subscriber database, all is fine. When I try and run it a second time, I get the error below.  I use the option in the article of "Keep existing object unchanged". The idea is that should the link between publisher and subscriber fail, all data entered on Subscriber database ( which runs a web site ) will be merged back to the publisher once the link is back up.  

The table is tiny - it has one column of 10 rows of plain text data of datatype nchar(10) and no keys or contraints of any sort.

Error messages I get when I attempt to start replication :


The schema script 'Table_1_2.sch' could not be propagated to the subscriber. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001
Column 'rowguid' in table 'Table_1' is invalid for creating a default constraint. (Source: MSSQLServer, Error number: 1752)
Get help: http://help/1752
Could not create constraint. See previous errors. (Source: MSSQLServer, Error number: 1750)
Get help: http://help/1750

 

Just wondering if any knows what might be causing this - I have searched the net and nothing seems to be able to provide a solution.

Thanks in advance,

SG



"Invalid Operation" when adding Oracle subscriber to SQL Server 2016 replication publication

$
0
0

Hi,

I'm trying to set up transactional replication from SQL Server 2016 to Oracle 12c.  (I realize that heterogeneous replication is deprecated but this should be for a limited time period).  I am following the general guidance here:https://msdn.microsoft.com/en-us/library/aa337389.aspx  and the Oracle-specific info here: https://msdn.microsoft.com/en-us/library/ms151864.aspx.  I am finding that when I try to add the non-SQL Server subscriber, I get this error:

Invalid operation. The connection is closed. (System.Data)

------------------------------
Program Location:

   at System.Data.SqlClient.SqlConnection.GetOpenConnection()
   at System.Data.SqlClient.SqlConnection.get_ServerVersion()
   at Microsoft.SqlServer.Management.UI.ReplicationSqlConnection.GetServerVersion()
   at Microsoft.SqlServer.Management.UI.ReplicationSqlConnection.get_IsServer130OrLater()
   at Microsoft.SqlServer.Management.UI.SubWizardSubscriber..ctor(String name, SubscriberType subscriberType, Boolean isSelected, Boolean isRegistered, ReplicationSqlConnection sqlConn, WizardInputs inputs)
   at Microsoft.SqlServer.Management.UI.PageChooseSubscribers.AddNonSqlSubscriber_OnClick(Object sender, EventArgs e)

I have tried to follow the Oracle/heterogenous recommendations, including

1) Installing recent 64-bit Oracle client and verifying basic connectivity to database

2) Ensuring the the distribution account has read access to the Oracle OLEDB provider directory

3) Setting public snapshot format to Character

4) Setting publication's subscription options to Allow non-SQL Server subscribers

5) Configuring my source SQL Server as distributor

Any other suggestions?  Any known guides or walk-throughs for this scenario?

thanks!

Martin


publisher and subscriber with different build numbers

$
0
0

Morning all,

I'm after a clarification/confirmation regarding the rules relating to different versions of SQL in a merge replication topology.

I have a publisher SQL2014 SP1 CU4, and several hundred subscribers who have SQLExpress.

We have started to upgrade the subscriber estate from SQL2008 to the same build as the publisher, but I've noticed some subscribers now have a higher build number than the publisher - seemingly windows update has downloaded and applied CU9.

Does this matter ?  The documentation states :- "A Subscriber to a merge publication can be any version less than or equal to the Publisher version".   

I presume this refers to the SQL2014 part, so it's ok for a subscriber to have a higher build number than the publisher
as long as the version mumber is the same, is that correct ?  Would like to have the comfort of people soothing the gnawing anxiety that comes with anything merge rep!

thanks in anticipation.

Does resyncing a subscriber in SQL Server 2008R2 transactional replication overwrite any new data directly entered in a subscriber

$
0
0

If I have two SQL Server 2008 R2 databases, running on two separate Windows Server 2008 R2 Servers (Server A and Serve B). And these servers are set up with transnational push replication from Server A to Server B. Is it possible for someone to enter new data directly to the data in the subscriber database on Server B, thus causing the publisher database and the subscriber database to be different?

If so, will that data be overwritten if I reinitialize the subscription, such that after the re-initialization, the two databases will be identical again?

Database Replication - generating initial snapshot programmatically fails

$
0
0

Greetings, trying to generate an initial snapshot in VB.Net (VS2012, .Net FW 4.6.1).

Here is the code:

Public Function GenerateInitialSnapshot(ByVal conn As ServerConnection, ByVal InPublisherInstanceName As String, ByVal InPublicationDbName As String, ByVal InPublicationName As String, ByVal InReplicationDBName As String) As Boolean

        Try

            Dim sga As SnapshotGenerationAgent = New SnapshotGenerationAgent()
            sga.Publisher = InPublisherInstanceName
            sga.PublisherDatabase = InPublicationDbName
            sga.Publication = InPublicationName
            sga.Distributor = InPublisherInstanceName
            sga.PublisherSecurityMode = SecurityMode.Integrated
            sga.DistributorSecurityMode = SecurityMode.Integrated
            sga.ReplicationType = ReplicationType.Merge

            sga.GenerateSnapshot()

            Return True

        Catch ex As Exception
            ' Implement custom application error handling here.
            Throw New ApplicationException(String.Format( _
                "The snapshot from publication {0} could not be generated.", InPublicationName), ex)
        End Try

        Return False

    End Function

The call to GenerateSnapshot fails with error -2146233036 "The type initializer for 'Microsoft.SqlServer.Replication.StringResources' threw an exception." The inner exception is -2146232832 "The native replication resource dll failed to load."
The registry setting VerSpecificRootDir is set to C:\Program Files (x86)\Microsoft SQL Server\130\ and I have copied C:\Program Files\Microsoft SQL Server\130\COM\Resources\1033\REPLRES.rll to C:\Program Files\Microsoft SQL Server\130\COM\REPLRES.rll but I still cannot get past this problem.

The stack trace shows:

   at Microsoft.SqlServer.Replication.ReplMessage..ctor(Exception e)
   at Microsoft.SqlServer.Replication.HistoryMessage..ctor(Exception e)
   at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.SnapshotGenerationAgentMessageFactory.CreateAgentMessage(Exception e)
   at Microsoft.SqlServer.Replication.AgentCore.LogMessage(Exception e)
   at Microsoft.SqlServer.Replication.AgentCore.ThreadFailedHandler(Exception e)
   at Microsoft.SqlServer.Replication.AgentCore.Run()
   at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.GenerateSnapshot()
   at WindowsApplication1.Form1.Button1_Click(Object sender, EventArgs e) in C:\Users\John\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb:line 16
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
   at System.Windows.Forms.Nativewindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Any help will be greatly appreciated!

How to programatically stop/start Replication Local-Publication Snapshot agent after changing Publication configuration

$
0
0

I need to programmatically or via Powershell or TSQL stop and start a replication transactional snapshot agent after changing a publication configuration.

Config change below:-

USE [POS]
EXEC sp_changepublication
  @publication = N'IN_STORE',
  @property = N'snapshot_in_defaultfolder',
  @value = N'false'
GO


EXEC sp_changepublication
  @publication = N'IN_STORE',
  @property = N'alt_snapshot_folder',
  @value = N'C:\Program Files\POS\SqlSnapshots'
GO

Viewing all 4054 articles
Browse latest View live




Latest Images