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

Init a Transaction Subcription from Backup - What if the data was filtered and/or not all tables.?

$
0
0

Fellow SQLers,

On SQL 2016 Standard

I am planning to rebuild a replication.

The primary db is 1.3 tb. So, the snapshot process will be a monster.

The subscripber will not be exact as publisher - not all tables, not all fields for some tables, and some data is filtered.

I was reading Initialize a Transactional Subscription from a Backup.

https://docs.microsoft.com/en-us/sql/relational-databases/replication/initialize-a-transactional-subscription-from-a-backup?redirectedfrom=MSDN&view=sql-server-ver15

I am interpreting that I would not be able to use this approach.

Thoughts?

Thanks,

MG


SQL Server 2019: Logreader broken

$
0
0

The transactional log reader seems to be broken in sql server 2019 RTM.

I upgraded my test environment and run in the problem that the second step in the sql server agent job (run agent) is only doing retries because it fails.

The only output you get (even with Outputverboselevel 2) is the one below with an empty text '' message.

2019-11-12 10:16:30.566 Microsoft SQL Server Log Reader Agent 15.0.2000.5

2019-11-12 10:16:30.566 Copyright (c) 2016 Microsoft Corporation

2019-11-12 10:16:30.582

2019-11-12 10:16:30.582 The timestamps prepended to the output lines are expressed in terms of UTC time.

2019-11-12 10:16:30.582 User-specified agent parameter values:

                                    -Publisher WIN-4LTCDQ485TB

                                    -PublisherDB test

                                    -Distributor WIN-4LTCDQ485TB

                                    -DistributorSecurityMode 1

                                    -Continuous

                                    -Outputverboselevel 2

                                    -Output C:\Temp\output.txt

2019-11-12 10:16:30.597 Status: 0, code: 20015, text: ''.

2019-11-12 10:16:30.597 Disconnecting from OLE DB  ''

Problem can also be reproduced on a fresh installation of sql server 2019 on a fresh windows server 2019 vm.

Can someone else confirm or has a working logreader on sql server 2019?

SQL application aware replication

$
0
0

Hello

I have an on-prem SQL server 2016 which uses to my web application. This SQL server also has other databases/tables as well. So I want to replicate only the changes in my database with table wise. Appreciate if you can suggest me any possible method. Note that I have Azure subscription.  

Thanks

Sin

Identifying if a Stored Procedure that has FOR Replication is being used

$
0
0

Fellow SQLers,

I am getting ready to move a pub and sub replication to other servers.

I happened to find a sp on the pub db that has FOR REPLICATION in the header.

But when I dump the pub script, I can see only one filter and the filter has similar code that the sp has. The sp is NOT referenced in the Filter. Is likely this is an old/dead sp.

How would I go about validating if this sp is actually being used for replication? I know of no other way than dumping the pub.

Thanks

MG

Transactional Replication - Disaster Recovery Steps

$
0
0

Hi,

We have  SQL2016 server with multiple databases and we have some of the databases using the Transactional replication and the subscriber and distributor is in same data center.   We using zerto to replicate these boxes to DR datacenter. Question is, in DT situation, if we bringup the publisher server as of 10.05am  and Distributor as of 10.00am and Subscriber as of 9.55am.

Publisher is latest and other 2 are 5 and 10mins behind.   Will the replication automatically pickup and continue or since the Publisher is 5 min ahead of distributor, so will it not get those transactions happend in 5mins, because on primary datacenter, logreader already read the tlog and marked those completed.

Similarly, if the distributor has already delivered some transactions to subscriber and again if those transactions are coming to distributor and tries to deliver to subscriber, it will throw an error right.

Logreader agent and Distribution Agent, both mark the transactions/repl commands as completed.  If we keep the history, will it work fine with out losing any data.

Thanks



ao


questions about custom indexes on replication target tables

Replication- table replication with filter

$
0
0

hi,

we have transactional replication from serverA to ServerB ,  accounttable to accounttable. (publication contains 130 articles).

as of now all columns in accounttable replicated to supscription.

new requirment:  column "Price "@accounttable  in subscriptiondb  needs to update from other table value.  

how can i accomplish  this ?  shall i write another synchronize job to update this column alone or add filler in article property?

this table is high transaction used one . which way is advisable ?

what is the difference between replication options proc exec and definition only?

$
0
0
I understand proc exec option as for example when you run a procedure which inserts 1000 records into table, those inserts afterwards (after they were inserted in Publisher) will be replicated to the subscriber. When it comes to definition only option, I do not understand how it differentiate from proc exec option. I tested those options on my servers and for me it turned out performing the same thing. I didn't find detailed explanation about these options even on BOL. Could someone explain to me the difference between above two options?


Is subscription database considered as read-only?

$
0
0
I am not sure about that because while users implement SELECT from subscription database, publisher replicates data to the subscription server meaning that INSERT and UPDATE also take place(which are done with the distribution agent) in subscription database along with SELECT. The purpose of asking this question is that I am thinking about implementing indexed view on my subscription database. As we know, indexed view is a great choice for read-only database as we do not UPDATE/INSERT/DELETE rows from those tables.

How does DBCC CHECKDB use tempdb?

$
0
0
I would like to know the working principle of DBCC regarding the tempdb. I want to know why it uses tempdb for what purpose. I didn't find any advanced article about that so maybe someone can shortly explain or at least share links for the article about that.

Netbackup interfering with SQL server log shipping/replication

$
0
0

Hi

We currently have Netbackup configured on our Production database and we can thereby shrink the logfile size so it does not keep growing. 

We are now enabling log shipping on our primary db so that we can replicate the data to another server. We noticed that with that enabled there is backup happening via log shipping besides the netbackup scheduled earlier. so when we try to restore the log shipping backup to other location, we get this error

2019-11-19 04:45:20.92    *** Error: The file ‘\\LVSP10SQL001\LS_backup\Account_20191119043017.trn’ is too recent to apply to the secondary database ‘Account’.(Microsoft.SqlServer.Management.LogShipping) ***

2019-11-19 04:45:20.92    *** Error: The log in this backup set begins at LSN 74337000001428600001, which is too recent to apply to the database. An earlier log backup that includes LSN 74337000001366400001 can be restored.
RESTORE LOG is terminating abnormally.(.Net SqlClient Data Provider) **

Could you advise what are the various ways to overcome this ?

Thanks

RG

An existing connection was forcibly closed by remote host

$
0
0

Hi All,<o:p></o:p>

There is connection issue while trying to connect remote SQL server SQL 2016 hosted on Windows 2016 from <o:p></o:p>

SSMS 2012 hosted on windows server 2012 with SQL server Sp4.<o:p></o:p>

We configured replication from SQL 2016 to SQL 2012 and it is getting failed due to Client and server is not able to connect because they don't posses common algorithm.<o:p></o:p>

Checked: TLS 1.0,1.1,1.2 are enabled in 2012 server.<o:p></o:p>

TCP\IP,named pipes are enabled. SQL native client 11 is installed.<o:p></o:p>

Where as able to connect same SQL 2016 from other server having windows 2012 R2 having SQL 2012 SP4.<o:p></o:p>

Is windows server 2012 version is the cause for this?<o:p></o:p>


Regards, Lakshmipathi Machineni

Cannot drop server because it is used as a Subscriber to remote Publisher in replication.

$
0
0
Trying to remove replication from a test environment and have the pubs/subs all removed but when i try to remove the distributor by running sp_dropdistpublisher, I get the error above. I have tried running sp_dropsubscriber which runs fine but still get the same error. Tried running sp_dropdispubliser with the ignore_distributor = 1 no luck same error. Some background, there are 3 sql servers in this environment involved in replication. Server 1 had been the original publisher and distributor, server 2 was a subscriber to the original and server 3 is a new server set up to take over the distribution function. Server 1 and 2 were up and running transactional replication and I removed all replication from them. I set up server 3 as the new distributor and started configuring Server 1 and 2 as publisher and subscriber, had some issues and got put on other tasks and never completed. After a couple weeks I needed the original replication set up of  server 1 as distributor and publisher and server 2 as subscriber for testing a prod change. I dropped the distribution from server 3 (or so I thought) and reconfigured server 1 and 2. That all worked and now, I am back to dropping the replication from server 1 and 2 and configuring server as distributor. When I started on that today I saw there was still a distribution db on server 3 so i tried generating scripts to remove the distributor and that is where I ran into the error. When I look in SSMS under server objects I can still see linked servers to server 1 and 2. Any suggestions on how to get this removed? I would like to do so without taking the distribution db offline and dropping it so it is a clean set up. Thank you

Best Way to Upgrade SQL Server Replication Servers

$
0
0

I have a 3 server transactional replication configuration:

Server A (SQL 2008R2 and WinSvr 2008R2) is a publisher of database DB1.  It is a business critical OLTP VM which is used 24/7.

Server B (SQL 2008R2 and WinSvr 2008R2) is the distributor.  It is also a subscriber of database DB1 and a publisher of database DB1.  The sole purpose of this server is to handle DB1 data requests separate from Server A.

Server C (SQL 2016 and WinSvr 2016) is a subscriber to DB1 from Server B.

-------------------------------------------------------------------------------------------

Last year we upgraded Server C to SQL 2016.  This year we want to upgrade Server B.

At first I thought this would be easy.  We would just stand up a new VM (Server B2) and then I would create a new publication on Server A that would replicate to Server B2, leaving our original replication stream from Server B to Server C intact.

Once we verified that the 1st part of the replication stream from Server A to server B2 was functioning properly, we could delete the subscription on C and recreate it to read from the new B2 replication server.

However, I don't think that I can have a publication database that points to 2 distributors.  Does someone have some suggestions for how we might be able to upgrade this server?

Also, we have plans to upgrade Server A next year, but it's been determined that it would be too risky to upgrade them both at the same time.

Replication - servers host name change.

$
0
0

we have 1 publication server & subscription server. ( all are in same Vnet)

we are going to change this Publication server & subscription server (hostname). is this affect replication.

how can i find all existing connection parameters  used for replications?



Replica for reporting in another location

$
0
0

Hello,

I have a problem with users who refreshing SQL query in Excel few times per day. Some queries are heavy and it clog our SQL server. We have central datacenter, few branch offices and headquarter. Users from HQ (ca 160 people) refresh excel reports few times per day. I wonder if it's possible to create local replica, then they will be able to get data from local sourcewithout stress the main server.

Which replication option will be the best to achieve this goal?

I saw I can use Transactional replication - it will be good option but I cannot add tables without primary key. I want to replicate whole database and sync only changes.It would be best to push changes from the main server every time they appear.


how to Add new columns to existing article in transactional replication without reinit

$
0
0

transnational replication already available for tableA with minimum column .

now  i need to add one more column to existing article tableA .   shall i directly enable this column on publication? 

is this sync to subscriber?   this table is heavy transnational used one.

Cannot generate a snapshot after removing articles

$
0
0

We've had a working publication in place for some years now. I started to receive this error after I unchecked 3 articles from the Publication Properties dialog. These 3 tables hold lookup data and were marked as "download-only" on the articles page. After unchecking the articles attempting to create a new snapshot would throw this error:


Message: Could not connect to server 'MyServer' because 'MyServer' is not defined as a remote server. Verify that you have specified the correct server name. . 
Command Text: sp_helpmergepublication
Parameters: @publication = MyPublication
@reserved = fromSnapshot

This seemed to be a bogus error. I tried re-selecting the articles I removed in the Publication Properties dialog. After doing this, I receive the following error:

Message: An error was raised during trigger execution. The batch has been aborted and the user transaction, if any, has been rolled back. 
Command Text: sp_MSsetartprocs
Parameters: @publication = "MyPublication"
@article = "MyArticle"

I've tried deleting and recreating the publication but receive the same errors. I'm thinking some metadata may have gotten corrupted when I unchecked the articles. Any help appreciated.


data is not replicating from publisher to subscriber.

$
0
0

I configured transactional replication. However, data is not replicating from publisher to subscriber. I have attached screenshots of errors. Could you please advise


Kiran

Max text replication Size

$
0
0

Fellow SQLers.

We just started setting up replication.

Realized that Max text replication Size was set to default of 65536.

We have since changed it to -1 because we do have lob fileds (ntext, max, etc)/

so, what MS does not indicate is what this is actually doing if you go over the limit of 65536.

1 - is it bypassing records from being replication that have a columns where the actual data is over 65536

or

2 - is it truncating data for those fields.

thanks

MG

Viewing all 4054 articles
Browse latest View live


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