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

SQL Server Merge Replication - Adding Pull Subscription with modified Publication Properties to an environment with existing Push Subs

$
0
0

Scenario is as follows:

  • Existing publication with only push subscriptions under a Merge Replication environment
  • Distributor resides on the Publishing Server

I would like to add a unidirectional (publisher to subscriber only) pull subscription to this environment without modifying the existing push subscriptions.

This pull subscription needs to exclude certain articles that are currently being pushed to the other subscribers.

This pull subscription also has a different set of publishing properties for one specific article. In other words, Table A and Table B reside on the Publisher and share the same table structure(columns) but differing data. Table C exists on all subscriptions. Table A is currently being pushed to Table C on the Push subscribers, but I want the Table C residing on the new Pull Subscription to pull data from table B of the Publisher.

1) Is it possible/recommended to have a replication environment containing a mix of push and pull subscriptions?

2) Can I modify publishing properties/published articles of just the Pull subscription without affecting the existing environment?


Replication SQL Server 2008 to Azure SQL DB login failure

$
0
0

I am trying to setup replication from SQL Server 2008 R2 (publisher and distributor) to Azure SQL database (subscriber). I configured the subscription on the SQL Server 2008 side (push) with a SQL Server User.

In the replication job I see the following error: 2018-10-15 13:53:11.381 Agent message code 20084. The process could not connect to Subscriber ''.

On the subscriber (Azure SQL DB) I see the following in the audit log:

additional_information  <login_information><error_code>18456</error_code><error_state>132</error_state></login_information>
database_principal_name (is empty)
succeeded   False

From this site I understand that error state 132 means AAD error. This is something I don't understand as I am using a SQL Server user.

I am able to connect to the Azure SQL DB from the publisher server using management studio and logging in with the SQL Server account.

Johan

Microsoft SQL Server 2014 Monitoring Replication Stats/Windows Failover Application Cluster

$
0
0

I am struggling to find a suitable tool, which could be installed on a Windows server, to remotely monitor Windows 2016 server CPU/MEM/Hard Disk/Services and SQL Server transactional replication statistics.

I have done it through Nagios Core, but I am struggling to find a free or open Source, Windows installable tool, to monitor Replication Statistics. I have setup push subscription as part of the transactional replication.

The replication parameters I am trying to monitor are:

  1. Real time status of the Replication (Whether it is running fine or not)
  2. Transactional Replication Latency( from Publisher to Distributor and from Distributor to Subscriber)
  3. The number of records in the Distribution Database.
  4. Tool should have a Dashboard and should have option to configure emails.

Also I need to monitor:

  1. Windows Failover Cluster Monitoring
  2. IIS (whether up or down)
  3. Application Pool (up or down) 4) Website (up or down)

As I said initially, I was able to do most of these through Nagios Core, but I require a windows based solution, which is free to use.

All suggestions are highly appreciated.

Thanks in advance.

Automatically restart SQL Server Replication after server restart

$
0
0

After restarting the Windows Server on which SQL Server is running I get the following error in my Application Event Log:

Replication-Replication Distribution Subsystem: agent <name removed> failed. The subscription(s) have been marked inactive and must be reinitialized. NoSync subscriptions will need to be dropped and recreated.

Is there any way to automatically reinitialize the subscription or what is the best way to restart a server with replication running on it?

Johan

SAP LT | populate delete record in other table

$
0
0

I have standard SAP R/3 table replication through SAP LT on target HANA. Table is LQUA for determining WM invenotry. Whenever inventory goes to zero record is deleted from LQUA due to which we are not able to find materials with zero invenotry. Is it possible to replicate ONLY DELETED RECORDS in separate table and normal replication in LQUA.

Sql Server replication - add articles without using wizard

$
0
0

I have done transnational replication to my SQL Server 2014 instance.

There are two db servers subscribing to it. Currently I have added only some of the tables (10 tables) as articles to replicate. However, in the future there will be new tables added to the distributor database that needs to be included as replication articles.

I know that whenever I want to add a new article to the replication, I can go to the Properties of publication and add new articles through the wizard.

However, my problem is that there are some tables added by an application through T-SQL queries.Those tables need to be replicated. So there is no way I can go to the wizard and add those to articles.

Is there a way that I can add articles to the replication through a T-SQL? or Is there any system stored procedure or anything we can use to add articles to replication.

Solr 7.5 nodeAdded event behaviour

$
0
0

In Solr 7.5 there is nodeAdded event. However when I try to use it (running solr in local mode), it's behavior is quite strange. Let's assume I have 2 nodes and each node has one shard with 2 replicas. I have the following trigger defined:

{
  "set-trigger": {
    "name": "node_added_trigger_aa",
    "event": "nodeAdded",
    "waitFor": "1m",
    "preferredOperation": "ADDREPLICA",
    "enabled": true
  }
}

When I add a new node (so there are 3 nodes) one becomes empty, one is not changed and one starts to create a massive number of replicas. I checked and I don't see any recurrent triggers (I only added one posted above).Solr admin UI screenshot

Do you experience the same issue? If you managed to get proper behavior please share the idea.

It may be related to this question: Solr AutoScaling - Add replicas on new nodes

SQL Server replication - Create new publication error

$
0
0

I am trying to create transactional publication as part of replication SQL server database.

Steps:

Right click on Local Publication -> New Publication Select "Transactional Publication" for the Publication Type

Then the Articles Window appears and it gives me the following error.

New Publication Wizard encountered one or more errorrs while retrieving the list of articles on 'DBNAME'. The list of articles may not be complete.

Additional Information: Data is Null. This method or property cannot be called on Null values. (System.data)


SQL Server Repl: Mark Pull subscriptions for reinitialization from Publisher

$
0
0

I have a transactional replication created where the subscriber gets initialized with a snapshot.I want to mark the subscriber for reinitialization from the publisher end.

I ran EXEC sp_reinitpullsubscription on publisher DB but that can only be run on the subscriber. exec sp_changepublication is not my friend either. There is an option using the UI "Reinitialize All Subscriptions" when right-clicked on the publisher but I am not able to find the SP that matches that.

enter image description hereMark for reinit option

Both - using the UI, running TSQL at the subscriber are not options for my scenario. I can only run TSQL at publisher. What repl sp can I use?

TDE protected db replication to Azure

$
0
0

I have a TDE protected database which I want to extend to Azure using replication. My question is, do I have to restore certificate on the Azure database before I start setting up the database as the subscriber?

Could not execute 'sp_repldone/sp_replcounters'

$
0
0

When I am trying to run the replication I an getting the error in LogreaderAgent

could not execute 'sp_repldone/sp_replcounters'

I followed all the following step what could be the possible solution but still, I am getting the issue.

  1. I stopped the agent and then run

    EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1

    and

    EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 0

  2. ran the command

    sp_replflush

  3. Also ran the command

    sp_replrestart

  4. Even I deleted the publication and recreated but still, the issue exists. Feeling very frustrated even after trying all possible solution but could not solve the issue

If anyone knows any solution apart from the above mentioned then please let us know.

Thanks

Datetime field not in sync in Transactional Replication - does default value matter?

$
0
0

I run 2012 SQL Server and I use the Transactional Replication to sync data to the replication server. I have no control over the application which uses the database.

  • There is a table with the column ChangedWhen, DEFAULT VALUE GETDATE().
  • The App does INSERT("varchar","varchar"...) -> and relies on the Default value for ChangedWhen
  • The ChangedWhen in the replicated database differs from the main database (anything between 200ms to 10s), as it most likely uses GETDATE() instead of a value.

I ran Wireshark to analyse what the application does.

I expect to have CreatedWhen column in sync with the replication, so the latency between the insert and actual insert in replication db doesn't affect the value of the column. Has anyone experienced anything similar?

Merge Replication On Live SQL Developer

$
0
0

I have successfully configured merge replication on my local SQL server by creating two instances making one as Publisher and other as distributor. Now to show demo to my client i need it to configure live by making my local system as Subscriber and any live sql server as publisher, can any one guide me that where should i configure live server ? As if i go to any paid SQL Standard edition it will cost me more than my salary , i just need to show demo to client. Can i install SQL Developer on any windows hosting? or there isn't any other option than buying server

SQL Server replication: TCP Provider: The semaphore timeout period has expired

$
0
0

I'm getting following error from SQL Server 2014 Push Transactional Replication Distribution Agent:

Replication Distribution Subsystem: agent 'agent-name' scheduled for retry. TCP Provider: The semaphore timeout period has expired.

This it is caused by a transient network hiccup. However, after connection is back and other applications resume working the distribution agent still reports that it is retrying (unsuccessfully).

Agent 'agent-name' is retrying after an error. 6 retries attempted. See agent job history in the Jobs folder for more details

The problem is solved by removing replication and setting it up again with new snapshot transfer, but this is problematic on the production environment. Sometimes the problem was resolved by restarting the SQL Server Agent service. The TCP Chimney Offload is disabled. The distribution agent parameters are mostly default. The replication load is quite low mostly without undistributed commands in the queue. Any ideas what is the root cause and why the replication is impaired permanently and retries don't work?

How to disable default constraint synchronization on sql server publisher object

$
0
0

I have configured a sql server transnational replication. it includes one table A, and when I add a default constraint for one column of table A on publisher, it will sync to subscriber object by default.

Is there any one option to disable this behavior. just because the data on subscriber table should be from publisher database, there is no need to sync all these constraints to subscriber.It does not make sense.


SQL Server replication model snapshot, transactional and merge - which is best [closed]

$
0
0

I am trying to implement sql server database replication between 2 branch servers to a Head Office Server.

My application is a distributed one, the main application is hosted on head office which is controlling the masters and final approvals. The branch servers are located on two other countries, which are used to enter daily transactions.

Since internet bandwidth is too slow, I am planning to run the replication only on off hours (ie.. night 12 AM to Morning 8 AM). During business hours it is difficult to synchronize. All tables are designed such a way to validate and avoid duplication or other errors.

Also there are chances of internet outage for couple of days.. may be up to a week.

There are three type of tables,

  1. BI Directional - Needs to sync between both sides(HO to branch and branch to HO, Approvals)
  2. Sync from Branch to HO (Transactions)
  3. Sync from HO to Branches (Masters)

When I configure replication, I am confused between different types of replication such as snapshot, transactional and merge replication.

Can anybody suggest which one is the best method for my model

I am also facing some issues with Primary key and foreign keys lost after configuring replication.. Any idea why this is happened..?

AWS DMS (Database Migration Service) SQL Server to SQL Server not replicating changes

$
0
0

I have 2 AWS SQL Servers (as RDS instances) in the same VPC, however one is in a private subnet (the source) and one is in a public subnet (the target). I am replicating FROM SQL Server Standard Edition TO SQL Server Web Edition.

I have set up DMS (Database Migration Service) between them to do a full table load, then replicate ongoing changes. The initial load occurs without issue, however ongoing changes are not repicated. When I check the table status, I can see that the last updated date-time is continually updating, however as you can see, there are no inserts or updates being tracked. These figures remain 0.

enter image description here

The status of the migration task is: Load complete, replication ongoing The source database backup model is FULL (Was SIMPLE, but realised this wouldn't work so it's been changed to FULL).

The CloudWatch log is just repeats of the below:

2019-03-02T23:13:22 [SOURCE_CAPTURE ]I: Throughput monitor: Last DB time scanned: 2019-03-03T10:12:37.947. Last LSN scanned: 00065a3e:00030286:0003. #scanned events: 183. (sqlserver_log_utils.c:4565)
2019-03-02T23:15:22 [SOURCE_CAPTURE ]I: Throughput monitor: Last DB time scanned: 2019-03-03T10:15:04.940. Last LSN scanned: 00065a3e:0003040e:0003. #scanned events: 413. (sqlserver_log_utils.c:4565)
2019-03-02T23:17:22 [SOURCE_CAPTURE ]I: Throughput monitor: Last DB time scanned: 2019-03-03T10:16:54.523. Last LSN scanned: 00065a3e:00030463:0003. #scanned events: 188. (sqlserver_log_utils.c:4565)
2019-03-02T23:19:22 [SOURCE_CAPTURE ]I: Throughput monitor: Last DB time scanned: 2019-03-03T10:19:12.697. Last LSN scanned: 00065a3e:0003053d:0003. #scanned events: 402. (sqlserver_log_utils.c:4565)
2019-03-02T23:21:22 [SOURCE_CAPTURE ]I: Throughput monitor: Last DB time scanned: 2019-03-03T10:21:22.300. Last LSN scanned: 00065a3e:000305d3:0003. #scanned events: 225. (sqlserver_log_utils.c:4565)

Which is different to when the full load occurs when the task is started, which details many tables being copied across etc. I've stop/started the task, I've tried changing the behavior from truncating target tables to drop and re-create etc, but none of this has any effect. There is no 'last failure message' listed in the Dashboard, nor is there any CDC start position or recovery checkpoint:

Change data capture (CDC)
Change data capture (CDC) start position
-
Change data capture (CDC) recovery checkpoint
-

Task status never seems to change from CHANGE_PROCESSING

server_name task_name   task_status status_time pending_changes disk_swap_size  task_memory source_current_position source_current_timestamp    source_tail_position    source_tail_timestamp   source_timestamp_applied
localhost.localdomain   TIXLNKU6OELULHNTU2G5IABSF4  CHANGE PROCESSING   2019-03-02 23:25:12 0   0   927 00065a3e:000306a5:0003  2019-03-02 23:25:11 000659f3:00000540:0004  2019-03-02 08:37:28 1970-01-01 00:00:00

There are no errors in awsdms_apply_exceptions.

Can someone please assist as to why replication is not occurring?

Replicate TBs of data between AWS rds and on premise sql instances in < 5 mins

$
0
0

I have just started a project with some fairly daunting requirements. Company A uses an application that writes records to Company B. The task is to move/update/sync very large amounts of data (195 tables and 2500 gb of data, millions and millions of rows) from an AWS RDS sql instance (Company B) which I believe is sql 2017, to an on premise instance (Company A) which is 2016. The acceptable threshold for latency is <=5 mins. We only have read access to the source and cannot install anything there so the traditional means of replication are not available.

There is 1 central table we'll call table A, which has a primary key defined (TableAID). The rest of the tables have a foreign key relationship to Table A, and they also have their own primary keys defined with other relationships between them. The "gotcha" to all of this is that when there is an update to the source, all data is dropped and reinserted thereby creating all new primary keys, with the exception of TableAID. So TableAID is the only primary key that persists and can be counted on. The other tables will still maintain their relationships, but with different primary keys after an update. This makes updating the target with deltas very difficult with all of the one to many relationships. In addition to this, Company B will archive data from time to time and we at Company A will have to sync existing data while retaining the data that was archived and no longer part of the data stream.

We explored using SSIS for this but can't get anywhere close to the latency expectations. After some digging in other forum topics I ran across a recommendation to use MS StreamInsight. I am not familiar with this, but if it will work as a means of real-time replication, I can get up to speed. I am not tied to any particular technology, but having said that, my background is with the MS toolset. Before I invest tons of time with StreamInsight, I would like to get an idea if this is a viable solution to my problem. Any other recommendations are also welcome!

Thanks!

Transactional replication re-configuration have problem

$
0
0

I am using SQL Server 2008 R2. I have configure it for Transactional replication. For some reason, I decide to re-install main server. So I get backup of database from main server and re-store it on backup server, and now our backup sever was the main server. As the main server gone for installation.

When my main server get ready, then I get .mdf and .ldf files from backup server and attach these files to main server. In this way my main server was back again and It is working fine.

But when try to re-configure the replication. its giving the error invalid object name 'dbo.syspublications (Microsoft SQL Server, Error:208). During trouble shooting I feel that System Tables from the database are missed.

Now please help me how I can fix this issue. I have all these table in old database .mdf and .ldf, but how I can put all these tables System Table folder. Is there any other way to solve this issue?

How The types of the replication work, And which type i should use?

$
0
0

I have two servers and i want use the Replication, I am confused for understand the different between the four types of the replication(Merge, Peer to Peer, Transaction, Snapshot). can I receive any answer?

Viewing all 17268 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>