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

Queue Reader Agent getting aborted

$
0
0

Error messages:
Failed while resolving conflict (Source: MSSQL_REPL, Error number: MSSQL_REPL36047)
Get help: http://help/MSSQL_REPL36047

While Event viewer app log says

Replication-Replication Transaction Queue Reader Subsystem: agent [Server].6 failed. The Queue Reader Agent has encountered the error ''No specified error'' when connecting to "DBNAME" on "Server". Ensure that the publication and subscription are defined properly and that both servers are running.

Replication-Replication Transaction Queue Reader Subsystem: agent [Server].6 failed. Queue Reader aborting

Replication-Replication Transaction Queue Reader Subsystem: agent [Server].6 failed. Failed while resolving conflict

While I have seen for conflict but the windows poping out and saying there are no conflict. how I can resolve it??


Transaction Log Shipping Secondary error: tuf is not a valid undo file for database

$
0
0

I received an alert from one of my two secondary servers (all servers are running 2012 SP1):

File 'E:\SQL\MS SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\MyDatabaseName_DateTime.tuf' is not a valid undo file for database 'MyDatabaseName (database ID 8). Verify the file path, and specify the correct file.


The detail in the job step shows this additional information:

*** Error: Could not apply log backup file 'MyDatabaseName_DateTime.trn' to secondary database 'MyDatabaseName'.(Microsoft.SqlServer.Management.LogShipping)
*** Error: Table error: Page (0:0). Test (m_headerVersion == HEADER_7_0) failed. Values are 0 and 1.
Table error: Page (0:0). Test ((m_type >= DATA_PAGE && m_type <= UNDOFILE_HEADER_PAGE) || (m_type == UNKNOWN_PAGE && level == BASIC_HEADER)) failed. Values are 0 and 0.
Table error: Page (0:0). Test (m_freeData >= PageHeaderOverhead () && m_freeData <= (UINT)PAGESIZE - m_slotCnt * sizeof (Slot)) failed. Values are 0 and 8192.

Starting a few minutes later, the Agent Job named LSRestore_MyServerName_MyDatabaseName fails every time it runs. The generated log backup, copy, and restore jobs run every 15 minutes.

I fixed the immediate problem by running a copy-only full backup on the primary, deleting the database on the secondary and restoring the new backup on the secondary with NORECOVERY. The restore job now succeeds and all seems fine. The secondaries only exists for DR purposes - no one runs reports against them or uses them at all. I had a similar problem last weekend on a different database that is also replicated between the same servers. I've been here for over a year, and these are the first instances of this problem that I've seen. However, I've now seen it twice in a week on the same server.

I'd love to know what caused the problems. Any ideas?

added article through GUI

$
0
0

there are about 300 tables in our replication,  i added one table through GUI,(replication monitor), then start Snapshot agent, will this reinitialize  all the table or just one newly added table.

i am using SQL 2008 R2 publisher, distributor SQL Server 2012, after started snapshot, it started reinitialize , is it because of , added table through GUI instead of script

thanks

V

how to enable foreign keys for replication

$
0
0

hi,

we have problem that on replicated DB  foreign keys are set as not_for_replication = 1. That leads to another problem, that these keys are not trusted. We need trusted keys, so we need use FK for replication (aka set not_for_replication = 0)

we create replication by t-sql functions. 

In function sp_addarticle is possibility to set various flags in parameter schema_option. We are using flag 0x0000000008007FDF. From documentation it seems that parameter responsible for setting flag not_for_replication is

0x20000

Replicates FOREIGN KEY constraints as NOT FOR REPLICATION so that the constraints are not enforced during synchronization.

This flag is set to 0 in 0x0000000008007FDF.

Despite this fact, FK are still set not_for_replication=1   (tried also default value 0x30F3 with same result)

Another way how to make FK trusted is drop them and recreate, but it is not possible due to large DB (last toooo long)

So, please do you know someone why FK are still set not_for_replication=1 even if proper schema_option is used ?

Are we missing something ?

Thank you very much for any help.

What's the difference between SQL Replication and SQL Database Mirror?

$
0
0

Can someone provide me with a link or a list explaining to me the differences between Replication and a database mirror? I'm referring to SQL 2005. Thank you'll so much.

Insert update delete through ssis

$
0
0

Hi All,

I am loading incremental load with the help of given below article but i am facing some issue please help to resolve that

http://www.sqlservercentral.com/articles/Stairway+Series/76390/

I want only last yesterday data that's why i put the condition at oledb source and it working fine.It fetch previous day of data but at the time of lookup , it lookup all data from the beginning and provide the error of insufficient space.

1.please let me know how lookup contain only yesterday data.

2.What to do for lookup all data  (adding space is the solution or something else to do)

3.I want to transfer 100 of tables data everyday. this article is only for transferring one table data.For transferring the data of another table add dataflow task below to Apply stages update or add another sequence container.

Thanks


Delete Publication: "the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission"

$
0
0

OS: Windows Server 2008 SP2.

MS SQL Server 10.0.1600.22

I am the administrator of the computer and of the SQL Server, also the owner of the database.

I have installed a local Publication.

For whatever reason I need to delete it from this server.

I tried with right-click Delete and with Disable Publishing and Distribution.  The same result:

“TITLE: Microsoft.SqlServer.ConnectionInfo

SQL Server could not disable publishing and distribution on <computer-name>\<sqlServerName>.

ADDITIONAL INFORMATION:

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

Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.

Changed database context to 'master'. (Microsoft SQL Server, Error: 15517)”

I also tried:

execsp_removedbreplicationN'<sqlServerName>'

execsp_droppublication @publication =N'<sqlServerName>'

execsp_changedbowner @loginame ='sa'

What exactly is the meaning of: because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission. ?

Because in fact dbo exists and my account has dbo permissions.

Thank you very much,

Dan

Replication . in sql server 2008 R2

$
0
0

Hi ,

I want to know which replication is best supported on production.

where we dont get any performance problems .. 

please consider there are hundreds of databases on 10 instances running on sql server 2005 and 2008 R2.

Thanks in advance,

Shravan


What IPs need to be allowed through our Corp Firewall for SQL replication traffic outbound from our SQL Server CLuster?

$
0
0
I have a SQL Server 2008 R2 cluster with two nodes (active/passive). Here's the configuration :

                              Cluster name : MYCLUSTER .
                              Cluster IP : 123.123.0.10
                              Node 1 (active node) hostname : NODE1
                              Node 1 IP : 123.123.0.11
                              Node 2 (passive node) hostname : NODE2
                              Node 2 IP : 123.123.0.12
                              Instance Name: MYCLUSTER/MYINSTANCE
                              Instance IP: 123.123.0.13

                              I need to have my Network Folks open the Firewall (on Port 1433) to allow SQL Replication Traffic to a SQL Server outside of our Network. We opened the Firewall using the IP of the SQL Instance (123.123.0.13) but that did not do the trick. Can someone tell me what IPs have to be opened at the Firewall to allow the Replication Traffic?

GETMAXVERSION: The lineage parameter is shorter than the minimum required size.

$
0
0

Hi all,

Publisher sql2008, , ~400 subscribers using SQL2008 Express, merge replication pull.

I'm seeing this error in msrel_errors table :

error_code 21512 

error_text GETMAXVERSION: The lineage parameter is shorter than the minimum required size.

Happening for a 8 of the subscribers (so far).  Usually they hit this error twice, and the third sync succeeds.

I'd like to understand whether this is a benign issue, or whether it is an indication of a more serious underlying problem.  Googling this message returns very few results, and nothing of any use.  Can any advise ?

Thanks !

Replication Problem in Stored Procedure with identity column insert

$
0
0
Hello,

I have created two Publications
a) [TestDB]:Pub_ident  (contains an article "ident" table containing identity column)
b) [TestDB]:Pub_Stp    (contains an article "stp_ident" procedure which inserts data in ident table)

After creating subscriber of [TestDB]:Pub_ident publication, a table ident is present in Subscriber DB,
it's identity column is marked as Not For Replication.

After creating subscriber of [TestDB]:Pub_Stp, a procedure is present in Subscriber DB,
code of both TestDB & Subscriber DB is same.


After, alter procedure stp_ident, 
I am getting Error:

Column name or number of supplied values does not match table definition. (Source: MSSQLServer, Error number: 213)
Get help: http://help/213


After lots of googling, I have got the reason behind is insert into ident table,
containing identity column is marked Not for replication.

--------------------
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b992c452-0a20-4a36-a51b-453730b49248/replication-problem-with-stored-procedure?forum=sqlreplicationhttps://social.msdn.microsoft.com/Forums/sqlserver/en-US/b992c452-0a20-4a36-a51b-453730b49248/replication-problem-with-stored-procedure?forum=sqlreplication

factors:

1) Replicated identity columns are marked "not for replication" by default at the publisher when you setup replication through SSMS in SQL2005

2) Any insert statements into a table with an identity column marked 'not for replication' executed from a replication agent 
(distribution agent for example) must supply an explicit value for the identity column

3) In SQL2005, the server verifies the validity of insert statements in stored procedures and triggers during the creation of these 
objects and raises error if it determines that an embedded insert statement does not supply all the required values. 


In more concrete terms, 1) will basically lead to all identity columns being marked 'not for replication' at both the publisher and the subscriber 
and given that your replicated stored procedure is going to be created through a distribution agent connection, 2) and 3) will lead the subscriber 
server into thinking that the insert statement embedded in your stored procedure would need to supply an explicit value for the identity column 
marked 'not for replication' and so it raises an error when an explicit identity value is found missing. Now, the stored procedure that you are 
replicating is probably intended to be executed outside of replication even though it is created through replication so the check is technically 
invalid despite the good intentions behind it.

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

as a workaround I had disabled 'not for replication' property on ident table's the identity column.


After this replication started again, I had made changes to procedure stp_ident and those changes were reflected,

now after sometime I had enabled 'not for replication' property on ident table's the identity column.

To my surprise replication was working fine,

I want to know what is the reason behind this?
Is there a chance for same error to come again, as I am using Replication on Production server.

Which ports to open when doing SQL Replication from a 2008R2 Cluster to a standalone SQL Server outside of your network

$
0
0

I have a SQL Server 2005 cluster with two nodes (active/passive). Here's the configuration :

Cluster name : MYCLUSTER .
Cluster IP : 123.123.0.10
Node 1 (active node) hostname : NODE1
Node 1 IP : 123.123.0.11
Node 2 (passive node) hostname : NODE2
Node 2 IP : 123.123.0.12
Instance Name: MYCLUSTER/MYINSTANCE
Instance IP: 123.123.0.13

I need to have my Network Folks open the Firewall to allow SQL Replication Traffic to a SQL Server outside of our Network.    We opened the Firewall using the IP of the SQL Instance (123.123.0.13) (TCP and port 1433)  but that did not do the trick.   Can someone tell me what IPs have to be opened at the Firewall to allow the Replication Traffic?

Checklist to Validate SQL Replication

$
0
0

Hi Folks,

I'm trying to pull the list of areas or data into a report to validate the replication after SQL or OS patches. Basically I'd like to verfiy the REPL status after patch followed with reboot/restart. We had a few times where the replication couldn't caught due to connectivity issues and didn't resume well. Not sure if anyone of you've faced similar or other issues so, trying to run Pre-Image and Post-Image of sql repl.

My list includes 

1. Check the DB status 

2. Job Status ( Distribution and Log reader agent )

3. Security settings

4. MSrepl_errors

What are the other items that i should include in the list for lookup?  Or any other better approach ?

Please advise.

Thanks

Could not load file or assembly 'Microsoft.SqlServer.Replication.dll' or one of its dependencies. The specified module could not be found.

$
0
0

Hi,

I have an application built in VB.NET 2010 that is connecting to MSSQL Server 2008 R2 Express. I'm trying to do the replication between the Express sever and Standard server. It works fine on the developer machine (Windows 7) and on the Terminal Server 2003 R2 machine. 

However, there is one machine, running Windows 7 that gets this error when I run the sync function.

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Replication.dll' or one of its dependencies. The specified module could not be found.

File name: 'Microsoft.SqlServer.Replication.dll'

The file 'Microsoft.SqlServer.Replication.dll' is located in the same folder where the executable file is. I've searched everywhere and cannot find a reason why this is happening...

I tried installing Microsoft SQL Server 2008 Replication Management Objects x86 and x64, but that didn't help.

Any ideas??

Dragan

Replication - Network activity

$
0
0

Hi,

we have a merge replication between a publisher (SQL Server 2008) and a few dozens subscribers (SQL Server 2008 R2 Express) that are disconnected most of the times. Because the subscribers are rarely connected, we set up the replication agent schedule to run daily, once per minute instead of continuously.

Our network administrator came to see me, showing me the firewall logs. There is a connect attempt between the SQL Server to each subscriber once every second (which doesn't match the once per minute schedule), using all kind of port numbers. It is not exactly once per second, but close.

Do you have any idea what causes this? Some kind of retries on failed connection attempt?

Thank you


Transactional Replication re-initialize from backup

$
0
0

Good evening Colleagues,

So question goes like this. If I use the option to create a publication that allows initialization from backup and then a pull subscription all is well so far.

What happens when for whatever reason the subscription is asking for re-initialization, what are the steps involved,

for ex:
Drop the subscription -> take published db backup -> restore it on top of subscribed db -> recreate subscription.

 Many thanks,

Archie

Distributor transaction retention explanation of ‘at least’ and ‘but no more than’

$
0
0

Good evening,

I missing something to completely understand the subject mechanism.

Let’s say that we set ‘at least’ = 2min and ‘But not more than’ = 10min. The Distribution clean up: distributionjob runs and deletes any logs that are older than 10min. What was the contribution of the ‘at least’ value? 2min old logs would not be touched anyway since it’s only truncating logs older than 10 min.

Many thanks,

Archie

Snapshot Agent Updates statistics

$
0
0

Hi, we have transactional replication publications from SQL 2014 to SQL 2012\2008 R2. When we add new tables to the existing publication and start the snapshot agent, Snapshot agent updates the statistics for random tables on the publisher DB. It appears that all the outdated statistics are being updated regardless which table is being initiated. In a highly transactional environment we can't update the statistics every time. its causing huge issues for us. Is there any work around for this ? 

Thank you!

Replication Wizard doesn't like SQL Server Alias

$
0
0

I tried creating a new replication but I get an error that says,

"SQL Server replication requires the actual sever name to make the connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specifiy the actual server name, 'SomeMachineNumber'."

I don't get this. Why can't I use an alias? I googled and found few articles but not sure if I understand what others are talking about. Here is how I have things set up and I'm hoping someone can explain to me what is happening.

On my machine, I have the following alias set up.

Alias Name: SQLDEV, Port No: 2433, Protocol: TCP/IP, Server: SomeMachineNumber

In Mgmt Studio, I can connect to the server SomeMachineNumber by using the alias SQLDEV. However, if I try to create a new publication on SQLDEV, I get the above error.

Now, just for the heck of it, I created another alias using the same properties as above except, I named the alias the same as the server, "SomeMachineNumber". I connect to the server in Mgmt Studio using the new alias, and now I am able to create the new publication.

Does this make sense? Am I not still using an alias in the second example? Why does the replication seemingly like the alias "SomeMachineNumber", but not "SQLDEV"?

SQL Server 2014 merge replication throws PRIMARY KEY violation during the initialization of Subscriber

$
0
0
Hi Folks,
I am using SQL Server 2014 SP1 to set up merge replication on Windows 2008. The databases (Publisher & Subscriber) are restored from the production back up of SQL Server 2005 publisher database.

The merge replication set up on SQL Server 2005 works fine. However when I set up the merge replication on SQL server 2014, I am getting the following error.
For new tables created in the Publisher & Subscriber, the replication works fine. The isssue occurs only for the existing tables with data.

Error messages:
The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001
The process could not bulk copy into table '"dbo"."FiscalVisitType"'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20037)
Get help: http://help/MSSQL_REPL20037
Batch send failed (Source: MSSQLServer, Error number: 0)
Get help: http://help/0
Violation of PRIMARY KEY constraint 'PK_FiscalVisitType'. Cannot insert duplicate key in object 'dbo.FiscalVisitType'. The duplicate key value is (1). (Source: MSSQLServer, Error number: 2627)
Get help: http://help/2627
To obtain an error file with details on the errors encountered when initializing the subscribing table, execute the bcp command that appears below. Consult the BOL for more information on the bcp utility and its supported options. (Source: MSSQLServer, Error number: 20253)
Get help: http://help/20253
bcp "SIPG_Subscriber"."dbo"."FiscalVisitType" in "C:\Program Files\Microsoft SQL Server\MSSQL12.OGIS\MSSQL\ReplData\unc\PC39606-ORG-D-P$OGIS_SIPG_PUBLISHER_OGIS_PUBLICATION\20150624142806\FiscalVisitType_2.bcp" -e "errorfile" -t"<x$3>" -r"<,@g>" -m10000 -SPC39606-ORG-D-P\OGIS -T -w (Source: MSSQLServer, Error number: 20253)
Get help: http://help/20253

Please find attached the Publisher properties of the article.

Thanks in advance
Bisaac 
Viewing all 4054 articles
Browse latest View live




Latest Images