Quantcast
Channel: StackExchange Replication Questions
Viewing all 17268 articles
Browse latest View live

What can make a SQL Server transactional publication send foreign keys even when set to false

$
0
0

SQL Server 2012, 2014, 2016 transactional replication

  1. Publication is created. (copy Foreign Keys is false, the default)
  2. Subscription is created.
  3. Snapshot and sync.
  4. Turn off synchronization.
  5. Upgrade the publication database.
  6. Upgrade the subscriber database for tables affected by modified views.
  7. Set the snapshot to only gather information for changes.
  8. Restart sync.

There is now an error at the subscriber because the two new columns exist and the snapshot is trying to create them but with foreign keys.

Typically it hasn't cared but now it seems to because of the FK creation it wants to do. If I manually delete the two new columns the sync will now create them again but with FKs.

The same operation happens for other new fields but we've never run into this issue before.

Looking to understand why FKs are being sent and if there is a workaround or setting.


MongoDB replicate data item across multiple shards

$
0
0

Is it possible to replicate a data item across multiple shards?

My end goal is to determine how up-to-date the data in a replica slave is. I'm only concerned with subsets of the data, so I don't think examining oplogs will work. Instead, I plan on having a counter increment in the master, every time a modification to the appropriate data occurs. Then, I can fetch the slave's replicated counter to see how current it is.

The problem occurs when I try to shard the data. I need the counter replicated across every replica, not just the replica set that owns the counter data item. So, I need some way to replicate the counter to every master shard, where it will then be replicated to each slave. Is this possible?

Modifications to the counter would still go through the master shard that "owns" the counter. Data reads would need to aggregate the counter value from each shard/replica, taking the minimum value. I read through the MongoDB documentation, and I really don't think it's possible. But perhaps one of you MongoDB experts/developers can shed some hope.

Someone on SO mentioned replSetGetStatus, which may be an option. However, I would like separate counters for different subsets of the data, where the replica status corresponds to all the data.

pglogical library

$
0
0

I would like to try pglogical to set up an archive server from a live database, filtering with INSERT, UPDATE statements (DELETE statements will not be replicated in the archive server).
I follow the official documentation but when i set shared_preload_libraries = 'pglogical' in my configuration file (postgresql.conf) the server could not start.

There is no pglogical file in ./usr/pgsql-9.6/lib/ directory.

How setting up all prerequisites to start properly (with v9.5 and 9.6)?
I am using PostgreSQL v9.5 and v9.6 for POC on CentOS 7.

Many Thanks.

pg_replication_slots: how to determine how far behind a consumer is?

$
0
0

Given the replication api exposed in postgres 9.6.6, for a given replication slot and a consumer, what system catalogs or view could inform how far behind the consumer was the latest state of the wal?

Set Identity_insert on - Merge Replication

$
0
0

I have merge replication set up between two databases and am using identity ranges on both.

I want to add a specific row to a merged table (setting the identity value to something outside of the identity range) on the publisher. When I try this, I get the following error.

The insert failed. It conflicted with an identity range check constraint in database 'xxx', replicated table 'dbo.yyy', column 'yyy_id'. If the identity column is automatically managed by replication, update the range as follows: for the Publisher, execute sp_adjustpublisheridentityrange; for the Subscriber, run the Distribution Agent or the Merge Agent.

Is there a way to force specific identity value into a merge replicated table that is using identity range management?

The process could not execute 'sp_replcmds' on

$
0
0

I am having a lot of trouble setting up transactional replication on my test server. I am running SQL Server 2008 SP2.

I am able to create a transactional publication. The snapshot agent works fine and subscribing to the publication works fine as well. The problem that I get is that the log reader agent fails with the error:

The process could not execute 'sp_replcmds' on [ServerName]

The snapshot and log reader agents are run under a windows account with administrator privileges on the domain and sysadmin privileges on the sql server. I have also tried running the agents under the SQL agent profile. I have tried executing sp_replflush and restarting the SQL agent. I have also tried increasing -LoginTimeout to 500 and -ReadBatchSize to 10.

Any help greatly appreciated.

Replication - User defined table type not propagating to subscriber

$
0
0

I created a User defined table type named tvp_Shipment with two columns (id and name) . generated a snapshot and the User defined table type was properly propagated to all the subscribers.

I was using this tvp in a stored procedure and everything worked fine.

Then I wanted to add one more column created_date to this table valued parameter.I dropped the stored procedure (from replication too) and also i dropped and recreated the User defined table type with 3 columns and then recreated the stored procedure and enabled it for publication

When I generate a new snapshot, the changes in user defined table type are not propagated to the subscriber. The newly added column was not added to the subscription.

the Error messages:

The schema script 'usp_InsertAirSa95c0e23_218.sch' could not be propagated to the subscriber. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001
Invalid column name 'created_date'. (Source: MSSQLServer, Error number: 207)
Get help: http://help/207

drop a foreign key constraint for replicated table

$
0
0

Can I drop a foreign key contraint from a table participating in merge replication? If so, can i just drop it from the published and will this chnage be replicated to all subscribes?


Check if Replication Enabled

$
0
0

What's the easiest way to check if replication is enabled in a SQL 2000, 2005, and 2008 compatible format? Don't need any status info...just to know if it's enabled for a DB. I need this because I want my Db Migration code to throw an exception if replication is enabled before it tries to perform schema updates.

Thanks.

SQL Azure Merge Replication

$
0
0

Does anyone know if SQL Azure supports merge replication? I am currently working with the web version of SQL 2008 R2 and it does not support the publication side of replication and I need a solution that will that doesn't cost $7000.

Transactional Replication with LocalDB

$
0
0

I searched everywhere but couldn't find an answer. I know LocalDB cannot be a subscriber to merge replication. But what about transactional replication?

I've tried both the SQL Server Management Studio and RMO programming to create a pull subscription to a publication with type of transactional replication, but it keeps telling me "replication is not installed on this instance of SQL server". There is no option for me or the user to select replication feature during the install. And re-installing LocalDB won't do any help.

I know it is possible to use sync framework to do the job but it is something new to me and I've already deployed LocalDB to the clients computer in my previous software release, so I prefer to stick around with the replication method before I know for sure that LocalDB doesn't support any form of replication.

To summarize my question: How do I create a pull subscription on a LocalDB instance to subscribe to a transactional replication?

BTW, the LocalDB is deployed to the clients computers using the bootstrapper came with Windows 8 SDK, which can be found in this directory if you have one installed: {C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages\SqlLocalDB2012}

I would be happy to provide more information if I didn't make it clear. Thanks in advance!

How to check replication snapshot agent status?

$
0
0

I'd like to check the status of the agent after I start it using this statement

EXEC sp_startpublication_snapshot @publication

As I want to do a next step that needs the job to be already started.

Distribution agent can't connect to subscriber

$
0
0

I have two servers on different untrusted domains. Server A is the publisher and is running SQL Server 2008 R2. Server B is the subscriber and is running SQL 2008 R2 Express. Since the servers are on separate domains without a trust relationship, I am using pass-through authentication to connect to each server. This involves creating a local windows account on each server with the same username and password and then using windows authentication to connect to the remote server. Using this method, I am able to connect Server A to Server B and vice versa in SQL Server Management Studio. I am also able to create a transactional publication on Server A and create a push subscription to it on Server B.

However when I open up the View Synchronization Status Window, I get the message "The process could not connect to SUbscriber 'Server B'." Opening up Replication Monitor gives me the following error messages:

The process could not connect to Subscriber 'Server B'. (Source: MSSQL_REPL, Error number: MSSQL_REPL0)

Named Pipes Provider: Could not open a connection to SQL Server [53]. (Source: MSSQLServer, Error number: 53)

A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (Source: MSSQLServer, Error number: 53)

Login timeout expired (Source: MSSQLServer, Error number: HYT00)

Everything else that I have read about this error says that it's a permissions issue, but I don't think this is the case. Just to make sure that there weren't any permissions issues, I made the windows accounts that I am using for the pass-through authentication local administrators on each server, db_owners on both the publisher and subscriber databases, and sysadmins on each instance of SQL Server.

Does anyone know if something other than permissions could be causing this error? What confuses me is that the servers are clearly able to connect to each other using the pass-through authentication, but the connection still fails at the distribution agent.

Replicate a filtered subset of data: Merge or Transactional replication?

$
0
0

First of all thanks for reading.

I need to replicate a subset of data that is based on a join filter; filter based on a join with an other table (Microsoft:"Using join filters, you can extend a row filter from one published table to another."). This is the setting:

  • SQL Server 2012;
  • replication sources on a subscription of a transaction replication
  • replication needs to be one direction sync (from publisher to subscriber);
  • only one subscriber/subscription;
  • small dataset with not many transactions;
  • WAN network.

What I established so far:

Option 1 - Create views and replicate those to tables via Transactional replication.

  • pros: no triggers are used,

  • cons: objects like key, constraints are not replicated

Option 2 - Use Merge replication with the join filter and set @subscriber_upload_options = 2 (download only).

  • pros: native MS functionality, all objects are replicated

  • cons: merge replication uses triggers, these won't be fired with bulk loads.

The results of these two approaches are exactly the same. However the technique differs, for example the different Agents that are used.To my understanding Merge replication is especially for server - client architectures, which is not my case but.. it works..

Because of the result is the same I am a bit in doubt which approach I should follow. I was hoping that you can give me some points to consider or advice me in which approach I should follow.

Is a Transactional Replication Snapshot processed as a 'bulk insert'

$
0
0

I have a Merge replication that sources on a subscription from a Transactional Replication. I know that the triggers regarding the Merge replication are not fired by 'bulk inserts':

Microsoft: When data is loaded into tables using the bcp Utility or the BULK INSERT command, by default, the merge replication triggers that maintain tracking data in the MSmerge_contents system table are not fired.

For establishing the transactional replication a snapshot is needed. Question: is the snapshot a bulk insert; will it not fire the merge triggers?


A trigger returned a resultset and/or was running with SET NOCOUNT OFF while another outstanding result set was active

$
0
0

I have 2 servers connected over a low speed wan and we're running SQL Server 2008 with Merge replication.

At the subscriber, sometimes when attempting to insert new rows, I get this error:

A trigger returned a resultset and/or was running with SET NOCOUNT OFF while another outstanding result set was active.

  • My database doesn't have any triggers; the only triggers are the one created by the Merge replication
  • Also, whenever this error occurs it automatically rolls back the existing transaction
  • I am using DataTables and TableAdapters to insert and update the database using transactions

What I have checked:

  1. the database log file size is below 50Mb
  2. Checked the source code for Zombie transactions (since I wasn't able to retrieve the actual error at the beginning)
  3. Checked the connection between the two servers and found it congested

Questions:

  1. How to avoid this behavior and why it's occurring at first place?
  2. Why it's cancelling the open transaction?

Transactional replication errors

$
0
0

I'm trying to set up transactional replication in SQL Server 2012 using AdventureWorks 2012. And right at the end of the publications setup i get the following error:

SQL Server could not start the Snapshot Agent. Additional Information: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) SQL ServerAgent is not currently running so it cannot be modified of this action. Changed database context to 'AdventureWorks2012'.(Microsoft SQL Server,Error 22022)

I'm guessing this error isn't allowing me to execute the following code:

USE ADRepl;
SELECT * FROM Person.BusinessEntity

As every time I do execute this I get the following error:

Msg 208, Level 16, State 1, Line 2 Invalid object name 'Person.BusinessEntity'.

Merge replication changing rowguid

$
0
0

We have a diversified environment. It is composed by 194 publishers and the total of 209 subscriptions.

The publisher and distributor both are SQL Server 2008 R2.

As subscribers we have 2008 R2 (different versions and sps) and 2000 (different versions and sps).

We separated the total of tables in some publishers to be more organized.

We insert the row at subscriber, and somehow it shows at publisher with exactly the same values and pks, but with different rowguid. The gen_status is always 1, saying that the row is created there, but it isn't. On Merge replication, it happens a lot with us.

We searched all over web and didn't find out what the problem is.

Kubernetes scale down specific pods

$
0
0

I have a set of Pods running commands that can take up to a couple seconds. There is a process that keeps track of open request & which Pod the request is running on. I'd like the use that information when scaling down pods - either by specifying which pods to try to leave up, or specifying which pods to shut down. Is it possible to specify this type of information when changing the # of replicas, e.g. I want X replicas, try not to kill my long running tasks on pods A, B, C?

Tomcat 8 DeltaManager vs BackupManager session replication

$
0
0

I'm going to configure 2 nodes cluster with a separated AWS EC2 instances with Tomcat 8 installed.

I need to configure Tomcat session replication.

According to Tomcat 8 documentation Clustering/Session Replication HOW-TO:

In this release of session replication, Tomcat can perform an all-to-all replication of session state using the DeltaManager or perform backup replication to only one node using the BackupManager. The all-to-all replication is an algorithm that is only efficient when the clusters are small. For larger clusters, to use a primary-secondary session replication where the session will only be stored at one backup server simply setup the BackupManager.

Could you please tell me what does it mean - clusters are small ?

Is it 2.. 5..100... 1000 nodes or what ?

Viewing all 17268 articles
Browse latest View live