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

Transactional replication - Set value to different CASE does not replicate value

$
0
0

I have the same table in two different publisher databases, however in one database replication successfully replicates changes to a values case (upper to lower or lower to upper ) but in the other it does not. 

Both pairs of tables are exactly the same at the publisher and subscriber. Specifically in terms of collation and the NOT FOR REPLICATION settings. There are also no triggers on any of the tables. All databases have the same database level collation and both databases live on the same publisher server and subscriber server respectively.  

The articles appear to be the same with the same schema_options configured. 

Replication does not appear to replicate any values over to the subscriber for the table not being updated. I determined this by hacking the subscriber UPDATE stored procedure to log all parameters passed in.

Is there an option somewhere I'm missing which defines how replication handles values set back to themselves but in a different case, and whether these values will be replicated or not?



Replication database on end user.

$
0
0

Hi I got a requirement that my application must have feature that can replication/update local database scheme like table,view,store on end user.

Anyone can give my sample snipplet code or project or information or anything worth.

Thank you.

Add new objects to a database which is used in replication

$
0
0

Hi, We are using SQL Server 2008 R2 database and this database is a publisher and this is a push transactional replication. Irrespective of how trivial (like add a column or change datatype) or adding a bunch of articles to the replication then creating a new snapshot and synchronizing the subscription to apply the schema and data for the new articles needs to be done. What if the database is growing big everyday and if such changes happen frequently and slows the system down. Is there a way to check and apply snapshot only for the articles that got changed or added?

Could you please suggest me a best practice that we need to implement?

Thanks in advance............


Ione




Cannot view Distributor Properties and create a new publication in SQL Server 2012

$
0
0

I created a distributor, publisher and subscriber in SQL Servers successfully few weeks ago.

I want to record steps to create distributor for preparing documentation. 

Therefore I select "Disable Publishing and Distribution" in Replication to drop all replications. I found that the task is too slow and then I stop the task

I try to open Distributor Properties, it shows the following error

Message 1: SQL Server is unable to complete the Distributor Properties. (Distributor Properties)

Message 2: Could not refresh properties of this object from server. Check if this object still exists on the server.  (Microsoft.SqlServer.Rmo)

Program Location:


   at Microsoft.SqlServer.Replication.ReplicationObject.Refresh()
   at Microsoft.SqlServer.Management.UI.DistDBList.Load(ReplicationSqlConnection distConn)
   at Microsoft.SqlServer.Management.UI.DistributorProperties.LoadProperties()
   at Microsoft.SqlServer.Management.UI.DistributorProperties..ctor(IServiceProvider serviceProvider)
   at Microsoft.SqlServer.Management.UI.DistributorPropertiesControl.OnHosted()
   at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.SetSite(IServiceProvider sp)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.ProcessAllViews()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(ISqlControlCollection control, IServiceProvider provider)
   at Microsoft.SqlServer.Management.UI.LaunchDistributorProperties.PrepareToShow()

Can anyone advise on this problem?

Thanks,

Tony

Update query is slow with merge replication

$
0
0
Hello friend,

I have a database with enabling merge replication.
Then the problem is update query is taking more time.
But when I disable the merge triggers then it'll update quickly.

I really appreciate yourquick response.

Thanks.

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



sp_adjustpublisheridentityrange not executed regularly by distribution agent

$
0
0

Hello,

I´ve setup a transactional publication with updatable subscriptions. Very easy setup, only one subscriber. However client applications using the database at the subscriber regularly getting constraint violation messages on insert with the hint to use sp_adjustpublisheridentityrange manually. This helps for some time but then the errors comes again. I´ve read that the stored procedure is normally executed by the distribution agent and the problem could happen when the distribution agent hasn´t run for a while. However the distribution agent is continuously running and replicating data at least every 10 minutes. What could I do to investigate the reason?

Greetings, Jörg

The row was not found at the Subscriber when applying the replicated command.

$
0
0

Hello,

I am getting this error can someone help me plz

The row was not found at the Subscriber when applying the replicated command.

why the publisher failed to deliver the row to the subscriber


MERGE REPLICATION - HIGH VOLUME OF CHANGES

$
0
0
Hi everybody, i wanna ask you if somebody can tell me some recomendations when you have setted a merge replication environment and you have to replicate millions of records to some suscribers.

SQL 2005 Replication with Oracle 11g

$
0
0

Hello Everyone,

Thanks in advance for looking at this. I am setting up replication from SQL Server 2005 with an Oracle 11g source.  I've installed the Oracle 11g client and set up the service name on the SQL Server.  I can successfully test the connection from SQL to Oracle via the Oracle Net Manager as well as SQLPLUS.

When I try to add the Oracle Publisher to SQL, I can't get past the SQL Error 21627.

"Unable to connect to Oracle database server 'Name' using the Microsoft OLEDB provider MSDAORA."

Any ideas on what I am missing? 

Thanks,

Eric

Snapshot replication : no replication transactions are available.

$
0
0

Hi All,

We have the snapshot replication set up. I see that publisher has 221 records and subscriber has 113 records. When i tried to run the replication job .  job succeded but as out put i got no replicated transactions are available.

Then i re ran the snapshot agent. and i checked that snapshot generated with 221 records. Again i started the replication from view synchronization status and increased the -outputverboselevel 2 and I see that.

2014-11-25 12:01:02.526 OLE DB Distributor '': {call sp_MSget_subscription_guid(130)}
2014-11-25 12:01:04.307 sp_MSget_repl_commands timestamp  value is: 0x0x00005ad30000001600020000064a
2014-11-25 12:01:04.307 The commit timestamp  value is: 0x00005ad30000001600020000064a
2014-11-25 12:01:04.307 No replicated transactions are available.
2014-11-25 12:01:04.932 Adding alert to msdb..sysreplicationalerts: ErrorId = 0, 
Transaction Seqno = 0000000000000000000000000000, Command ID = -1 

Please suggest why data is not replicated. I can do the re initialization here.. but i don't want to do it.

I want to understand the problem here. Why the 90+ records are not getting replicated.

Please help 

Thank you!!

Foreign keys problems during distrib.exe

$
0
0

SQL 2012 SP1 (I'll upgrade in few days, I know -__-)

I have set up a transactional replica through 2 big db on different servers. I set it up to not be continuous.

Executing DISTRIB.EXE correctly delivers commands, on demand.

I scheduled it to run every 5 minutes. It has worked pretty well for 2 days until I noticed an error related to a FK. It seemed that commands were trying to delete a row from a table referenced from another table, I suspect not yet deleted for that ID.

Isn't replica process able to understand to delete first-leaf table the last ?

Do I have to setup precedence on table execution commands ?

Thanks for help.

cmdshell usage in replication-cleaning

$
0
0

Hello,

I have a replica in a server that its performance is critial/poor.

Checking the job's history involved with the replication I have found that a "Distribution clean up: distribution" is not executing successfully.
Then, manually I execute the procedure involved and it looks like xp_cmdshell is the one causing all the problems.

  • Have checked that xp_cmdshell is enabled.
  • Have verified that both services (agent and sql) are being run as "Local System" (and restarted the services/server)
  • Have tried executing xp_cmdshell with a proxy account and nothing (not on a domain and with administrator's credentials: MYSERVER\Administrator)
  • Have tried disabling the anti-virus just in case

The error I'm recieving is:"An error occurred during the execution of xp_cmdshell. A call to 'CreateProcess' failed with error code: '5'."

According to the web or articles I have read, this error is about security but I have the maximum privileges possible am I correct?

What other situations am i missing here?
The server is operating with Windows Server 2003; SP2 32bit

SQL: Microsoft SQL Server 2005; SP2

Any info is highly appreciated
Thanks for your help and time


JaimePR,

BCM Error 'Could not complete their last action'

$
0
0

While there isprobably a problemwithan array.This error isknown?Is it posible to change manually in thestored procedure atsql server?I am notaware towhich variable it isexactly. Orifall referencesare limited to 100in number.

V] [12:45:47.3681164]Iris.Mapi.MessageStore:    bei Microsoft.BusinessSolutions.eCRM.Mapi.MessageStore.MapiProp.OpenProperty(PropTag OpenPropTag, Type InterfaceType, IMAPIProp_OpenProperty_Flags flags)
   bei Microsoft.Interop.Mapi.MAPIPropImpl<IMessage,Microsoft::Interop::Mapi::IMessage>.OpenPropertyManaged(MAPIPropImpl<IMessage\,Microsoft::Interop::Mapi::IMessage>* , UInt32 ulPropTag, _GUID* lpiid, UInt32 ulInterfaceOptions, UInt32 ulFlags, IUnknown** lppUnk)
[E] [12:45:47.4491245]Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils: Could not layout block 'Angestellte', for 'Microsoft.BusinessSolutions.eCRM.BusinessLayer.RelationshipGridFormLayoutBlock'
[E] [12:45:47.4501246]Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils: Der Index war außerhalb des Arraybereichs.
[E] [12:45:47.4501246]Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils: System.IndexOutOfRangeException: Der Index war außerhalb des Arraybereichs.
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.RelationshipGridBlock.get_GridData()
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.RelationshipGridBlock.<LayoutBlock>b__1(Int32& rowIndex, Int32 rowCount)
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.CachedGridView.FetchRows(Int32 rowIndex)
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.CachedGridView.Initialize()
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.RelationshipGridBlock.LayoutBlock(Int32& currentRow)
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.BaseBlock.Layout(Int32& currentRow, Boolean activate)
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.LayoutEngine.CreateGroup(FormSection section, IFormLayoutGroup group, Boolean isFirstGroup)
[E] [12:45:47.4531249]BCMRes: Der Einfügeindex liegt außerhalb des gültigen Bereichs. Der Index darf keine negative Zahl sein und muss kleiner oder gleich der Größe sein.
Parametername: index
[E] [12:45:47.4531249]BCMRes:    bei System.Collections.ArrayList.Insert(Int32 index, Object value)
   bei System.Windows.Forms.TableLayoutStyleCollection.System.Collections.IList.Insert(Int32 index, Object style)
   bei System.Windows.Forms.TableLayoutRowStyleCollection.Insert(Int32 index, RowStyle rowStyle)
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.FormGroup..ctor(FormSection section, IFormLayoutGroup groupData, Boolean designMode, Int32& sectionRow)
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.LayoutEngine.CreateGroup(FormSection section, IFormLayoutGroup group, Boolean isFirstGroup)
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.LayoutEngine.LayoutGrid()
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.StandardPage.LayoutGrid()
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.CSUtils.StandardPage.BeforeFormRegionShow()
   bei WinFormsRegions.ManagedRegion.BeforeFormRegionShowInternal()
   bei WinFormsRegions.ManagedFormRegionsAddin.BeforeManagedFormRegionShow(FormRegion FormRegion)
   bei Microsoft.BusinessSolutions.eCRM.OutlookAddIn.Connect.BeforeFormRegionShow(FormRegion FormRegion)

Replication problem with filtered table

$
0
0

Hi all...
when I active a filter on a TABLE over one that run without problems...

  1. WHERE ISNULL([Stato],'ATTIVO') = 'ATTIVO' (ok  no errors)
    but
  2. WHERE ISNULL([Stato],'ATTIVO') = 'ATTIVO' AND pubblished = 1 (see below)

After few hours always have some rows missed in replication articles and have probelms in my process.
pubblished is boolean field! this can be a problem?

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

Command attempted:
if @@trancount > 0 rollback tran
(Transaction sequence number: 0x00E7461B000001E5000100000000, Command ID: 9)

Error messages:
The row was not found at the Subscriber when applying the replicated command. (Source: MSSQLServer, Error number: 20598)
Get help: http://help/20598
The row was not found at the Subscriber when applying the replicated command. (Source: MSSQLServer, Error number: 20598)
Get help: http://help/20598


Missing stored procedures (sp_MSins / sp_MSdel / sp_MSupd) when adding subscription with initialize from backup

$
0
0
I'm experiencing odd behavior when setting up a subscription using initialize from backup. I have 5 publications across two databases. Every time I rebuild replication, one of the subscriptions will have the it's ins/up/del stored procedures missing. For example:

Publication A -> Server A - GOOD
Publication A -> Server B - GOOD
Publication A -> Server C - MISSING
Publication A -> Server D - GOOD

This isn't limited to the same server every time, appearing to be random. It's also not limited to the same publication either. 

I noticed in CU5 there was a KB update addressing this issue (http://support.microsoft.com/kb/2863979), but my case is slightly different. I've since tested this with CU5 installed, and the issue is still apparent.

It is worth mentioned that I had the same configuration setup when our SQL servers were 2008 R2 and everything worked fine. It's only since we've moved to 2012 that this issue has appeared.

SQL Server Transactional Replication - Schema change failed on object - Snapshot agent is not running

$
0
0

We have Transactional Replication running from SQL Server 2005 to 2012 (both standard editions). The distributor sits with the subscriber on the SQL2012 machine. Since we fired it up we have been gettingsporadic failures of data import SPs. By sporadic I mean cca. 1 failure in 20-30 executions. The error message is:

Schema change failed on object '[dbo].[TableA]'. Possibly due to active snapshot or other schema change activity.

But...

Due to active snapshot? - We don't use the Snapshot Agent; it is disabled.

Other schema change activity? - We are getting these failures since we started using replication and we are doing just as much schema changes at the moment as we had been doing before replication was started.

 The schema changes the SPs do are along these lines:
ALTER TABLE dbo.TableA NOCHECK CONSTRAINT Constr1
--insert some stuff etc.
ALTER TABLE dbo.TableA CHECK CONSTRAINT Constr1

or

ALTER TABLE dbo.TableA DISABLE TRIGGER ALL

Triggers, check constraints are NOT replicatied.

The question is then: Why are we getting this?

The parameters of the publication for your reference:

pubid   1
restricted 
0
status 
1
task   
1
replication frequency  0
synchronization method 
3
immediate_sync 
0
enabled_for_internet   
0
allow_push 
1
allow_pull 
0
allow_anonymous
0
independent_agent  
1
immediate_sync_ready   
0
allow_sync_tran
0
autogen_sync_procs 
0
snapshot_jobid 
0xFFFF
retention  
0
has
1
subscription   
allow_queued_tran  
0
snapshot_in_defaultfolder  
1
alt_snapshot_folder
NULL
pre_snapshot_script
NULL
post_snapshot_script   
NULL
compress_snapshot  
0
ftp_address
NULL
ftp_port   
21
ftp_subdirectory   
NULL
ftp_login   anonymous
allow_dts  
0
allow_subscription_copy
0
centralized_conflicts  
NULL
conflict_retention 
14
conflict_policy
NULL
queue_type 
NULL
backward_comp_level
40
publish_to_AD  
0
allow_initialize_from_backup   
0
replicate_ddl  
1
enabled_for_p2p
0
publish_local_changes_only 
0
enabled_for_het_sub
0

Transactional Replication - Log reader & distribution agent job failing with Query timeout expired (error code - HYT00)

$
0
0

I have setup replication in Azure IaaS environment using sql 2012. We have a large database of size 1 TB and replications is setup  with 5 publications(around 200 tables) we have filters for few tables as well.

I see that log reader agent and distribution agent jobs are failing with 'Query timeout expired' and High sysyem usage. So I have changed the agent profile setting to -Querytimeout 50000 and -readbatchsize 1, however I am frequently seeing the issue, when ever there is huge data update\loads on the publisher database.

Let me know how to identify the problem and reason for job failures.

Please suggest the steps and necessary setting to ensure that replication agent jobs work inspite of heavy load. 

Can't reinitialize a subscription

$
0
0

We have a Snapshot Replciation that suddenly stopped working.  I can generate a new snapshot, but when I try to reinitialize the subscriptions, I get the following:

TITLE: Replication Monitor
------------------------------

Replication Monitor could not reinitialize one or more subscriptions that support automatic initialization.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22&EvtSrc=Microsoft.SqlServer.Management.UI.ReplicationDialogErrorSR&EvtID=CantReinitAllSubs&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

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

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

The subscription status of the object could not be changed.
Could not update the distribution database subscription table. The subscription status could not be changed.
Changed database context to 'ReportUtility'. (Microsoft SQL Server, Error: 14068)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.2531&EvtSrc=MSSQLServer&EvtID=14068&LinkId=20476


Also, when I right click on the subscription in SSMS, and choose properties, under the "Status of Last Synchronization", it shows "The process could not connect to the Distributor [name]".

Any ideas?  Thanks!


Clint

Uninitialized Subscription

$
0
0

Hi all,

I am attempting to create a replication on a table in one of my databases on my SQL Server (Version is 2008 R2).  I create the publication and the snapshot and everything looks great.

I go to my client that I want to be subscribed, I right click on subscriptions and create the subscription and everything seems to look great. Both machines are on the same domain, everything.

Go back to the server, check out replication monitor and the server is kinda 'greyed' out and it says Uninitialized Subscription.

I've deleted, re-created, tried different logins, etc.  Nothing seems to work for me.  Any help would be greatly appreciated.

Viewing all 4054 articles
Browse latest View live




Latest Images