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

Distribution agent job getting deleted on SQL Server 2008 R2 Enterprise Edition

0
0

Distribution agent job getting deleted on SQL Server 2008 R2 Enterprise Edition. Part of the warning message of the SQL Server agent error log:  "... was deleted while it was executing: the outcome was (Unknown)"

This is the first time we face this kind of situation. The job was deleted by SQL no one deleted manually. Please can you provide any feedback regarding this? Is this a SQL bug?

Thanks


.NET Framework 3.5 SP1 with SQL Server 2008 R2 is not functioning

0
0

I have two (2) 2008 R2 SQL servers which do not have Replication installed. I acquired a download file from Microsoft Downloads of 2008 R2 SQL so that I could add the Replication feature. Via Control Panel > Add or Remove Programs > SQL Server 2008 R2 > Add features, I then navigate to the install file to begin the setup, at which point it says that Microsoft .NET Framework 3.5 SP1 install has failed, and that it is required for the SQL Server feature to be added.

In the Programs List, .NET 3.5 SP1 is already installed, so I do not know what could be causing this. Neither server has internet access and both are running on Windows Server 2003.

EDIT:

Thanks for the replies so far - I've looked into some of the suggestions and nothing has resolved the issue so far.

As far as I can tell, I have valid, full version installation files from Microsoft's Downloads, and the .NET Framework is installed and working correctly (ran a fixit tool for the Framework).

I collected some extra information to show you though in case it might be helpful to better describe what's happening:

Steps taken to edit current 2008 R2 installation:

Step 1

Edit current installation: Step 1

Step 2

Edit current installation: Step 2

Step 3 - this is where I encounter the error

Edit current installation: Step 3

Here is some system & server information about the machine, SQL Installation, and .NET Framework:

.NET SP1

SQL Server Information

System Information

How to CANCEL REINITIALIZATION (Merge Replication)

0
0

Hi, on SQL SERVER 2008 R2 - Merge Replication.

I executed this script to add 1 column:

exec sp_mergearticlecolumn @publication = N'IPoint_Pub', @article = N'Proveedor', @column = N'Fax', @operation = N'add', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1

This caused to reinitialize all subscriptions. 

As exposed here: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/c5653b30-fc71-4dbd-a7a1-3fef01c0980d/why-did-my-subscriptions-reinitialize-without-uploading-data-first?forum=sqlreplication

3) no, when you reinitialize you have this option, but when you make a publication buster change (one that requires @force_reinit_subscription to be set to 1) there is no option to select this type of re-initialization with upload.

The problem is that we have more than 20 subscribers with lot of transactions so we need to UPLOAD that data ASAP.

How can we UPDATE replication internal tables to avoid reinitialization at the subscriber?

At least, UPLOAD the data before reinitialization.

Thanks a lot in advance,



Best Regards, Daniel.


Global user to monitor Sql transactional replication

0
0

Hi All,

I am monitoring the transactional replication in SQL server 2008 R2 using sqlmonitor.exe program but i have to add publisher every time for a new user.In our team we have 7 members who has there individual login onto the server and login using Windows authentication.I tried to create a user in distribution database providing replmonitor  role membership but still i have to add publisher in replication monitor screen for individual user even if i am using SQL authentication.

Please let me know if there is any alternate way by which if i add a publisher for one user other user can access it.

Publisher:Oracle Publisher

Distributor:SQL Server

Subscriber:SQL Server

Thanks,


Not Able to Drop Article From Publication

0
0

Hi All,

We are planning for a deployment, in part of our testing we found that a table is not being dropped when executed below script. Seems some corruption in the publishing database:

Used Script to Drop Article:

EXEC sp_dropsubscription @publication = 'TestPub', @article = '[dbo].[REP1T]', @subscriber = 'CHISQL801', @destination_db = 'TESTDB_KD_REP'
EXEC sp_droparticle @publication = 'TestPub', @article= '[dbo].[REP1T]',  @force_invalidate_snapshot= 0

Error Message is as follows:

Msg 20027, Level 11, State 1, Procedure sp_MSrepl_dropsubscription, Line 415
The article '[dbo].[REP1T]' does not exist.
Msg 20027, Level 11, State 1, Procedure sp_MSrepl_droparticle, Line 269
The article '[dbo].[REP1T]' does not exist.

How to proceed further, please suggest. Thank You


Grateful to your time and support. Regards, Shiva

remote login issue

0
0

Hello,

I am using SQLServer 2012 SE and I am getting the following error when I kick off jobs on remote server.

Could not connect to server 'XXX' because 'sa' is not defined as a remote login at the server. Verify that you have specified the correct login name. 

The select from sys.sysservers is showing 1 for isremote column. I can drop and recreate the linkedserver to fix this but the linkedserver was created by replication.

Is there a way this can be fixed without dropping linkedserver?

Thanks

How do you calculate the space required for snapshot ?

0
0
Hi,

I do see something weird in transnational replication snapshot - Can you plz help me in finding the root cause ?

When I created the initial snapshot for one big table with 350GB data and 250GB index size (shouldn't be but...) on SQL Server 2012 (SP1), snapshot folder size was 900 GB. For some reasons, I had to scrap everything and re set up the replication. At this moment Snapshot folder size has crossed 1.7 TB and not even 50% of the records has been processed, I am running out of clue for this. There has not been significant changes in number of records and table size since last snapshot.

Appreciate your insight !

Snapshot agent Failing on a weird message

0
0

 Hi, We recently upgraded our Distributor\Subscriber servers to SQL 2016 and the publisher is on SQL 2014. I tried to run the snapshot agent this morning but it failed with the below error message. the Trannsactional publication is mix of Tables\UserDefined Functions. The snapshot agent works if I remove the UDF. but for some reason its not taking the UDFs. Appreciate any help on this! Thanks!

FYI, We don't have any natively compiled objects on the database

Error messages:
Source: Microsoft.SqlServer.Smo
Target Site: System.Collections.Generic.IEnumerable`1[System.String] ScriptWithList(Microsoft.SqlServer.Management.Smo.DependencyCollection, Microsoft.SqlServer.Management.Smo.SqlSmoObject[], Boolean)
Message: Script failed for UserDefinedFunction 'dbo.udffnData'. 
Stack:    at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(DependencyCollection depList, SqlSmoObject[] objects, Boolean discoveryRequired)
   at Microsoft.SqlServer.Management.Smo.Scripter.EnumScriptWithList(SqlSmoObject[] objects)
   at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(SqlSmoObject[] objects)
   at Microsoft.SqlServer.Replication.Snapshot.ArticleDependenciesAnalyzer.BaseDependencyNode.CreateMirrorCopy(String mirrorCopyName)
   at Microsoft.SqlServer.Replication.Snapshot.ArticleDependenciesAnalyzer.BaseDependencyNode.FetchBaseDependenciesWithMirrorCopyTransaction(SqlConnection connection)
   at Microsoft.SqlServer.Replication.RetryableSqlServerTransactionManager.ExecuteTransaction(Boolean bLeaveTransactionOpen)
   at Microsoft.SqlServer.Replication.Snapshot.ArticleDependenciesAnalyzer.BaseDependencyNode.FetchBaseDependenciesWithMirrorCopy()
   at Microsoft.SqlServer.Replication.Snapshot.ArticleDependenciesAnalyzer.FunctionDependencyNode.get_BaseDependencies()
   at Microsoft.SqlServer.Replication.Snapshot.ArticleDependenciesAnalyzer.BaseDependencyNode.GetEnumerator()
   at Microsoft.SqlServer.Replication.Snapshot.ArticleDependenciesAnalyzer.DepthFirstSearchVisit(IDependencyNode dependencyNode)
   at Microsoft.SqlServer.Replication.Snapshot.ArticleDependenciesAnalyzer.DepthFirstSearchVisit(IDependencyNode dependencyNode)
   at Microsoft.SqlServer.Replication.Snapshot.ArticleDependenciesAnalyzer.PerformArticleDependenciesAnalysis()
   at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoReplicationDependenciesAnalysis(Scripter scripter, SqlSmoObject[] smoObjectArray, IDictionary urnKeyArticleLookupTable)
   at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
   at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
   at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: Microsoft.SqlServer.Smo, Error number: 0)
Get help: http://help/0
Source: Microsoft.SqlServer.Smo
Target Site: Int32 PropertyNameToIDLookupWithException(System.String, Microsoft.SqlServer.Management.Smo.PropertyAccessPurpose)
Message: Cannot access property IsNativelyCompiled.This property is not available on SQL Server 2014.
Stack:    at Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String propertyName, PropertyAccessPurpose pap)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetPropertyOptional(String propName)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetPropValueOptional[T](String propName, T defaultValue)
   at Microsoft.SqlServer.Management.Smo.ScriptNameObjectBase.AppendWithOption(StringBuilder sb, String propName, String optionText, Boolean& needsComma)
   at Microsoft.SqlServer.Management.Smo.UserDefinedFunction.ScriptUDF(StringCollection queries, ScriptingPreferences sp, Boolean bForCreate)
   at Microsoft.SqlServer.Management.Smo.UserDefinedFunction.ScriptCreate(StringCollection queries, ScriptingPreferences sp)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ScriptCreateInternal(StringCollection query, ScriptingPreferences sp, Boolean skipPropagateScript)
   at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreateObject(Urn urn, ScriptingPreferences sp, ObjectScriptingType& scriptType)
   at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreate(Urn urn, ScriptingPreferences sp, ObjectScriptingType& scriptType)
   at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreateObjects(IEnumerable`1 urns)
   at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptUrns(List`1 orderedUrns)
   at Microsoft.SqlServer.Management.Smo.ScriptMaker.DiscoverOrderScript(IEnumerable`1 urns)
   at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptWorker(List`1 urns, ISmoScriptWriter writer)
   at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithListWorker(DependencyCollection depList, SqlSmoObject[] objects, Boolean discoveryRequired)
   at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(DependencyCollection depList, SqlSmoObject[] objects, Boolean discoveryRequired) (Source: Microsoft.SqlServer.Smo, Error number: 0)
Get help: http://help/0



Replication in Multi Active Scenario

0
0

Have read on the Microsoft forms and documentation especially on SQL 2016 but am not sure if the following is possible and to what extent.

Scenario 1

A. Have 3 Database Servers replicating a single database across all 3 servers in realtime all of which are active and read-write possible. Application servers will read-write across any of the 3 active servers and yet work in realtime.

Scenario 2

B. Have 3 Database Servers replicating multiple database across all 3 servers in realtime all of which are active and read-write possible. Application servers will write to only 1 unique database on each of the 3, and can read of the other 2. So the read-writes are spread across servers for different DB's.

Some documents suggest only a primary write and multiple read. Others like transactional replication suggest that the above is possible. So not sure if the above use cases will work for me. Any help or links that will help me test the above scenarios or give directions would be helpful.

Thanks
CF

Collation Problem Between Publication and Subscriber

0
0

Hello All,

I have a transnational replication between SQL 2012 and SQL 2005. The publisher has collation SQL_Latin1_General_CP1_CS_AS whereas the subscriber's collation is SQL_Latin1_General_CP437_BIN.

When I created the publication, the Copy Collation property was set to TRUE however that applied only on the initial snapshot. The source database has German characters which got copied correctly on the subscriber during the snapshot. Now when user inserts records via application, those records don't replicate with the source collation I think. Something wired is seen on the subscriber. 

Example:

Source/Publication: Bogotá

Subscriber: Bogotß

I tried several things:

1. Changed the replication insert stored procedure to use COLLATE SQL_Latin1_General_CP1_CS_AS but NO lick.

2. Then Altered the column on subscriber to match the publisher collation but NO luck. I had hopes on this fix.

3. Inserted record on publisher manually by saying N for unicode but NO luck

Can someone please tell me how to fix this problem? Customer is seeing all wired text on the web site.

Thanks much,


Monitoring transac replication

0
0

Hi,

I have 2 servers setup in a bi-directional transactional replication. At the moment I monitor these in an external tools by using:

* sp_replmonitorsubscriptionpendingcmds => gives me an aggregate of all the pending commands

* And the following that gives me the detail

 select article, UndelivCmdsInDistDB
from distribution.dbo.MSdistribution_status  X (nolock)
 join distribution.dbo.MSdistribution_agents Y (nolock) on   Y.id=X.Agent_id
 join distribution.dbo.MSarticles Z (nolock) on Z.article_id=X.article_id
 where UndelivCmdsInDistDB>0 and z.publisher_db = DB_NAME()
 order by 2 desc, 1

For one of the server the value pretty much matches. However for the other servers, the 'detailed' view has an order of magnitude higher of a 100 compared to the aggregate. The aggregate is also extremely flat compared to the details view.

What could explain the delta between the detailed view and the aggregate ?

Thanks

Change Collation property for a database involved in replication

0
0

Hi folks,

I want to change the collation property for a database involved in replication and my steps are below

disable all the replication jobs

make it single user on both the subscriber and publisher

change the property  and enable all the jobs and verify if the repliaction is working, I have tested this situation and its working 

But i went on did some research found out in msdn website below

https://msdn.microsoft.com/en-us/library/ms188769.aspx

they want me to use below stored procedure to change the collation property. Can you please give me a sample script to do this change 

sp_replicationdboption

Thanks 

Vc


vamshi

Merge replication via Web Sych issue

0
0

Hello,

I've got a request to set up Merge replication using Web Sync.  The problem I'm having is a required table is too large and the snapshot agent creates a massive 8GB bcp file it wants to use to populate the largest table.  Unfortunately, there seems to be a memory leak issue with the web service as it chokes on this file and runs out of memory (server has 32GB of RAM) before it can finish transferring files to the Merge subscriber.  I've yet to contact Microsoft regarding this but plan on doing so soon. However, for now I need a solution for the client.

Initializing from backup is out for a number of reasons, including Microsoft's notice they don't want to support this for much longer.

I need some way to get this bcp file pushed over to the subscriber.  Either I need to find some way for SQL to break it up in chunks (which as far as I know it will not do) or remove it from the snapshot directory, push the snapshot through without the file, then manually do the bulk import on the customer's side after I download the 8GB bcp file.

My question is this:  is it possible to get SQL to break up the bcp files in to smaller chunks so I can transfer via web service?  Or what issues might I encounter by trying to omit the .bcp file from the snapshot directory, and how would I work around them?

Any help is greatly appreciated!

SQL Server version:  SQL 2012 Enterprise w/ SP2.

Permissions for Merge Repl Pull Subscription

0
0

SQL 2014 Standard
Merge replication problem.

I understand and read in msdn.microsoft.com/en-us/library/ms151868(v=sql.120).aspx , in the 'Permissions That Are Required by Agents' section:
That the Merge Agent for pull subscriptions must be a user in the distribution database or “The user can be the guest user”
But what permissions does the user or guest need in the distribution database?

We have had merge replication running for years. Recently Pull subscriptions began failing after some OS maintenance/reboots. The error was "You do not have the required permissions to complete the operation". I isolated the problem to the distribution database.

Steps I've taken:

I explicitly add the subscriber to the distribution database and add to db_reader & db_writer roles, pull replication fails.

Add subscriber to db_owner role, pull replication works again.

Dropped the subscriber from the distribution database and added guest to db_owner, pull replication works.

db_owner can't be correct.  Seems like too much permissions. I'm sure the subscriber was never added to the distribution database before, so they must have had access via the guest user.

What permission does the guest user need in the distribution database?  Or, what am I missing?


Thanks,
Tom

Merge Replication fails crashing w3wp (WS2012R2+MSSQL2012 server vs W7PRO+MSSQL2005 client)

0
0

Hi,

we are getting following error from IIS / crashing IIS worker process when clients attempt to synchronize using pull merge replication web sync. Server is Windows Server 2012 R2 with SQL Server 2012 (11.0.5649), clients are Windows 7 Professional with SQL Server 2005 Express (9.0.5000). This is in event log:

Faulting application name: w3wp.exe, version: 8.5.9600.16384, time stamp: 0x5215df96
Faulting module name: replrec.dll, version: 2011.110.5649.0, time stamp: 0x571d0692
Exception code: 0xc0000005
Fault offset: 0x000000000004df8f
Faulting process id: 0x1318
Faulting application start time: 0x01d1f78f2c4358b4
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Program Files\Microsoft SQL Server\110\COM\replrec.dll
Report Id: fd7f1f24-6383-11e6-80df-00155d7b2f1f
Faulting package full name:
Faulting package-relative application ID:

This setup worked with no issue for more then a year. There were no updates recently (last on 27. July, both server and clients). Clients synchronize daily, at least once, sometimes two-three times. There is about active 70 clients.

Anybody experience something similar? I've looked at this topic, but it seems to be different setup with different resolution.

Replication Stall

0
0

I have a master DB that has been replicating out to 12 remote SQL Express instances for about a year now.  Suddenly a few days ago,one of the remote DB's stopped receiving updates.  I tried re-initialising the subscription a few times without success and eventually resorted to removing the DB from replication and setting it all back up again from scratch.

What seems to be happening now is that the remote DB restores itself from the snapshot and then stops; I've left it for >24 hours now and no new transactions are replicated after the time that the snapshot was created.  Replication manager tells me that "The replication agent has not logged a progress message in 10 minutes" but this could mean that it is just busy.  The CPU usage on the remote machine is quite high and it appears that SQL is doingsomething but certainly not replicating.

Any help would be greatly appreciated!

Replication error alerts

0
0

Hello,

Can someone please tell me how to get notifications if there are errors from publisher to distributor or from distributor to subscriber to replicate the commands in SQL transactional replication?  Errors like row not found, deadlock, network connection, delay etc

I have configured the SQL job (Repl distribution) to send notification if the job fails however that didn't email me though. Please advise.

Thanks,

Changes to programmability objects made after adding or removing merge articles are not replicated to existing subscribers

0
0

I regard this as a merge replication BUG in SQL server, and it is affecting our SQL database upgrades significantly.

To reproduce the bug:

  1. Add, drop or change any merge article
  2. ALTER any stored procedure, trigger, view, function, other programmability object
  3. [a sync from subscribers at this point will not get the changes from 2, a new snapshot is required]
  4. Run the Snapshot Agent
  5. Sync a subscriber
  6. The subscriber will NOT have the changes from 2

If the snapshot agent is run in between 1 and 2, then changes are applied to the subscriber.

Querying the sysmergeschemachange table at the published database I can see what is happening here:

Normally if a programmability object's schema is altered, a row is added with the next SchemaVersion  to this table right away; the row is literally the ALTER script to apply the change. Syncing a subscriber will pull this change row to catch up to the latest schema version, and the change is applied.

The BUG is that as soon as any merge article is dropped, added, or changed, the snapshot is 'invalid' and is marked as such. Any subsequent schema changes are not then written to the sysmergeschemachange  table and nothing gets applied. When the snapshot is rerun, new rows will be added to, and rows removed from,  sysmergeschemachange for the article changes made... The BUG is that the changes made using ALTER <programmability object> are only made to the OLD snapshot file which is still referenced in the sysmergeschemachange  table with the same schema version; and this version number does not get changed. There is no ALTER script added as a later row in the table as would happen if the snapshot had not been invalidated. This is no use to existing subscribers, as they are already beyond that schema version; and they thus do not get the change. The only way they can get the change is if they are fully reinitialized, and thus pull the entire snapshot again; but this is not a feasible solution for a very large database.

All I can currently do is to drop additional articles for the objects altered, and recreate them so that they are added as later schema version rows to the sysmergeschemachange  table. This is far from ideal, for in the case of a table trigger, I have to drop the table article, which means I have to also every other object article that is dependent on that table, and all those dependent on those etc.

A fix for the BUG would be to:

  1. either make sure that the altered object's snapshot schema gets a new schema version
  2. or to make sure the ALTER script is still added as a new schema version row in the event that the snapshot is invalidated

Personally I prefer the second option as changing the order of scripts messes with dependencies.

We are significantly affected by this, as we have an large database application under constant development to which we make schema changes to all objects. To makesignificant changes to a table for example, we must first drop the merge article for it so we can use the create new table, copy data and rename trick. Stored procedures, triggers and views then need changing due to the revised table schema... these changes do not get applied to subscribers due to the above bug. We cannot make the changes in any other order, as the changes to the views for example are dependent on the table schema changes.

I was not permitted to submit this as a bug for some reason at connect.microsoft.com; despite my being part of an organization with a competency.

Update: I just managed to submit this also as a bug at: https://connect.microsoft.com/SQLServer/feedback/details/3062595

Error when creating a mirror partner in SQL 2014

0
0

i'm creating a mirror feature on my server. first, I created he Main partner targeting the mirror parthner and it worked ok.

But, when I try to create the mirror partner to Main server ( mirror --> main) , it doesn't work and return the following error: 


"The server network address "TCP://PC-DEV-82:5300" can not be reached or does not exist.Check the network address name and that the ports for the local and remote endpoints are operational."

I've tried the follow tutorial but I was not successful.

http://blog.sqlauthority.com/2010/01/11/the-server-network-address-tcpsqlserver5023-can-not-be-reached-or-does-not-exist-check-the-network-address-name-and-that-the-ports-for-the-local-and-remote-endpoints-are-operational-microso/

Could you please help me or drive me to another tutorial?

Thanks in advance.

Luciano

HA - Transnational Replication issue

0
0

Hi All,

I have an issue in Transnational replication. while configuring replication i have below issues,

  1. I've set the article properties Action if name is in use =Keep existing object unchanged, after completing setup above condition is resetting to default(Drop existing object and create a new one)
  2. For Statement delivery type I've made changes to different types for different articles not to deliver all types of statement(INSERT, UPDATE and DELETE), but after completion all configurations are resetting to default, it's replicating all statements. 
  3. Also getting errors(The process could not bulk copy into table '"dbo"."Table"'.(Source: MSSQL_REPL, Error number:MSSQL_REPL20037) and Batch send failed Violation of PRIMARY KEY constraint 'PK_**'. Cannot insert duplicate key in object 'dbo.Table'. The duplicate key value is (2). (Source: MSSQLServer, Error number: 2627))
  4. Also setup for -SkipErrors with 2601, 2627, and 20598 

I am not sure why and how this happening regularly all the time. some more info in below,

Microsoft SQL Server 2012 - 11.0.5058.0 (X64)-Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600:)(Hypervisor)

OS - Microsoft Windows Server 2012 R2 Standard. 

Please help me on this. 


Syed Jakeer

Viewing all 4054 articles
Browse latest View live




Latest Images