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

Enable And Disable contraint issue

$
0
0

We are using SQL transaction replication to replicate data between PROD to BI server. During the application application db changes we will be running disable constraint, execute all change and then enable constraints. This enable and disable constraints is taking more than 15 min in production which transaction replication happening, QA/UAT same process happening in 1 min.

Is this the normal behavior.How to solve this

Script used

Total constraints :2600

alter table T_ATTN_QUEST NOCHECK constraintname (sample)


Merge replicationproblem : Article X failed data validation (rowcount only)

$
0
0

Hi

I've created a merge replication a few days ago. it works correctly, but today when click synchronize publications, some of then encounter this error :

Data validation failed for one or more articles. When troubleshooting, check the output log files for any errors that may be preventing data from being synchronized properly. Note that when error compensation or delete tracking functionalities are disabled for an article, non-convergence can occur. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147200953)
Get help: http://help/MSSQL_REPL-2147200953
Article 'OrdType' failed data validation (rowcount only). Rowcount actual: 6, expected: 0. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147200953)
Get help: http://help/MSSQL_REPL-2147200953
Article 'TotBank' failed data validation (rowcount only). Rowcount actual: 31, expected: 23. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147200953)
Get help: http://help/MSSQL_REPL-2147200953
Article 'SlsType' failed data validation (rowcount only). Rowcount actual: 2, expected: 0. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147200953)
Get help: http://help/MSSQL_REPL-2147200953
Article 'ChqGrp' failed data validation (rowcount only). Rowcount actual: 12, expected: 2. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147200953)
Get help: http://help/MSSQL_REPL-2147200953
Article 'PayType' failed data validation (rowcount only). Rowcount actual: 17, expected: 19. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147200953)
Get help: http://help/MSSQL_REPL-2147200953
Article 'Product' failed data validation (rowcount only). Rowcount actual: 3006, expected: 2956. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147200953)
Get help: http://help/MSSQL_REPL-2147200953

Where is the problem and how to solve it?

thanks in advance


http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

Synchronization stop and start

$
0
0
what is impact, if i stop and start Synchronization, for one subscription.

When i start, will it resync all tables by dropping and recreating at subscription.


On Publisher,  
from Location Publiction, 
    right click on subscription, 
            select View Synchronization Status,  From here, stop and start

Issue in Pull Subscription

$
0
0

Hi,

I've got a SQL Server 2005 database where I've created a Pull type subscription and published 6 tables. The client I'm using is a Windows 8.1 Enterprise Edition tablet. Ths issue I'm facing here is when the subscription is created manually it's replicating all the tables from the publisher on to the subscriber end.

Now, I exported these scripts (i.e. create publicaiton and subscription)  from the SQL Server Management Studio and ran them one the query window. This time it only created a subscription but the tables are not replicated and only System Tables tab is being shown.

What am I missing? Any advice on this is much appreciated.

Thanks.

Regards,

Nilesh


Regards, Nilesh

Hr=80070585 ERR:REQUEST NOT QUEUED for ulRSCBId = -1

$
0
0

- We are receiving this error Hr=80070585 ERR:REQUEST NOT QUEUED for ulRSCBId = -1, kindly give us the possible solutions to solve it

Transactional Replication - Snapshot Agent does not start

$
0
0

Hi everyone,

i created a transactional replication (SQL Server 2008 R2) with to different servers.

Server 1 should only be the Publisher.
Server 2 should be the Distributor and the Subscriber.

For this i made 3 users.
- Snapshotagent
- LogReaderAgent
- DistributionAgent

At the Publisher-Database the Snapshotagent and the LogReaderAgent are db_owner.
At the Subscriber-Database only the DistributionAgent is db_owner.
At the Distribution-Database all users are db_owner.

It worked like this since a few weeks.

Today it did not work anymore.
In the SnapshotAgent-View there is the following message:
Unable to start execution of step 2 (reason: Error authenticating proxy booklan\sys_emsysrepssa, system error: Logon failure: unknown user name or bad password.).  The step failed.

If i try to use the Job-Command via cmd.exe i got the following message:
Exception Message: The publisher login must be a member of the 'db_owner' role at the publisher database when generating a regular snapshot.

I deleted the whole configuration and recreated it.
But there is still the same error.

At least i tried to set all 3 user as db_owner for every database.
Same error.

Does anybody have an idea whats wrong?

Thanks a lot!

Configure Subscriber as Publisher in the existing replication.

$
0
0

Hi All,

We have two servers which are currently involved in transactional replication, running smoothly and consider 'dbapub' is the publishing server and 'dbasub' is the subscribing server.

Database size is around 100GB, now our requirement is to add another third server 'dbasub2' without impacting/load on publisher server performance. Hence instead of using 'dbapub'  as publisher we to want to use 'dbasub' as publisher and make 'dbasub2' as subscriber.

Design: 

'dbapub' to 'dbasub' transactional replication (Remains same, 'dbapub' publisher to 'dbasub' subscriber)

'dbasub' to 'dbasub2' transactional replication (New supposed replication, 'dbasub' publisher (already acts as subscriber) to 'dbasub2' subscriber)

Is it feasible, if yes. Do we have to consider anything in prior to configure as per the above requirement.

To the best of my knowledge we need to make sure below points:

1. Need to consider its latency.

2. Articles should be upto 'dbasub2' subscriber requirement. (Means if the required tables are not being replicated from 'dbapub' first publisher to 'dbasub' subscriber it is not possible to replicate from this second supposed publisher to another 'dbasub2' supposed subscriber )

Please suggest.

Regards,

kalyan


Grateful to your time and support. Regards, Shiva

Using Merge Replication with AlwaysOn Availability Group and Pull Subscription

$
0
0

In this setup the regular users on-site have an application frontend installed locally on their computer, while the data resides on a central SQL Server. Some users works off-site, and randomly connects to the company's data network. These users have SQL Server Express installed locally on their laptop which their frontend application connects to. The SQL Server Express is configured as subscribers with Merge Replication. Whenever the off-site users connect to the company's data network through VPN a small program runs the "replmerge.exe" program on a schedule in the background, keeping the data in sync.

To improve the uptime for the regular users on-site the database has been moved to a configuration with AlwaysOn Availability Group with a primary replica and a secondary replica. The on-site users connect to the Availability Group through the Availability Group Listener, this works perfectly for on-site users if a failover occurs.

The primary replica is also set up as the publisher for the Merge Replication while the Distributor role is being taking care of by a different SQL Server. When the off-site users run the "replmerge.exe"-command they connect directly to the primary replica/publisher. This works very well as long as the Availability Group is running on the primary replica, but if the Availability Group fails over to the secondary replica the pull subscribers off-site will not be able to replicate. I wish the subscribers could be configured to connect to the Availability Group Listener instead of directly to the primary replica/publisher, but that will not work.

In http://msdn.microsoft.com/en-us/library/hh882436.aspx I can the following:

Failover of a Merge Pull Subscription

A pull subscription fails upon availability group failover, because pull agent cannot find the jobs stored in the msdb database of the server instance that hosts the primary replica; which is not available because the server instance has failed.

But I’m not sure if this is a problem when the Publisher is configured in a Availability Group or when the Subscriber is configured in a Publisher Group. I’m not sure if this is a problem if the replication is triggered by the “replmerge.exe”-command and not by a SQL Server Agent job.

My questions are:

-         -Have anyone accomplished to get Merge Replication with Pull Subscription connect to the Publisher using an Availability Group Listener working?

-         -In the setup described, will it be possible to reconfigure the subscriber from connecting to the primary replica to the secondary replica in the Availability Group if the Availability Group fails over? If so, any ideas of how to script this so it happens automatically? Is It possible to achieve any of this without having the subscriber to download the snapshot again?

Thanks,

Anders




Uninitialized Subscription SQL 2005 Windows XP

$
0
0

Before we begin i have to admit that i am a noob when it comes to SQL

My error is Uninitialized Subscription

I have  two computers Comp1 and comp2 both have  

-Windows XP

-Microsoft SQL 2005 ( Licensed version )

-Both computers are on the same network

-firewall is off

  •  I can ping the opposite computers from the other (Both ways )

My issue begins with the fact that i cant connect to comp2 sql database  from comp1 even though the firewall is disabled  and the things mentioned above.

I how ever can connect  to comp1 sql database from comp2

When trying to set up replication for a transactional type -set up is as follows

Comp1- Publisher/distributor  Push

Comp2- Subscriber

error - Can not connect to subscriber

I suspect that it has to do with the fact that i cant creat a ODBC connection. I have no clue as to why ...but i think it has to do with the set up with the network not allowing office computers accessing plant floor computers.

The other setup i tried is a when trying to set up replication for a transactional type -set up is as follows

Comp1- Publisher /distributor

Comp2- Subscriber  Pull

error -Uninitialized Subscription

The articles are created and both the agents are running a, but i get that error..if anyone could hep me with this problem i would be eternally grateful.


Data migrate from one server to another through ssis

$
0
0

Hi All,

I want to create the package for transferring the data of 100's table to another server through ssis package.

Data is transformed on the basis of Insert,update,Delete operation.

Please Let me know which tools i have to used in control flow /Data flow task for automate the process of insert/update/delete operation.

I haven't great knowledge of ssis packages so please let me know is there any way to create a dynamic package for transferring the data of 100 table without use 100 oledb source and destination.

Thanks in advance!!

' CDC_capture ' job failed to capture converted ntext to nvarchar(max) columns

$
0
0

Hi Everyone..,

my sql server version is 2008r2 RTM package running on Windows machine 2008R2

I have enabled CDC on a Database with selected tables, it was perfectly working fine,today due to some reason i converted Ntext column to Nvarchar(max) using Alter command , the same it got reflected to CDC table.

After that i inserted some records into that Changed schema table but couldn't get reflected into CDC table.for reason then i checked up with CDC_capture Job 'View History' and getting the following error.

Following is the Error Log :

10/30/2013 18:24:17,cdc.Live_ProdDB_CDC_capture,In Progress,,,cdc.Live_ProdDB_CDC_capture,,,In progress,00:09:38.8330000,,,,,,

10/30/2013

18:23:08,cdc.Live_ProdDB_CDC_capture,Retry,2,HOME\SQL08R2,cdc.Live_ProdDB_CDC_capture,Change Data Capture Collection Agent,,Executed as user: NT AUTHORITY\SYSTEM. Could not locate text information records for the column "ResumeConvertedText"<c/> ID 29 during command construction.[SQLSTATE 42000] (Error 18773)  The Log-Scan Process failed to construct a replicated command from log sequence number (LSN) {0019e6fb:0000091b:01b9}. Back up the publication database and contact Customer Support Services. [SQLSTATE 42000] (Error 18805)  Log Scan process failed in processing log records. Refer to previous errors in the current session to identify the cause and correct any associated problems. [SQLSTATE 42000] (Error 22859),00:00:01,16,22859,,,,9

10/30/2013

18:14:04,cdc.Live_ProdDB_CDC_capture,Error,2,HOME\SQL08R2,cdc.Live_ProdDB_CDC_capture,Change Data Capture Collection Agent,,Msg 22859<c/> Level 16<c/> State 2<c/> Log Scan process failed in processing log records.

Refer to previous errors in the current session to identify the cause and correct any associated problems. For more information<c/> query the sys.dm_cdc_errors dynamic management view.,00:00:00,16,22859,,,,0

10/30/2013

18:22:08,cdc.Live_ProdDB_CDC_capture,Retry,2,HOME\SQL08R2,cdc.Live_ProdDB_CDC_capture,Change Data Capture Collection Agent,,Executed as user: NT AUTHORITY\SYSTEM. Could not locate text information records for the column "ResumeConvertedText"<c/> ID 29 during command construction. [SQLSTATE 42000] (Error 18773)  The Log-Scan Process failed to construct a replicated command from log sequence number (LSN) {0019e6fb:0000091b:01b9}. Back up the publication database and contact Customer Support Services. [SQLSTATE 42000] (Error 18805) 

Log Scan process failed in processing log records. Refer to previous errors in the current

session to identify the cause and correct any associated problems. [SQLSTATE 42000] (Error

22859),00:00:00,16,22859,,,,8

10/30/2013

18:14:04,cdc.Live_ProdDB_CDC_capture,Error,2,HOME\SQL08R2,cdc.Live_ProdDB_CDC_capture,Change Data Capture Collection Agent,,Msg 22859<c/> Level 16<c/> State 2<c/> Log Scan process failed in processing log records. Refer to previous errors in the current session to identify the cause and correct any associated problems. For more information<c/> query the sys.dm_cdc_errors dynamic management view.,00:00:00,16,22859,,,,0

10/30/2013

Following things i troubleshooted :

1.Disable & enabled CDC_capture.

2.restarted sql server agent. (running fine)

Can anyone tell me is there problem in capturing Nvarchar(max) columns for the CDC. and please suggest me some ways and

Thanks in advance & highly appreciated with feedback.

CDC Job capture failure

$
0
0

Recently I Restored a database from Live to Test Instance for implementing CDC feature on sql server 2008 X64 Enterprise Edition on Windows server 2008r2 X64.
***Meant there was NO CDC Enabled in Production Nor Replication Features Its stand Alone. 

Initially i Enabled CDC on Database level and next for 3 Tables, after that i inserted records for all the tables but the same was not getting reflected to CDC tables. then i checked in agent service-> CDC capture Job -> view history, then i got the following below error..

Message
Msg 22859, Level 16, State 2, Log Scan process failed in processing log records. Refer to previous errors in the 

current session to identify the cause and correct any associated problems. For more information, query the 

sys.dm_cdc_errors dynamic management view.


Date14-Dec-13 8:07:35 AM
LogJob History (cdc.HC_UAT_DB_V4_capture)

Step ID2
ServerADDCSVHC05
Job Namecdc.HC_UAT_DB_V4_capture
Step NameChange Data Capture Collection Agent
Duration00:34:29
Sql Severity16
Sql Message ID22859
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted11

Message
Executed as user: Test\hcuat. Could not locate text information records for the column "ExMaritalStatus", 

ID 189 during command construction. [SQLSTATE 42000] (Error 18773)  The Log-Scan Process failed to construct a 

replicated command from log sequence number (LSN) {00232390:00001fc9:0015}. Back up the publication database and 

contact Customer Support Services. [SQLSTATE 42000] (Error 18805)  Log Scan process failed in processing log 

records. Refer to previous errors in the current session to identify the cause and correct any associated 

problems. [SQLSTATE 42000] (Error 22859)


can anyone please help me.., what is the cause for the below error and how i can get rid of this.

"ExMaritalStatus",column -> Nvarchar datatype

Note : 
      *** issue can be solved by disabling & enabling CDC at database level but i need the root cause, again CDC capture job fails for capturing other Nvarchar columns when i Re-Enable at the database level. This cause is getting cycled/looping in capturing other colums.

 Thanks for the advance.


 



Pavicoolman

Can someone explain me the process in database mirroring

$
0
0

Hello,

I want to know what is the exactly process in database mirroring High-safety synchronous, what happen when a failover occur:

I know that the mirror will become principle server, what will happen for mirror server after the principle server come back who will be the principle?

and if the principle server failed permanent and I want to recreate machine to host the principle what will happen to the mirror ??

Regards,

Ayesh.



SQL Server 2012 / 2014 Merge Issue - Cannot insert duplicate key row in object 'dbo.sysmergepublications' with unique index 'nc1sysmergepublications'.

$
0
0

We have a number of customers running SQL 2008 R2, 2012 and 2014 that we have set up with merge replication between their corporate office and their retail stores. The stores are republishing to the registers. We keep getting this error from time to time:

Cannot insert duplicate key row in object 'dbo.sysmergepublications' with unique index 'nc1sysmergepublications'. The duplicate key value is (b10a32a6-f715-4ab5-8499-b151f5059121).

This is wreaking havoc with our help desk.  I thought this problem was fixed by Microsoft with SQL 2005 or 2008.  This has become a major issue.  Does anyone have any ideas? 

1.  What do we need to do to fix it.

2.  What do we need to do to stop it from happening again?

Thanks for any input!

Replicating table from SQL server to NON-sql subscriber is failing

$
0
0

Hi All,

I am replicating a table from SQL server publisher to NON-sql Server Subscriber(Oracle) and it failing with below error

ORA-12899: value too large for column "APPDBA"."MPI_GENEALOGY"."SERIALNO" (actual: 42, maximum: 40) (Source: MSSQL_REPL_ORACLE, Error number: 12899)

I checked the source i.e SQL server and the datatype of SERIALNO is NVARCHAR(40) and in the destination its NVARCHAR2(40).

Please help me out so that i can replicate all the data successfully.


Replicate the value of a computed column not the formula

$
0
0
I'm trying to replicate client data from multiple databases into a single table. So database A, B and C replicate client data to a table in database Z. There is a settings table on A, B and C that holds the businessID and I use a function in a computed column to add this to the client table. At the moment I have just database A and Z as a test and what happens is the computed column gets replicated as a computed column with the formula. 

Can I change this so that I can replicate the computed value (at db A,B,C) of this column?

I don't really want to add a businessID to the table if possible as I'm going to need to add a number of other tables to this replication which will each need to have the businessID, a computed column would be much easier and save updating a load of scripts.

If the above is not possible is there some other solution available so I can identify which database the records came from in the table on database Z?




How to fix jobs conflict in transactional replication

$
0
0

Have two multiple geographically distributed SQL Server Databases with transactional replication.SQL Server agent sync two servers every 1 minute.After working for 10 minutes on server B (subscriber),it has an error, which lasts 10-15 minutes and corrected herself. Then again it working 10 minute and has an error. On server A (publication) I have log backup schedule it runs every 10 minutes. Maybe there is conflict between two jobs ?

SQLServerAgent Error: Request to run job XXX (from User sa)
refused because the job is already running from a request by Schedule 14 (Replication agent schedule.).
Changed database context to 'XXX'. (.Net SqlClient Data Provider)
How to fix it ?


The replication agent has not logged a progress message in 10 minutes

$
0
0
Hi,

I have the merge replication error message for SQL Server 2008 "The replication agent has not logged a progress message in 10 minutes" pop-up. Also, right-click option for Start and Stop Synchronizing in subscriptions has been disabled.

I changed the heartbeat interval to 20 and this error happened 1 week after I created the merge replication. The merge data cannot sync to subscriber and only solution I can use is drop and re-create the merge replication again but error would be re-occur a week later.

Any other solutions?

Thanks
Teddy

Transactional Replicate a Subscriber Database

$
0
0

I'm curious if it is possible to publish a database table for transactional replication that is a subscriber for that table.  Basically, I've got Database A that's the source for table T.  Database B is the subscriber.  I now want to duplicate all of database B to a client database C.

I'm concerned that table T will have problems because it's populated by being a subscriber from database A.

Thanks in advance,

Terry

Stopping Peer to Peer Replication through Scripts in SQL Server 2008 r2

$
0
0

Hi,

During Datacenter migration, following steps are planned to stop a configured Peer to Peer replication setup between two servers.

1. Stop all the inflow of data (Stopping the application and Services)

2. Check for any pending transaction in Publisher/Subscriber

3. When pending transactions is zero, stop the distribution and Log reader agents on both Peer1 and Peer 2 (4 agents to be stopped totally)

Are these steps correct or am I missing something? Kindly provide your inputs.

I could test the above successfully for transactional replication, but due to testing constraints, could not test it for a Peer to Peer replication setup.


Viewing all 4054 articles
Browse latest View live




Latest Images