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

SQL Server merge replication and vertical partitioning on some tables after scripting of a publication

$
0
0

We have a database that we changed during the time in terms of adding/removing articles, columns to replication articles in a publication. Now when we script out that publication we have lines of code that are telling us that vertical partitioning is in question, like this:

exec sp_addmergearticle @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @source_owner = N'dbo', @source_object = N'Customer_DELETE_LOG', @type = N'table', @description = N'', @creation_script = N'', @pre_creation_cmd = N'drop', @schema_option = 0x000000000C034FD1, @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'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'LOG_DATE', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'LOG_USER', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'COLUMN_NAME', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'ROW_ID', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'ROW_DELETED_VALUE', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'STATEMENT', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'PROCESSED', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'BATCH_ID', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'SERVER_NAME', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'APP_NAME', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
exec sp_mergearticlecolumn @publication = N'secspe_pub', @article = N'Customer_DELETE_LOG', @column = N'rowguid', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
GO

Note here that @vertical_partition = N'true' and also note that we never do any vertical partition at least not intentionally.

Now the real issue here is when there are some computed columns in a table, and those computed columns are at the beginning of the table/article script (that includes vertical partitioning) processing will skip those columns! Because those columns are added to the replication article before their referenced column and thus they will break that sp_mergearticlecolumn statement. To avoid this (without checking every statement among 400) is to replace @vertical_partition = N'true' with @vertical_partition = N'false' and then run the whole thing. And this will work. BUT when you try to script out the whole thing those vertical partitioning statements will come again! WHY?

So again:

  1. what vertical partitioning actually means and why does SQL Server add it to the replication scripts?
  2. how to check if a table is vertically partitioned?

Thanks Dejan

UPDATE

I am digging on this now deeper, and started looking on tables themselves and noticed folowing:

Some tables were missing some indexes, like 1,2,3,5 -> where column at index 4 was probably deleted at a point of time. Could that cause this? Could that cause the publication scripting procedure to think that this is a partitioned table? If so then the Microsoft developers didn't finish this properly.


The locale identifier (LCID) 8192 is not supported by SQL Server

$
0
0

I am trying to make transactional replication and getting the exception on publications while viewing the snapshot agent status:

The locale identifier (LCID) 8192 is not supported by SQL Server

What does it mean? Solution?

SQL Server is generating SQLDUMPS due to log reader agent crashed and unable to start again

$
0
0

In production environment, we have Transnational replication configured on some of the databases. On 13th Jan around 12 AM, SQL server started generating SQLDUMP files in huge numbers due to below errors:

Replication-Replication Transaction-Log Reader Subsystem: agent XXXX-YYYYY-22 failed. The process could not execute 'sp_repldone/sp_replcounters' on 'XXXX

SQL Server Assertion: File: , line=2912 Failed Assertion = 'UtilDbccIsInsideDbcc () || (m_ProxyLogMgr->GetPru ()->GetStartupPhase () < DBStateMgr::Recovered

I have checked on SQL Server replication monitor and observed that 2 publisher databases are failing their replication out of 10 databases due to below errors:

Log_Reader_agent_failure_statusThe process could not execute 'sp_repldone/sp_replcounters' on 'XXXX'

I tried to stop and start the Log reader agent but failed with the same error. I checked if there is no database owner for failed publisher databases but both of them have proper db owners. Also, there is no database consistency error for any database.

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.

SQL Server parameterized merge replication filters

$
0
0

Consider the following scenario. A merge replication is set up where A is a publisher with B and C as its subscribers. Suppose we have a parameterized row filter on A that limits data being replicated either to B, C or neither. Say we push data into B and want to replicate it only to C but not to the publisher A.

Because we have a merge replication, we know that subscriber B will replicate the data to publisher A and then if the row filter allows it, C shall receive the data as well. If the row filter, however, doesn't match the publisher does the data there get deleted from it afterwards?

Is the row filter even being utilized when data is pushed from a subscriber? From the documentation I suppose it should work but I couldn't find a definite answer. Parameterized row filters allow different partitions of data to be sent to different subscribers without requiring multiple publications to be created

Transactional replication while adding distribution in publication

$
0
0

TITLE: Microsoft SQL Server Management Studio

The linked server has been created but failed a connection test. Do you want to keep the linked server?


ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)


SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. OLE DB provider "SQLNCLI11" for linked server "Server\Instance" returned message "Login timeout expired". OLE DB provider "SQLNCLI11" for linked server "Server\Instance" returned message "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.". (Microsoft SQL Server, Error: -1)

Is it possible to have non memory data caches in Apache Ignite?

$
0
0

Example: I have two nodes that replicate caches and provides a services that are active on either node that queries data.

I want to store in memory a basic subset of data in a cache and store a related LOB only on the native database to prevent unnecessary large memory usage on the two servers.

The Ignite service needs to be able to select data in memory cache and LOB data on the disk table.

So I guess the question simply is: Does Apache Ignite have a non memory cache that replicates or can it provide IO directly to its native database that's being replicated?

The subscription status of the object could not be changed

$
0
0

I have set up a transactional replication then I'm tying to generate new snapshot but this error is appearing:

Error messages:

Message: The subscription status of the object could not be changed. Command Text: sp_MSactivate_auto_sub Parameters: @publication = Web to Interserver @article = % @status = initiated

Please help me solve this problem. I already tried to drop the subscription but this error is appearing also.


Sql Server replication setup in a high availability clustering system running on a workgroup

$
0
0

We are trying to set up replication for a database in a high availability cluster environment, where an outage of the primary database server will automatically fail over to the secondary server.

Furthermore, we are using a workgroup-based environment rather than domain-based, because in this case a domain controller would be superfluous.

Configuration: OS: WinServer 2019 SqlServer: 2017 Replication: merge, push-based

We have not be able to get a publisher set up with the name used for the cluster (i.e., the name that resolves to the cluster IP address). The setup only allows the name of the database server, which resolves to the IP of the primary database server.

Is it possible to set up Sql Server replication in an availability group environment that is workgroup-based?

TempDB (Log) fills on publisher when distributor goes down

$
0
0

We use Microsoft SQL server exclusively where I work and in this case I am referring to just standard out of the box replication (no custom sp's for the distribution of transactions).

Last night we took our distributor down for planned maintenance. The server was unavailable for about 1.5 hours and in that time the tempDB log file and drive filled up on a publisher. Almost immediately after the maintenance finished and the distributor was brought back online I was alerted to the production (publisher) tempDB issue and by the time I got to the tempdb to check, there was free space within the log.... I was monitoring the published database log files which obviously were not recycling but not growing astronomically and appeared well within acceptable limits and never filled. We do have alerting but it was lost by me with a lot of the noise we had, and my attention being focused elsewhere during maintenance.

I was aware the tempDB was used minimally in transactional replication but my concern (and where I was monitoring) was in the published databases log files, not the tempDB. Cam anyone explain this phenomenon to me? Would this be expected behavior?

Exception when starting Snapshot Agent when setting up database replication

$
0
0

I am trying to set up replication between databases. I followed this tutorials:

https://docs.microsoft.com/en-us/sql/relational-databases/replication/tutorial-preparing-the-server-for-replication?view=sql-server-ver15

and after:

https://docs.microsoft.com/en-us/sql/relational-databases/replication/tutorial-replicating-data-between-continuously-connected-servers?view=sql-server-ver15

I went through first without any problems. Almost completed the second, but I stuck on step View the status of snapshot generation

When I try to strat snapshot agent, I get error:

Exception Message: An unspecified error had occurred in the native SQL Server connection component.

I tried to search on the internet MSSQL_REPL55012 (that's error code I get), but didn't succeed.

I tried to look in SQL Profiler, Jobs history, Replication Monitor, even ran failing job step from PowerShell, but couldn't get any more info on that.

What might be the issue? Anybody else stumbled upon that?

I am using:

  • SSMS version 15.0.18206.0

  • SQL Server engine 15.0.2000.5

Snapshot backup size increase after starting transactional replication

$
0
0

The size of the snapshot backups went from 1.6 GB to 16 GB one week later after starting transactional replication. Does anyone know why this might be happening? I'm using SQL Server 2017.

Azure Managed instance failover with transnational replication

$
0
0

I have two azure SQL managed instances in different region and configured fail-over group between the same MI instances. Also configured the transactional replication between on-prem sql \ Azure IaaS VM to primary managed instance. Now want to test fail-over group by failing over to secondary and then to primary. What's the best way \ possible way so that replication should not get disturbed.

Best practices when upgrading to SQL Server 2017 - Two databases or one? Replication? DMZ?

$
0
0

We are FINALLY migrating off our SQL 2000 box to SQL 2017. Our current environment is a single SQL server with a database dedicated for our internal applications and then a separate database for our eCommerce site - with SQL replication running between the databases (both merge and distribution). Our SQL server is NOT in the DMZ. Our eCommerce front end is running IIS on a separate server and that IS in the DMZ with access through our firewall to the SQL box.

What are the current best practices for our move to SQL 2017? We have had different consultants tell us different things.

  • Do we continue our current setup with two databases, one being dedicated to our eCommerce site and one for our internal applications? If so, what is the best way to replicate data between the two databases?

  • Do we set up a separate SQL server instance for our eCommerce site and put that in the DMZ with our IIS server? If so, what is the best way to replicate data between the two SQL servers?

  • Do we use a single database and have both our internal apps and eCommerce site hit that database? That eliminates the need for replication but are there security or performance concerns with this?

  • Something else?

What are the pros and cons for each option in terms of security, system performance, costs, ...? Are there sites out there that go over this? Like I said we have had different consultants tell us different things. Whenever I try to search on this all I see are articles discussing if IIS should be on the same server as SQL - which doesn't apply in our case.

Any help is appreciated. I would think there white papers or site out there discussing this, I just haven't found anything too helpful.

SQL Server Express connect subscriber to publisher over ftp

$
0
0

I created a publisher (marge replication) over FTP and now I want connect all my remote subscribers.

I do this:

  • open SQL Server Configuration Manager (on my subscriber) --> created a new alias (ip remote and insert tcp port)
  • after that I subscribed a new subscription (no problem)

Now I want execute a sync (SQL Server Express does not have SQL Server Agent), I wrote this script:

SET Publisher=..\SQLAGENTE
SET Subscriber=...\SQLEXPRESS  
SET DistLogin=**
SET DistPass=***
SET PublishLogin=**
SET PublishPass=***
SET PublicationDB=DBAgente  
SET SubscriptionDB=prova   
SET Publication=SQLPubblicazione  
SET FTPUser = ***
SET FTPPwd = ***
"%ProgramFiles%\Microsoft SQL Server\110\COM\replmerg.exe" -Publication %Publication% -Publisher %Publisher% -PublisherLogin %PublishLogin% -PublisherPassword %PublishPass% -PublisherSecurityMode 0 -Subscriber  %Subscriber% -Distributor %Publisher% -FtpUserName %FTPUser% -FtpPassword %FTPPwd% -DistributorLogin %DistLogin% -DistributorPassword %DistPass% -PublisherDB %PublicationDB% -SubscriberDB %SubscriptionDB% -PublisherSecurityMode 0 -OutputVerboseLevel 2 -SubscriberSecurityMode 1 -SubscriptionType 1 -DistributorSecurityMode 0 -Validate 3 -ParallelUploadDownload 1 ;

I can connect to subscribers but I can't connect to remote publisher.

My question is this: how to set remote ip address? I can't find an option into replmerg...


One way DB synchronization using mssql Replication

$
0
0

I am doing DB synchronization via MSSQL Replication utility which is performing well to me.

Now my objective: after transfer data to destination DB's table, remove transferred data from the source DB's table.

Any help would be highly appreciated.

If this is not feasible what are the other approaches to accomplish this?

Replication issue after server restart

$
0
0

We restarted both the publisher database & subscription database (distributor & subscription are on same database). All the replications process has stopped like daily, weekly & Transactional replication.

When I checked the properties of the publication I got the error

SQL Server cannot retrieve the information for publication ‘dbSQL-Transactional’ in dbsql-01.

When I check the status of the snapshot & logreader agent I got this error

unable to display agent status

and on the replication monitor, it says the error is

The process could not execute 'sp_repldone/sp_replcounters' on 'dbsql-01'.

Do I have to recreate all the replication on both the servers? Does it save a copy of the publisher's config, as there are some tables in daily replication, some tables in weekly & some in transactional?

SQL Replication-Trying to replicate identical named instance SQL Servers across region through internet

$
0
0

I have two servers sitting in different country and would like to have both in sync using sql server replication. I've setup a replication successfully between two servers within the same network.

This time i'm attempting cross region replication but i ran into certain limitation.

Server A & instance Name : Kronen\K2016 Server B & instance Name : Kronen\K2016

Both the servers has the same server and instance name for SQL. When connecting from MSQL management studio, both uses the same server name.

I'm able to connect to Server B from Server A's management studio but when it comes to replication subscriber setup, it tells me that i'll have to use the server's actual name.

Now, using alias couldnt solve this because both servers has the same name.

Apart from dropping and changing the server name, can anyone enlighten me with another workaround? Reason being that the management team doesnt want the server name to be changed.

I did think of using T-SQL to create the subscription but lack of knowledge on that. Even after getting to the docs.microsoft to find the T-SQL, i couldnt comprehend it much. Besides, i'm not sure if T-SQL could serve as a workaround to this issue.

Any help is greatly appreciated.

Thanks.

Why am I getting the error "Cannot drop the database 'test' because it is being used for replication. Error: 3724"?

$
0
0

I deleted all the publications and subscriptions related to the database 'test'. All I have now are the publications and subscriptions related to other databases in the server. Still, It says "Cannot drop the database 'test' because it is being used for replication."

For evidence, These are the current publications related to another database "Computers":enter image description here

Why is table count increased enormously after configuring the Transactional Replication at the distributor in SQL Server? [duplicate]

$
0
0

This question a duplicate of this: What is syncobj in SQL Server

Please use if you stumble upon this question. No answers needed for this question

Used following queries to compare the count:

  1. Total Tables(including views): SELECT count(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES

  2. Only Tables: SELECT count(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES where TABLE_TYPE = 'BASE TABLE'

  3. Only views: SELECT count(TABLE_NAME) FROM INFORMATION_SCHEMA.VIEWS;

Explanation:

The Query results at the distributor before configuring the replication:

1. 357
2. 231
3. 126

The Query results at the subscriber after configuring the replication:

1. 362
2. 236
3. 126

The Query results at the distributor after configuring the replication:

 1. 606
 2. 248
 3. 358

I find no difference when I checked the Object Explorer. Can anyone explain why these extra tables are created and what are these tables?

The table names are like these:

syncobj_0x3345464646433644

syncobj_0x3838453534453142
Viewing all 17268 articles
Browse latest View live


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