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

Merge Replication : Log the "Winning" Row

$
0
0

According to this KB

http://msdn.microsoft.com/en-us/library/ms151749(v=sql.90).aspx

 After a conflict is detected, the Merge Agent launches the conflict resolver specified for the article with a conflict and uses the resolver to determine the conflict winner. The winning row is applied at the Publisher and Subscriber, and the data from the losing row is written to a conflict table.

Losing row is logged , what if I want to log also the winning row to compare what changes exactly happened ? when I launch conflict viewer , it looks like the viewer shows the winning row as the last image of the row so there could be more changes in the interiem

Any idea ?

Cheers


Distribution agent skipping replication commands

$
0
0

Hi All

We have transaction replication configured for multiple databases between two servers. The replication configuration is standard, with no custom procedures, all agent profiles are set to default, etc. The only non-standard configuration is that CDC is configured on some of the destination objects. A snapshot publication is also configured, which we will get to later. 


We've come across a bizarre incident with transactional replication where the distribution agent would just skip a number of replication commands. Initially this was a rare occurrence and we would manually fix the data on the subscriber. The missing data was only occurring for one specific publisher database. Our initial thoughts were that the data was just being deleted by the users of the replicated data. As the occurrence of missing replication data increased we investigated by making use of one of the destination tables that had CDC configured. But we could not find evidence of the missing data being deleted by the users.

After this we went through all possible reasons why the data would not be replicated to the subscriber, following all suggestions in this article: http://technet.microsoft.com/en-us/library/ms152532(v=sql.105).aspx

After exhausting all options, we ran a trace on the subscriber, focusing on a single article publication. The trace was setup to return the events SQL:BatchStarting and RPC:Starting. When the distribution agent failed, being unable to update a row that did not exist at the subscriber, the corresponding insert command was found in the distribution database (using sp_browsereplcmds) but not in the trace. We noticed that the distribution agent had in fact skipped few xact_seqno’s. This was occurring for many of the distribution agents.

Checking the missed xact_seqno’s against  MSrepl_transactions, we noticed that the missed replication commands were always at around 11PM every day. The snapshot replication publication was scheduled to run at this time. The schedule was changed to run daily at 4PM, after which the skipped replication commands occurred at around this time. We have since disabled the snapshot replication job and will be able to determine whether this is the cause tomorrow.

So I guess my question is, is there a reason why a snapshot publication (presuming this is the cause) would cause a transaction replication distribution agent to skip replication commands?

Why sometimes a setting of Polling Interval = 60 does not always trigger subscriber to publisher updates every 60 seconds?

$
0
0

Hi,

We currently have a merge replication setup set at a High Volume Server To Server with an interval setting of 60. A lot of times, especially when we observe it first had with the replication monitor, it does not always update every minutes -- sometimes 2 minutes and sometimes even longer. This happens more when the updates are coming from the subscriber -- we did a test and make updates on both subscriber and publisher separately. The result is its often longer when the record change is coming from the subscriber.

Anyone can shed a light on what could be happening? Is there any way we can make it replicate much closer to 60 seconds?

Thanks in advance!

Regards,

Joseph


MCP, MCSD, MCDBA (ANXA)

Replication Issue

$
0
0

Hi to all

I'm in very much critical situation please help me out.

I'm having Sql Server 2012 SP1 Database (2012LiveDB) (which is nearly 200 GB) , Eventually i want to restore this database into Sql Server 2005, But backward compactibility is not possible.

So in this case i did Snapshot replication from Sql server 2012SP1 to Sql Server 2005 SP2. 
after completition of this replication to Sql Server 2005, 
I tried to insert a record into a table which is having constraints like (Primary key (unique cluster index) & Default constraint), 

its throwing an inappropriate error like :-

Msg 2627, Level 14, State 1, Line 1
Violation of PRIMARY KEY constraint 'PK_HCM_COUNTRIES'. Cannot insert duplicate key in object 'dbo.hcm_countries'.
The statement has been terminated.

my insert statement : -

insert into hcm_countries (CountryTitle) values ('india')


1. There is all distinct records in HCM_countries table.
2. when i drop unique cluster index and then insert it, its going fine but cannot recreate   Unique cluster index. Getting same error.

My table Structure: 



Is this because of replication for Backward compactibility ??

I'm totally stucked and running out of time,

Please give me any other troubleshooting methods for the above and 
Is there any other method so that i can get all User defined table into Sql server 2005  database or atleast in sql server 2008. With Identity coumn by default and with indexes. 

Replies are highly appreciated and many thanks.













Pavicoolman

Change Distribution Configuration from acts as its own Distributor to uses another server as its Distributor.

$
0
0

We currently have a SQL Server configured to act as its own distributor. This server features about 25 publications (some pretty large). We configured another server that will function as a dedicated replication distributor. 

My question:   Is there a way to cutover to the new dedicated replication distributor without having to regenerate snapshots and rebuild subscriptions?

Are there any “gotchas” that we should keep in mind before attempting this transition?

Error during Replication

$
0
0

Hi,

I am trying to reseolve these error on SQL 2008 R2 replication. These are the errors:

2013-11-18 16:31:59.044 Initializing

2013-11-18 16:32:00.026

42S02 Invalid object name 'dbo.POOPT'. 208

2013-11-18 16:32:00.026

42S02 Invalid object name 'dbo.POOPT'. 208

2013-11-18 16:32:00.026

42S02 Invalid object name 'dbo.POOPT'. 208

2013-11-18 16:32:00.026

42S02 Invalid object name 'dbo.OEOPT'. 208

2013-11-18 16:32:00.026

42S02 Invalid object name 'dbo.POOPT'. 208

2013-11-18 16:32:08.061 Disconnecting from Subscriber 'BBITDWS'

2013-11-18 16:32:08.061 Connecting to Subscriber 'BBITDWS'

2013-11-18 16:32:08.061 Error executing a batch of commands. Retrying individual commands.

2013-11-18 16:32:16.844 Disconnecting from Subscriber 'BBITDWS'

2013-11-18 16:32:16.844 Connecting to Subscriber 'BBITDWS'

2013-11-18 16:32:16.844 Error executing a batch of commands. Retrying individual commands.

2013-11-18 16:32:28.998 Disconnecting from Subscriber 'BBITDWS'

2013-11-18 16:32:28.998 Connecting to Subscriber 'BBITDWS'

2013-11-18 16:32:28.998 Error executing a batch of commands. Retrying individual commands.

2013-11-18 16:32:46.986 Disconnecting from Subscriber 'BBITDWS'

2013-11-18 16:32:46.986 Connecting to Subscriber 'BBITDWS'

2013-11-18 16:32:46.986 Error executing a batch of commands. Retrying individual commands.

2013-11-18 16:33:09.170 Disconnecting from Subscriber 'BBITDWS'

2013-11-18 16:33:09.186 Connecting to Subscriber 'BBITDWS'

2013-11-18 16:33:09.186 Error executing a batch of commands. Retrying individual commands.

2013-11-18 16:33:36.519 Disconnecting from Subscriber 'BBITDWS'

2013-11-18 16:33:36.519 Connecting to Subscriber 'BBITDWS'

2013-11-18 16:33:36.519 Error executing a batch of commands. Retrying individual commands.

2013-11-18 16:33:38.516 Agent message code 208. Invalid object name 'dbo.POOPT'.

2013-11-18 16:33:39.202 Category:COMMAND

Source:  Failed Command

Number:

Message: if @@trancount > 0 rollback tran

2013-11-18 16:33:39.389 Category:NULL

Source:  Microsoft SQL Server Native Client 10.0

Number:  208

Message: Invalid object name 'dbo.POOPT'.


Windows Sync Center Scheduler - Synchronization Issues

$
0
0

Hi, I am having some issues setting up the windows synchronization schedule on a system I am working on.

I have set up the sync center (the subscription was already set - it is pull subscription) and chosen windows authentication, since I have my own personal logon and I log off the system after every use, the sycn center scheduler does not work. I need to set up some way to have the scheduler work for times when I am not around the system. 

Since the SQL Server authentication on the Sync Center prompts to enter the username/password and does not save it, that is also not an option.

I also tried the mergrepl.exe script, but it fails too with the following error message - " You do not have sufficient permission to run this command. Contact your system administrator." I added the publisher, subscriber and distributor details.

SQL Server Agent is not running - so I cannot set the scheduler on the SQL Server itself.

What alternatives do I have to make the scheduler work and ensure that the data gets synced correctly and on a schedule?

Thanks,
Aditi

SQL 2012 - Merge Replication's sp_mapdown_bitmap breaks SSIS updates

$
0
0

Since we have enabled Merge replication on our tables, some of our SSIS packages have broken.

The issue is always the same, update statements sent to certain tables through an OLE DB Command are broken.

The error message is

"The metadata could not be determined because statement ‘exec @retcode = sys.xp_mapdown_bitmap @mapdownbm, @bm output’ in procedure ‘sp_mapdown_bitmap’ invokes an extended stored procedure.

Unable to retrieve destination column descriptions from the parameters of the SQL Command."

Some Googeling brought us to this link, though it is for SQL 2005 and we are using SQL 2012: 

"http://social.technet.microsoft.com/Forums/sqlserver/en-US/67519e6a-d4cf-49ba-93dd-b0eb5229fb92/replication-trigger-problem-sql-2005-assistance-please?forum=sqlreplication"

And indeed, since then we have found out that the issue only occurs on tables whose Merge Replication trigger contain a call to sp_mapdown_bitmap. Different from the article above, we only have the issue in SSIS. The same update statement executed from SSMS works without a problem. We even tried makeing a SP that performs the update, and then calling that SP from SSIS, but no luck. The SP runs perfectly from SSMS but won't validate on SSIS.

Offcourse, recreating the tables in question would solve the problem for now, but we need a more permanent solution. Columns will be added and removed in the futur, and recreating a table each time that happends isn't realistic.


merge replication agent fail

$
0
0
Hi,

I have a merge replication between 5 servers. Since last weekend, the agent fail for one of the server (located in Florida) with the following error:

The merge process could not perform retention-based meta data cleanup in database 'DB_Prod'.
(Source: Merge Replication Provider (Agent); Error number: -2147199467)
---------------------------------------------------------------------------------------------------------------
Could not continue scan with NOLOCK due to data movement.
(Source: FLOETC (Data source); Error number: 601)
---------------------------------------------------------------------------------------------------------------

The replication with the other servers works fine. And locally in Florida, all operations run smoothly, data are ok in the database.
I ran a DBCC checkDB on the Florida's database:

Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 274152072, index ID 1. Parent node for page (1:69360) was not encountered.
Server: Msg 8936, Level 16, State 1, Line 1
Table error: Object ID 274152072, index ID 1. B-tree chain linkage mismatch. (1:69360)->next = (1:69361), but (1:69361)->Prev = (1:117308).
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 274152072, index ID 1. Parent node for page (1:69361) was not encountered.
Server: Msg 8935, Level 16, State 1, Line 1
Table error: Object ID 274152072, index ID 1. The previous link (1:69361) on page (1:69362) does not match the previous page (1:135) that the parent (1:161), slot 1 expects for this page.
DBCC results for 'DB_Prod'.

what can I do with that?? any idea how I can fix this problem?

thanks a lot for your time and help

Running the ReplMerg.exe throws permission error

$
0
0

On trying to run replmerg.exe through command prompt, I get a permission error saying : 

CReconcilerTask               , 2013/11/19 15:49:05.059, 9356,   409,  S1, INFO: =============== STARTING OF MERGE ===============
............
replrec!FillErrorInfo         , 2013/11/19 15:49:05.195, 9356, 20097,  S1, ERROR: ErrNo = 0x80045901, ErrSrc = <null>, ErrType = 9, ErrStr = You do not have sufficient permission to run this command. Contact your system administrator.
DatabaseReconciler            , 2013/11/19 15:49:05.232, 9356, 20210,  S2, :T:,110,0,2,,,,,,,
DatabaseReconciler            , 2013/11/19 15:49:05.232, 9356, 20217,  S2, INFO: Session Highlights: FAIL, 
CReconcilerTask               , 2013/11/19 15:49:05.239, 9356,   645,  S1, INFO: =============== ENDING OF MERGE =================

I have added a log and the log reads like :

2013-11-19 15:49:05.141 OLE DB Distributor 'RMS': {call sp_MSgetversion }
2013-11-19 15:49:05.148 OLE DB Distributor 'RMS': {call sp_helpdistpublisher (N'RMS') }
2013-11-19 15:49:05.191 OLE DB Distributor 'RMS': {call sp_MShelp_repl_agent (N'RMS', N'rms', N'RMS1', N'D-RMS1', N'rms', 1)}
2013-11-19 15:49:05.195 You do not have sufficient permission to run this command. Contact your system administrator.
2013-11-19 15:49:05.201 Percent Complete: 0
2013-11-19 15:49:05.203 You do not have sufficient permission to run this command. Contact your system administrator.
2013-11-19 15:49:05.221 Percent Complete: 0
2013-11-19 15:49:05.224 Category:SQLSERVER
Source:  Merge Process
Number:  14260
Message: You do not have sufficient permission to run this command. Contact your system administrator.
2013-11-19 15:49:05.227 Percent Complete: 0
2013-11-19 15:49:05.229 Category:COMMAND
Source:  Failed Command
Number:  0

I have added my windows account as the DB_Owner for the Subscriber database. 

This is a pull type subscription and I need to add a scheduler to synchronize daily the data from the publisher which is on another system to the subscriber which local to the system I am working on.


What can I do to ensure this command runs okay? The issue is I am unable to use Windows Sync Center to schedule the synchronization as it does not save the username/password and I need to log-off the system after every usage so windows authentication does not work either.

Any suggestion/help will be greatly appreciated.

Thanks!

A


Cannot Insert value Null INTO column. [Question was Marked as Answered YET it is UNANSWERED]

$
0
0

Hi All,

This question has been asked some time back. A forum post marked it as answered yet it wasn't fully answered.

I need your help. The link to the original question [which is the same as mine] is: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/06f17a33-4540-4eb4-bc3b-3daf798462f7/cannot-insert-the-value-null-into-column-pubid-table-ihpublications?forum=sqlreplication

I really need to know what went wrong or why I'm getting that sort of error.

Thanks in advance.

NB: My desire here is to point other more knowledgeable persons to the original question, so that they could proffer solutions. 


Arthur...


It will also be helpful (VERY) if you make your contributions on that link, so that the body of knowledge could be centralized for ease of access for others. Thanks..

Cannot insert the value NULL into column 'pubid', table IHpublications

$
0
0

Setting up peer-to-peer replication on sql server 2008 r2.  Attempting to create a publication getting errror message: Cannot insert the value NULL into column 'pubid', table IHpublications

Replication of Just One Partition

$
0
0

We have a bunch of 2000-based partitioned views.  The beauty of partitioned view is that when we reinitialize, i.e. it something gets out of sync between pub and subs, we can just replicate over the most recent table.  This is critical for us because we have some monster view containing over a billion rows, 30+ tables and over half a terabyte in size.  

Now we about to migrate to SS 2012 (from 2005 actually) and I'd like to get rid of the above and go to the new table partitioning of course.  However, I must be able to reinitialize and I need to be able to reinitialize only the latest partition.

Is there a way to do this, i.e. to reinitialize only one partition?

(I asked this on another board, but got no answer and then realized I need to ask it in the replication forum.)

Only primary key and clustered indexes are being replicated non-clustered indexes aren't being replicated

$
0
0

I'm using schema option 0x00000000000090F3 on every table article in my publication being used for transactional replication, serving 6 pull subscriptions.  This option includes each of these options:

0x0000000000000001
0x0000000000000002
0x0000000000000010
0x0000000000000020
0x0000000000000040
0x0000000000000080
0x0000000000001000
0x0000000000008000

My understanding of BOL is that, since it includes 0x10 and 0x40 that all indexes on the table should be replicating to the subscribers.  But that isn't happening -- I'm only getting primary key indexes/constraints and clustered indexes.  Is there a reason the non-clustered indexes might not be replicating as well?  

I have read a few posts here and there that indicate indexes don't get replicated, or that the sync option might be a factor.  What would cause this?

The replication option 'publish' of database has been set to false.

$
0
0

I have ran below command

sp_replicationdboption 'dbname','publish','true'

and received:

Server: Msg 20028, Level 16, State 1, Procedure sp_MSpublishdb, Line 53
The Distributor has not been installed correctly. Could not enable database for publishing.
The replication option 'publish' of database <DBName>has been set to false.


Rahul


Adding New Articles (Tables/Views) to Existing Merge Publication & Reinitialization

$
0
0

Hi All,

When I add a brand new article to a publication, that has no joins or filtering configured, can I get around re-initialization without running into a problem?

Thanks.

Merge Replication Error

$
0
0

I'm receiving the following error. I noticed that two tables with same name and diff schema is the cause. Any workaround for this.?

The subscription could not be initialized using an initial snapshot because one or more tables in the subscription belong to another publication, and therefore cannot be dropped. Consider initializing the subscription manually without using a snapshot.


 - Kerobin


Configuring Replication for IIS 8

$
0
0

I am setting up merge replication for SQL 2012 and SSCE via IIS. The IIS boxes are Windows 2012 with a role of web server. I followed the instructions from IIS 7 as I could not find any for IIS 8.  

I did the following:

  1. Install data connectivity tools
  2. copied replisapi.dll and registered it
  3. setup a virtual directory under the default web server
  4. setup handler
  5. setup security for basic auth
  6. created a new user and added it to the iis_iusr group and gave it permissions to the folder where replisapi.dll was copied
  7. create a new app pool and used the new user from above as the identity
  8. add the new app pool as the virtual directories app pool and verified that it logins in via test settings. Identity is valid per test settings.

When I tried to test using server/sync/replisapi.dll?diag I get a 503. In the event log an error say the credentials are bad or login is missing batch_login (see below). Yet even making the user an admin it fails. Stumped any ideas?

The identity of application pool Sync is invalid. The user name or password that is specified for the identity may be incorrect, or the user may not have batch logon rights. If the identity is not corrected, the application pool will be disabled when the application pool receives its first request.  If batch logon rights are causing the problem, the identity in the IIS configuration store must be changed after rights have been granted before Windows Process Activation Service (WAS) can retry the logon. If the identity remains invalid after the first request for the application pool is processed, the application pool will be disabled. The data field contains the error number.

Thanks

replication-replication distribution subsystem agent null failed. the publication does not exist.

sync two remote servers

$
0
0
I have two remote SQL Server 2008 R2,   what are the option,  to sync both data everyone hour,

I want to stay away from Replication.

I would like to have scheduled job to sync btw two server.

thanks
v
Viewing all 4054 articles
Browse latest View live




Latest Images