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

Post Snapshot Script fails

$
0
0

I have configured a merge replication on a SQL Server 2012 (Standard Edition).

The snapshot files are located on a shared folder. The client can access this folder via an UNC path.

The permissions are correct, because the initial synchronization is working - all database objects have been put into subscriber database.

Now I need to run a post snapshot script to create a full text index on an indexed view (because SQL server replication is not able to do this for me).

I configured the publication with a post snapshot script to the same network share:
\\mysqlserver\mytool$\Scripts\PostSnapshotScripts\MyScript.sql

When I now try to make an initial synchronization the client gets the error:
"The MyScript_c20d3a1b_1.sql-schema script could not be propagated to the subscriber."

The replication monitor shows the same message with the addition
"(Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)".

I thought, that there is an error in my script. So I tried a simple select statement or an empty .sql-file. But I always get the same error.



Replicated Transaction Information: Oldest distributed LSN : Oldest non-distributed LSN : DBCC execution completed. If DBCC printed error messages, contact your syste

$
0
0

Some times this is resolved by using repl_done command along with repl_flush.

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

go

sp_repleflush

This time we faced issue and went unsuccessful. Then we followed below steps.

1. Stopped Log Reader Agent

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

3. sp_repleflush

4. Started Log reader agent

5. Replication came in Sync.

==================================================================

This is happening more frequently,  There is no DB restores on the database.

==================================================================

Any solutions please advise thanks in advance. Why this re-occurs again and again.



Regards, Pradyothana DP http://www.dbainhouse.blogspot.in/


MERGE REPLICATION ERROR FOR GENERATE SNAPSHOTS. ERROR CODE 54162

$
0
0

I GOT THESE TWO PROBLEMAS BUT I DONT KNOW WHAT TO DO, I GOT THE LOG TOO FROM DE JOB

AND I GOT THIS :

2014-10-20 23:22:53.66 
2014-10-20 23:22:53.66 Agente de instantáneas de Microsoft (R) SQL Server
2014-10-20 23:22:53.66 [Versión de ensamblado = 11.0.0.0, Versión del archivo = 11.0.3000.0 ((SQL11_PCU_Main).121019-1325 )]
2014-10-20 23:22:53.66 Copyright (c) 2008 Microsoft Corporation.
2014-10-20 23:22:53.66 The timestamps prepended to the output lines are expressed in terms of UTC time.
2014-10-20 23:22:53.66 User-specified agent parameter values:
2014-10-20 23:22:53.66 --------------------------------------
2014-10-20 23:22:53.66 -Publisher SRV-VICTORIA
2014-10-20 23:22:53.66 -PublisherDB SIOv2
2014-10-20 23:22:53.66 -Publication Almacen
2014-10-20 23:22:53.66 -ReplicationType 2
2014-10-20 23:22:53.66 -Distributor SRV-VICTORIA
2014-10-20 23:22:53.66 -DistributorSecurityMode 1
2014-10-20 23:22:53.66 -Output D:\merge_log3.log
2014-10-20 23:22:53.66 -XJOBID 0xF5682E5968BB1F40A23E7D6786CE3EBC
2014-10-20 23:22:53.66 --------------------------------------
2014-10-20 23:22:53.66 Conectando a Distribuidor 'SRV-VICTORIA'
2014-10-20 23:22:53.76 Parameter values obtained from agent profile:
2014-10-20 23:22:53.76 ---------------------------------------------
2014-10-20 23:22:53.76 -BcpBatchSize 100000
2014-10-20 23:22:53.76 -HistoryVerboseLevel 2
2014-10-20 23:22:53.76 -LoginTimeout 15
2014-10-20 23:22:53.76 -QueryTimeout 1800
2014-10-20 23:22:53.76 ---------------------------------------------
2014-10-20 23:22:53.76 Validando publicador
2014-10-20 23:22:53.78 Conectando a Publicador 'SRV-VICTORIA'
2014-10-20 23:22:53.80 El nivel de compatibilidad de la base de datos del publicador está establecido en 90.
2014-10-20 23:22:53.80 Recuperando información de publicaciones y artículos de la base de datos del publicador 'SRV-VICTORIA.SIOv2'
2014-10-20 23:22:53.88 [0%] Preparing table '[dbo].[Almacen]' for merge replication
2014-10-20 23:22:53.89 [0%] Setting up the publication for filtered articles
2014-10-20 23:22:53.91 [2%] Bulk copying snapshot data for article 'Almacen'
2014-10-20 23:22:53.91 [2%] Bulk copied snapshot data for article 'Almacen' (2 rows).
2014-10-20 23:22:54.08 [4%] Cargando previamente metadatos de todas las tablas de la base de datos del publicador para generar scripts
2014-10-20 23:22:54.51 [4%] El Agente de replicación encontró una excepción.
2014-10-20 23:22:54.51 Origen: Replication
2014-10-20 23:22:54.51 Tipo de excepción: Microsoft.SqlServer.Replication.SmoPrefetchFailureException
2014-10-20 23:22:54.51 Mensaje de la excepción: Error en la carga previa de metadatos para el tipo de objetos SMO 'Microsoft.SqlServer.Management.Smo.Table' , motivo: Prefetch objects failed for Database 'SIOv2'.  El rendimiento de las secuencias de comandos se puede degradar considerablemente.
2014-10-20 23:22:54.51 Código del mensaje: 54162
2014-10-20 23:22:54.51  
2014-10-20 23:22:54.61 [4%] El Agente de replicación encontró una excepción.
2014-10-20 23:22:54.61 Origen: Replication
2014-10-20 23:22:54.61 Tipo de excepción: Microsoft.SqlServer.Replication.SmoPrefetchFailureException
2014-10-20 23:22:54.61 Mensaje de la excepción: Error en la carga previa de metadatos para el tipo de objetos SMO 'Microsoft.SqlServer.Management.Smo.UserDefinedTableType' , motivo: Prefetch objects failed for Database 'SIOv2'.  El rendimiento de las secuencias de comandos se puede degradar considerablemente.
2014-10-20 23:22:54.61 Código del mensaje: 54162
2014-10-20 23:22:54.61  
2014-10-20 23:22:54.66 [4%] Detectando dependencias entre los objetos de artículo de la publicación especificada
2014-10-20 23:22:55.90 [4%] Ordenando objetos de artículo en el orden de creación apropiado
2014-10-20 23:22:55.91 [4%] Excluyendo objeto "Server[@Name='SRV-VICTORIA']/Database[@Name='SIOv2']/Table[@Name='MSmerge_contents' and @Schema='dbo']", al que hacen referencia los artículos de la publicación especificada de la instantánea actual. Es probable que la instantánea generada no pueda aplicarse al suscriptor si en el suscriptor falta el objeto excluido.
2014-10-20 23:22:55.91 [4%] Excluyendo objeto "Server[@Name='SRV-VICTORIA']/Database[@Name='SIOv2']/View[@Name='MSmerge_ctsv_40211FF114524CCAAB0739A143E8EB88' and @Schema='dbo']", al que hacen referencia los artículos de la publicación especificada de la instantánea actual. Es probable que la instantánea generada no pueda aplicarse al suscriptor si en el suscriptor falta el objeto excluido.
2014-10-20 23:22:55.91 [4%] Excluyendo objeto "Server[@Name='SRV-VICTORIA']/Database[@Name='SIOv2']/Table[@Name='MSmerge_genhistory' and @Schema='dbo']", al que hacen referencia los artículos de la publicación especificada de la instantánea actual. Es probable que la instantánea generada no pueda aplicarse al suscriptor si en el suscriptor falta el objeto excluido.
2014-10-20 23:22:55.91 [4%] Excluyendo objeto "Server[@Name='SRV-VICTORIA']/Database[@Name='SIOv2']/View[@Name='MSmerge_genvw_40211FF114524CCAAB0739A143E8EB88' and @Schema='dbo']", al que hacen referencia los artículos de la publicación especificada de la instantánea actual. Es probable que la instantánea generada no pueda aplicarse al suscriptor si en el suscriptor falta el objeto excluido.
2014-10-20 23:22:55.92 [4%] Excluyendo objeto "Server[@Name='SRV-VICTORIA']/Database[@Name='SIOv2']/Table[@Name='MSmerge_tombstone' and @Schema='dbo']", al que hacen referencia los artículos de la publicación especificada de la instantánea actual. Es probable que la instantánea generada no pueda aplicarse al suscriptor si en el suscriptor falta el objeto excluido.
2014-10-20 23:22:55.92 [4%] Excluyendo objeto "Server[@Name='SRV-VICTORIA']/Database[@Name='SIOv2']/View[@Name='MSmerge_tsvw_40211FF114524CCAAB0739A143E8EB88' and @Schema='dbo']", al que hacen referencia los artículos de la publicación especificada de la instantánea actual. Es probable que la instantánea generada no pueda aplicarse al suscriptor si en el suscriptor falta el objeto excluido.
2014-10-20 23:22:55.92 [4%] Excluyendo objeto "Server[@Name='SRV-VICTORIA']/Database[@Name='SIOv2']/Table[@Name='sysmergearticles' and @Schema='dbo']", al que hacen referencia los artículos de la publicación especificada de la instantánea actual. Es probable que la instantánea generada no pueda aplicarse al suscriptor si en el suscriptor falta el objeto excluido.
2014-10-20 23:22:55.92 [4%] Personalizando el objeto para la generación de scripts según el artículo 'Almacen'
2014-10-20 23:22:55.99 [4%] El Agente de replicación encontró una excepción.
2014-10-20 23:22:55.99 Origen: Unknown
2014-10-20 23:22:55.99 Tipo de excepción: Microsoft.SqlServer.Management.Common.ExecutionFailureException
2014-10-20 23:22:55.99 Mensaje de la excepción: An exception occurred while executing a Transact-SQL statement or batch.
2014-10-20 23:22:55.99 Código del mensaje: Not Applicable
2014-10-20 23:22:55.99  

AN APOLOGIZE WITH THE LANGUAGE ISSUE.

GENERATING A SNAPSHOT PROBLEM - MERGE REPLICATION

$
0
0

I HAVE A MERGE PUBLICATION, AND I WANT TO GENERATE A SNAPSHOT, BUT WHEN I TRY TO DO THAT THE AGENT SHOWS ME THIS MESSAGE 

[0%] The process is running and is waiting for a response from the server.

AND THE SNAPSHOT IS NOT GENERATED :( I DONT KNOW WHAT IS HAPPNENIGN, THANKS IN ADVANCE


Publication is not listed in reolication monitor after manual database failover

$
0
0

Hi All,

I have three servers using which I have configured database mirroring and  transactional replication with pull  subscription.

ServerA--Publisher/Distributor/principal

ServerB--Subscriber

ServerC--Mirror

After failover now ServerB pulls the data from ServerC which is the new Principal andI have set the -PublishfailoverPartner as ServerC .

After the failover is performed I see subscriber is pulling transactions from ServerC and transactions are getting replicated but I cannot see the publication listed under new publisher(ServerC) nor under old publisher ServerA  from replication monitor.

What is the reason I cannot see the publications from replication Monitor. How will distributor know that ServerC is now the publisher.

Also I got the error when I executed below command for distribution agent. But still transactions are getting replicated after failover.

exec

sp_add_agent_parameter@profile_id= 4, @parameter_name =N'-PublisherFailoverPartner', @parameter_value =N'ServerC

Msg 21806, Level 16, State 1, Procedure sp_MSvalidate_agent_parameter, Line 63

parameter -PublisherFailoverPartner. The value must be an integer. Verify that replication is installed properly and that sp_add_agent_parameter is invoked with a valid value.The agent profile creation process cannot validate the specified agent parameter value: the profile_id 4 does not exist or it does not support the

Any inputs will be of great help.

Regards,

Raj


Raj

The certificate 'instance' cannot be dropped because it is bound to one or more database encryption key.

$
0
0

my question is the as this one on this link https://social.msdn.microsoft.com/Forums/sqlserver/en-US/55deada2-95f1-46a9-82be-c7e684a4bddb/the-certificate-certname-cannot-be-dropped-because-it-is-bound-to-one-or-more-database-encryption?forum=sqlreplication. but there is no clear answer what to do . would anyone please help me and give me guidance?

i had create a master key and a certificate under master database. and now i want to drop these certificate and master key from  this database and face with this error  :sg 3716, Level 16, State 15, Line 1
The certificate 'TDECert' cannot be dropped because it is bound to one or more database encryption key .

thanks in advance


After updating to SQL 2012 SP2 merge replication gives error: Invalid column name 'last_local_sentgen'

$
0
0

After updating to SP2 on SQL 2012 merge replication gives this error on all subscriptions:

Error messages:
The merge process could not update the last sent generation sent to the Publisher. If this failure persists, reinitialize the subscription. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201005)
Get help: http://help/MSSQL_REPL-2147201005
Invalid column name 'last_local_sentgen'. (Source: MSSQLServer, Error number: 207)
Get help: http://help/207

If I create a new subscription to a new database (not been part of any replication before) it gives the same error.

I also tried to recreate the publisher-part. Did not help.


Marcus

Transactional replication is a problem

$
0
0

i have got transactional replication going on.

when i check the status on publisher database , publisher to distrubutor history shows perfefcely fine but distributor to subscriber is waiting since forever

and when i check the status on subscription/distributor side this is what i get


k


Primary Key Violation at the time of Moving from primary range to secondary range.

$
0
0
Hi Experts,

I've observed a strange issue in our environment.
we are using sql server 2008 R2 with SP2.

whenever a table is moving from primary range to secondary range on it's identity values, application is getting crashed with the message as below. 

Violation of PRIMARY KEY constraint 'PK6'. Cannot insert duplicate key in object 'dbo.TD_TRANN'. The duplicate key value is (17868679).
The statement has been terminated.

OR

Violation of UNIQUE KEY constraint 'IX_TDS_COST'. Cannot insert duplicate key in object 'dbo.TDS_COST'. The duplicate key value is (17, 19431201).

identity ranges were auto managed by replication. agents are running continuous.

please suggest.

Cheers, Vinod Mallolu

Performance: fetch replication_databases into @dbname, @category, @comat

$
0
0
I'm monitoring a server with performance complaints and noticed that one of the expensive queries is fetch replication_databases into @dbname, @category, @compat. I'm not receiving any hits as to what, why this query is running.    Has anyone have any info on it, and can point me in the right direction for researching?

SqlBulkCopy issue with replication

$
0
0

I have a transaction replication between two servers running on SQL Server 2008 R2. When I insert rows into a table on the publisher everything is OK. When I insert rows into a table on the subscriber I'm getting the follwing error:

Cannot bulk copy into a table "TABLE_NAME" that is enabled for immediate-updating subscriptions

rom the following link: BulkCopy it looks as if the problem is related to the fact the we have to set FIRE_TRIGGERS on. I've tried to use SqlBulkCopy like this:

SqlBulkCopy(ConnectionString, SqlBulkCopyOptions.FireTriggers)

but I'm still getting the same error. What should I do?





Tsahi Bar

truncate

$
0
0

Hi,

If table is truncated in snapshot replication will that replicate to all subscribers?

SQL Server 2008 Merge Replication - Snapshot File Location Is Incorrect

$
0
0

I've searched far and wide, and so far have not been able to find any reference to this issue.

There is a merge replication setup on a SQL 2008 server, setup to replicate to SQL 2008 Express edition. We have similar setups in SQL 2005 AND SQL 2008 without issues. The setup is that the current merge replication snapshot file location is \\<ServerName>\Repldata\UNC\<SERVER_PUBLICATION>\20101229112828 which represents the file location of the latest snapshot which was just generated due to an obsolete snapshot.

The issue comes in when attempting to replicate against the server. The replication says that the schema script could not be propogated to the subscriber. Under normal circumstances I would say it's due to security issues with being able to read to the above folder, however this is not the case. The additional error that comes up is stating that it could not read the file along with an OS error 3 (The system cannot find the path specified).

What is unique about this, is that the subscriber is trying to download the snapshot from an old and now non-existent snapshot folder. Here is an copy of the error, noting the file location of "20091121130613" which no longer exists and is from an old snapshot.

The process could not read file '\\<servername>\repldata\unc\<Server_Publication>\20091121130613\Administration_21.sch' due to OS error 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL0)

I either need to find out how to change on the distributor, publisher or subscriber the location of the folder, or find out how to reset it. Deleting the subscriber database and subscription from the server and setting them both up again has no affect, which points to me that it is stored somewhere in either the distribution database, publisher database, or msdb database on the subscriber. I have also tried reinitializing the subscriptino multiple times, again with no success.

Thanks, Don

SQL Server Replication - Southware Vision File System to SQL Server

$
0
0
We have a system using Southware (Vision File System Format) and want to replicate this data to SQL Server. We are looking at a homegrown solution, but there has to be some way to do this with SQL Server or some third party software package that can manage the replication between a Southware (Vision File System) database and a SQL Server Database. Would anyone be able to help out and explain how this might be done or some tools that can used to do this so we might not have to design a system from ground up to do this (which we are not opposed to doing, but it just seems we cannot be the first company to want to do this).

Issue with TX replication with DB Mirroring

$
0
0
I am trying to setup TX replication with DB mirroring in SQL 2012. 

Server1: Test-DB01
Windows 2012 Data Center Edition
SQL 2012 EE

On TEST-DB01 I have 2 databases engine,reports. I am replicating(Tx replication) data from engine database to reports database. I configured the distributor for this replication on a different server TEST-DB02. I have also setup mirroring for engine and reports databases on TEST-DB01 to TEST-DB02. Publication name is 10272014.

Server2: Test-DB02
Windows 2012 Data Center Edition
SQL 2012 EE
This server is a distributor with 2 publishers TEST-DB01 and TEST-DB02. It is also being used as a mirror for both engine and reports database from TEST-DB01.

I executed the below statements to ensure that the databases on TEST-DB02 are the failover partners when a failover occurs:

exec sp_add_agent_parameter @profile_id = 1, @parameter_name = N'-PublisherFailoverPartner', @parameter_value = N'TEST-DB02'
exec sp_add_agent_parameter @profile_id = 2, @parameter_name = N'-PublisherFailoverPartner', @parameter_value = N'TEST-DB02'
exec sp_add_agent_parameter @profile_id = 3, @parameter_name = N'-PublisherFailoverPartner', @parameter_value = N'TEST-DB02'
exec sp_add_agent_parameter @profile_id = 9, @parameter_name = N'-PublisherFailoverPartner', @parameter_value = N'TEST-DB02'


I failed over engine from TEST-DB01 to TEST-DB02 and ran few update statements and then reflect in the reports database in TEST-DB01. No issues there. Then I wanted to failover reports database from TEST-DB01 to TEST-DB02 which is the subscriber database. I failover the subscriber database and its done. I executed DBCC Traceon(1448,-1). I then ran a few update statements on engine database which is new publisher on TEST-DB02 but I dont see them reflect in new subscriber which is reports in TEST-DB02. I see the errors:
The process could not access database 'reports' on server 'TEST-DB01'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20052)
Get help: http://help/MSSQL_REPL20052
Cannot open database "reports" requested by the login. The login failed. (Source: MSSQLServer, Error number: 4060)
Get help: http://help/4060
Login failed for user 'domain\svc_testdb02'. (Source: MSSQLServer, Error number: 18456)
Get help: http://help/18456

 Per Pauls white paper on replication with database mirroring I executed the below query to make a note of the LSN:
SELECT transaction_timestamp, * FROM dbo.MSreplication_subscriptions WHERE publisher     = 'TEST-DB01'   AND publisher_db = 'engine'   AND publication  = '10272014';

After noting down the LSN I tried to run the next set of statements as shown below:

 EXEC sp_subscription_cleanup 
@publisher    = 'TEST-DB01',
@publisher_db = 'engine',
@publication  = '10272014';

and I get the error. Error:The specified publication does not allow subscriptions to be initialized from a backup. To allow initialization from a backup, use sp_changepublication: set ‘allow_initialize_from_backup’ to ‘true’.

So I did this

EXEC sp_changepublication 
  @Publication=10272014,
  @property = N'allow_initialize_from_backup',  
  @value = True 

Now when I run the below query per pauls paper

EXEC sp_addsubscription
@publication       = N'10272014', 
@subscriber        = N'TEST-DB02', 
@destination_db    = N'reports', 
@subscription_type = N'push', 
@sync_type         = N'initialize from LSN', 
@article           = N'all', 
@update_mode       = N'read only', 
@subscriber_type   = 0,
@subscriptionlsn   = 0x00001FEA000003D00024000000000000;

I am getting the forllowing error:

The transactions required for synchronizing the subscription with the specified log sequence number (LSN) are unavailable at the Distributor. Specify a higher LSN.

Can someone tell me if I am doing wrong any where. I am kind of stuck right now. I have already set the Distribution transaction period t0 at least: 12 hours and not more than 24 hours and I started working the entire setup just a couple of hours back.



Replication Configuration problem

$
0
0

 Hello Team,

step 1:

We are trying to configure transactional replication from publication server to subscription server.

Publication configured successfully after that we seeing the replication monitor getting below error under agents.

Error messages:

The job failed.  The Job was invoked by User sa.  The last step to run was step 2 (Run agent.)

Second step

Then after we configure the subscription into subscription server, but we are getting below error and under replication subscriptions I am created subscription not showing.

Kindly help full ASAP, it is very urgent.

SQL Server 2012 Replication with 4 Node

$
0
0

Hi,

I have 4 Node to implement replication. Node 1 will act as publisher and remaining three will act as subscriber 1,2,3.

just want to know the behaviour of replication in different scenarios.

scenario 1:
Publisher get down,  how the replication will behave, will be subscriber 1 [Node 2] will become publisher automatically or we have to do some manual task to make Node 2 and publisher.

What happen when down publisher [Node 1] now become active, what will be behaviour of replication, do we have to perform some manual steps to make Node 1 as Publisher and Node 2 make subscriber. 

What will be ratio of data lost during this switch over.

Kindly guide.

thx


iffi

Transactional Replication configure into different domains

$
0
0


Hi team,

We have two domain, we need actual data immediate from domain one to domain two.

In this scenario we are paling to configure the transactional replication from domain one to domain two.

How to configure the transactional replication for different domains.

What is server and client at sql server level?

$
0
0

Hello Everyone,

What are the difference between server and client at sql server level?

Many time asking my friends and interviewer!!!

 thanks in advance... 

Replication for Data on DEV and QA - bad idea - primary key problem now

$
0
0
I goofed.  I tried to use replication to keep the data on my dev machine up to date with the live server.  Now when I try to work on the database, adding new stuff, it fails.  It says there is a primary key problem every time I try to add a new item to a table with my program.  I should have realized this would happen!  Now, even though I've removed the replication, I'm having the problem.  Can anyone help me get my database functional again :/  Or should I resort to a database restore.  Thanks!
Viewing all 4054 articles
Browse latest View live


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