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

Why 'Views' need to be replicated?

$
0
0

Assuming View1 is based on Table A,B and C on Server1. Table A,B and C are replicated to Server2 using Transactional Replication.View1 is created on Server2.

ASK:
So will View1 on both the servers reflect the same data (discounting the replication delay)?
If they do, then what are the other reasons we replicate Views?
If the script of a View is changed at Publisher, do the changes reflect on the subscriber?


Is it possible to ignore NOT FOR REPLICATION in Visual Studio's Schema Compare?

$
0
0

I have two environments: dev and test. Dev has a single SQL instance. Test has three which use merge replication.

When I use Schema Compare between dev and test, every table is always flagged as different because the tables in Test have a few replication artifacts:

  • A generated unique ID for replication: [rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL CONSTRAINT [MSmerge_df_rowguid_DDDF85B24558D414B8FD278B2219C33A]
  • The primary key marked as NOT FOR REPLICATION (I see there is an option to ignore this in the General tab in Schema Compare Options)
  • CONSTRAINT [repl_identity_range...] that requires the primary key be within the range assigned to that instance

Is there a way to ignore the rowguid column and the repl_identity_range_... constraint when running a schema compare?

Only kill kubernetes pod if not busy

$
0
0

I want to scale my deployment depending on the amount of requests. Each pod can only handle a request at a time. Scaling up is no problem, but when I want to scale down I want to make sure I am not killing a pod that is working right now ( e.g. encoding a large file).

I have the folling pods:

  • Pod 1 (created 10 min ago, has a task)
  • Pod 2 (created 5 min ago, is free)
  • Pod 3 (created 1 min ago, has a task)

If I reduce the replica value, kubernetes will kill pod 3. It does not care if the pod is busy or not. I could manually kill pod 2, so kubernetes would start a new one:

  • Pod 1 (created 10 min ago, has a task)
  • Pod 3 (created 1 min ago, has a task)
  • Pod 4 (created just now, is free)

After I know pod 2 got killed I could reduce the number of the counter, so pod 4 will be killed before getting a task. But this solution sounds very ugly, because someone else has to tell pod 2 to shut down.

So kubernetes will kill the last created ones, but is it possible to tell him, that a pod is busy and he has to wait before it will be killed?

Can merge replication operate with 0 ms delay, i.e. be real-time?

$
0
0

I'm facing an issue that I have two identical databases on different servers and both working as read/write and data are inserted on both. The thing is there is a merge replication between the two databases and it's working fine but there is a minute delay until the data is synchronized. What I want is to remove this delay. I want the data to be synchronized immediately.

What kind of solutions can I apply? Is there another feature like replication but without delay, or can I make the replication work without a delay, i.e. to be real-time. Any suggestion please. Appreciate the help.

Merge Replication - Invalid Column Name

$
0
0

Good Day everyone,

I am battling with a merge replication. I added a new column to an existing Merge Replication and Rerun the snapshot.

This replicates to 3 different servers in different locations. 1 Replication works perfectly, but 2 of the replication fails with the following error:

The schema script 'ProductionCategories_8.prc' 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 'SortOrder'. (Source: MSSQLServer, Error number: 207) Get help: http://help/207

When viewing the table where the referenced column is located the Column is in both the publisher and relevant subscribers.

I also checked spelling and case to ensure there are no Case Sensitivity or silly spelling mistakes, but all is fine.

I really need to get this sorted as group reporting is being hampered by this.

Any suggestions will be greatly appreciated.

MongoDB 3.6 replica stuck on STARTUP

$
0
0

I am using mongodb with two servers physically located in respectively Italy and France.

The France server runs Ubuntu server is the Primary of the replica set, and works fine, i.e it accepts connections from mongo shell whether locally or remotely and is continuously updated by a python client.

The second server in Italy works fine standalone with CentOS, but get stuck to STARTUP status when starting as part of the replica set. The log indicates that it received the configuration from the primary.

I tried a several things to fix the issue but none of them works:

  • Try to use keyfile (or not) between members of the replica set.
  • Check the Firewall is open on both sides with nmap
  • Add iptables rules to assert the mongodb port accept in/out traffic.
  • Check mongod is up and listening on all IP on both sides.
  • Configure (or not) the same admin user on secondary before restarting with --replSet. This step can only be done when secondary is standalone, since started as member of the replica set, it is stuck in transient state and thus it does not accept user creation. Hence it follows that login to the secondary fails.

Also both members (France:primary and Italy:secondary) are started with --auth, --replSet rs0, --keyFile.

I researched the issue on the web before, and found the closest answer here:MonogoDB Replica Set Status Not changing from Startup to Secondary

But the author mention that the secondary did not received the configuration which makes the issue different than this one.

Thanks for your help.

Merge Replication - Detect nonlogged agent shutdown

$
0
0

I have never worked with SQL Server replication and am now in an environment with SQL Server 2012 merge replication. On 3/29 and 3/30 there are 13 of 19 replication jobs which are failing with detect nonlogged agent shutdown on the subscribers.

The publisher and distributor are on the same server. There are 2 publications which are failing. Some of the errors are

The process could not connect to Subscriber

and some errors are

The merge process failed because it detected a mismatch between the replication metadata of the two replicas

I am able to successfully ping the publisher from the subscribers.

All revalidations are failing. Do I need to recreate the subscribers? SQL Server Express is running on the subscribers.

Thanks..

Merge replication with Filestream

$
0
0

I have the scenario where I am using a FILESTREAM enabled table to upload and download files from.

I need the files available in two instances, database A and database B. Files can be uploaded to both A and B and must be synced to the other party. There is no restriction on uniqueness, identical files might be uploaded to the databases. Note the table to be replicated is used only for the files and nothing else.

How reliable is a Merge replication in this case? Some of the files can be up to 2GB in size. Is the replication revertible, i.e. if it fails midway while streaming the files to the other database will all the changes, caused by the replication, be rolled back?


Where Merge Replication actually stores data?

$
0
0

I've read some non-official articles that say merge replication actually stores data as transactions and replicate them as transactions. But no official info about that on MSDN or any kind of official sources I could reach.

Please, can someone make it clear for me? If it stores transactions - is there any link in MSMerge_contents to the corresponding transaction? How come that it filters inserts/updates/deletes as it said here?

If it does not replicate transactions, where it stores actual data for replication?

In my own opinion Merge Replication does not use transaction log to store data.

Table triggers (MSmerge triggers) transforms each transaction in incremental generation information and stores that information in system metadata tables MSmerge_contents, MSmerge_tombstone and MSmerge_genhistory where you can join each table by tablenick and use rowguid column to find row (for MSmerge_contents and MSmerge_tombstone).

Replication Agent compares contents of MSmerge_contents for publisher and subscriber, it copy new rows and change existing depending on rowguid column and generation number of each row. It uses actual rows in actual tables, joining by rowguid. Same thing for MSmerge_tombstone table.

It does not use transaction log. It also does not even have Log Reader active.

SQL Server replication datatype change from tinyint to int

$
0
0

I am trying to change the datatype of one of the columns of a table which is there in the publisher by using the alter command.

And trying to see the changes done at the subscriber end of the table after running the agent. However I'm unable to see the changes.

Please guide.

How do I replicate a temporal table

$
0
0

I have a temporal table, and I want to replicate it using transactional replication. The history table cannot have a primary key required for transactional replication. When I try replicating the current table, replication fails because it cannot insert into the GENERATED ALWAYS AS ROW START or GENERATED ALWAYS AS ROW END columns.

SQL Server 2012 Merge Replication - Full Text Indexes

$
0
0

I have an issue setting up merge replication on a SQL 2012 instance.

The push of the snapshot to the subscriber is failing and the reason I discovered was because there is a SP that uses a Full Text Index that has not been generated on a table.

A lot of searching about revealed that there is a property that is false by default that defines if a full text index should be copied.

Copy Full text indexes

I thought I had found the solution, set this property to true and triggered a new snapshot, however, the same issue was still encountered and when I went back to check the property the copy full text index property was set to false again??

I have tried a few times in the hope it was just me forgetting to save or something, from what I can see, the property stays at true until the snapshot is rerun, after that the property is back at false again, I am wondering if I have come up against a bug in SQL server, however, a google does not appear to indicate this is true.

I have tried deleting and recreating the publication. I have also tried disabling the distributor and publisher in order to force a fresh distribution DB to be created, thinking that maybe there is a corruption somewhere.

Both servers are running SQL Server 2012 on Windows Server 2012R2

Does anyone have any fresh ideas?

removing an object from Publication database sys.sp_droparticle and sp_dropsubscription

$
0
0

SQL Server Admin is not my forte. So please bear with while I explain this
A SQL Server 2012 cluster is involved in a Change data capture ( CDC ) effort using a 3rd party CDC utility. for it to work replication needs to be turned on, without replication CDC will not work. The CDC taps some 2000+ odd tables from SQL Server in a database Db1. Out of these we found out that some 200+ tables undergo truncate and load as against increments. So we removed those from our CDC lists but since replication is turned on at DB Level we also need to remove these from publication database so that truncates happening to this exception list wont need replication switched off DB level ( aka truncates to these tables and replication can co-exist. As its known, for truncates to happen we need to switch off replication. The code is in prod so replacing truncate by delete is not an option now besides the fact that for billion row tables deletes are going to be expensive & time consuming )
The above is the requirement. So based on that if a better solution can be conceived do let me know
What I tried :

EXEC sys.sp_droparticle @publication = 'pub', @article = 'art', @force_invalidate_snapshot = 1

Error I get

Msg 14013, Level 16, State 1, Procedure sp_MSrepl_droparticle, Line 104 [Batch Start Line 2]
This database is not enabled for publication.

Another SP

DECLARE @subscriber AS sysname;

EXEC sp_dropsubscription @publication = 'AR_PUBLICATION_00010', @article = 'BPA_BRGR_RUL_GRP_R' ,@subscriber=@subscriber

Msg 14013, Level 16, State 1, Procedure sp_MSrepl_dropsubscription, Line 55 [Batch Start Line 1]
This database is not enabled for publication.


But using GUI I am able to uncheck the tables I dont want in that publication. ( right click publication --> properties --> articles --> check /uncheck whatever you want excluded ) . I dont have any subscription just there is a publication.
Whatever code I ran through GUI above I can def. run through T-SQL But I dont know what code was it that was run ? How do I get this done using a scripting approach. I have 200+ tables to deal with and unchecking em 1 by 1 ain't helping

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 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..?


My subscriber database lost connection to the publisher and expired. Can my data be saved?

$
0
0

I have a publisher database A and I have two subscriber databases B and C that subscribe to A. My application resides locally at sites B and C and through replication, changes at B and/or C are replicated to each other.

The problem is since 31 January 2019 C stopped subscribing to A and the IT guys at site C didn't know about it (no alerts).

The bigger problem is that during this time, people using the application at B have been entering data which is replicated back to A. At the same time, people at site C have been adding data to database C which was not replicating back.

If I reinstate a subscription, it will take the data at A and overwrite C which is a major problem because I will lose the data added during this time at C. Since this is health data, it's all encrypted and stored in xml format and it's not as simple as just updating the data which was missing because some files are shared between sites B and C which means they would add data to the saved xml tree.

As an example, if someone sees a patient at site B and enters a note, it updates one file. But then if same patient goes to site C the next week, the nurse there will update the same file that was updated at B.

I have no clue how do I sync back the updates made at C first before reinstating a new subscription.

If anyone has any advice that would be greatly appreciated thanks!

How to find out more on error in merge replication in SQL Server?

$
0
0

Error that we are getting is:

Error converting data type nvarchar to numeric. (Source: MSSQLServer, Error number: 8114)

This kind of error is not so descriptive so we don't know where to look next. Does anybody know where to look on more descriptive error then this. I mean a system table that holds more info or a view.

We have all objects in replication.

Thank you

SQL Server Replication Issue

$
0
0

I have two locations that was replicating data using sql server merge replication process. I upgraded the db and now I am trying to setup the replication again on the new database. However, I am concern about how do I keep the data that has not been sync during the offline period such that when the replication is backup all data can be correctly merged and updated. Otherwise data will be lost between the target/subscriber database.

Is there an approach I should take to prevent this or How should I go about merging the data before or after replication.

How to change existing triggers to be with 'not for replication' in merge replication in SQL Server?

$
0
0

How to make a script that will change all triggers in a database to be NOT FOR REPLICATION? Is there a system procedure for it or we need to parse its definition and inject NOT FOR REPLICATION?

What will be the best way for Server to server data transmission in an offline satellite environment with low bandwidth [closed]

$
0
0

We have a customer which connects to our servers through Satellite. However, they have a major concern that the facilities in which they want to run our applications, at many times have connection issues. So, they want to run our applications locally (on specific PC's). Data from the host system would feed to the local machines continuously. If the connection is lost, the PC still have enough data to conduct it's business until the connection is restored. At that time, the data changes from the PC are reflected back to the host system and visa versa.

I guess we would be considering some type of replication (this is all new to me). This has many questions but here are the main ones.

  1. If we replicate, then they need a copy of SQL Server on each PC. We are talking about 60 sites which would be very expensive due to licensing. Also, other support costs.

  2. Is it better to always run replication or only in the event that the connection was lost?

  3. How does the local system get in sync with the hosted system?

Just looking for a better/less expensive solution.

Viewing all 17268 articles
Browse latest View live


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