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

Permissions on a table lost when Snapshot job runs at Publisher

0
0
We have a weekly snapshot replication job (pull) that creates snapshots every Saturday. The job at the subscriber runs continuously. When this job runs, the permissions given to users on 'ABC' table are lost, and we have to go back and grant the permissions manually every Sunday. The permissions on 'ABC' aren't tampered with in the Publisher. Then why are the permissions dropped on the subscriber when a snapshot is applied? This lack of permissions hampers business critically. Please advice.

Unable to Export Service Broker Certificate for Replication

0
0

Hello,

To support the new ConfigMgr 2012 SP1 feature "client notification" I must configure communication between the site database server and the database replica server for the SQL Server Service Broker.
This stored procedure configures the Service Broker for client notification and export the Service Broker certificate

Do someone had this situation ( problem to export certificate from managment point servers)

EXEC

sp_BgbConfigSSBForReplicaDB'WX1892.d9000.danskenet.net','CM_DBP_REPL','E:\Shares\ConfigMgr_MPReplica\sql.cer'

Error line:

Msg 3716, Level 16, State 14, Line 2

The queue 'ConfigMgrBGBQueue' cannot be dropped because it is bound to one or more service.

by the way :

SQL service broker is enabled on REPLICATION database.

SELECT

name,is_broker_enabledFROMsys.databases


SQL 2012 AlwaysOn SPID been in Roll back state for over 2days.

0
0

I have a spid that has been in a roll-back state for over 2days. My question is what will happen if I fail-over to the secondary in a SQL Server 2012 AlwaysOn environment that is using synchronous availability mode. Most of what I have seen on other forums is the recommendation to restart the SQL Server. What they don't say is do I restart the primary, the secondary? Do I fail-over first?

If anyone has some experience with this I'd appreciate some direction on how to resolve this.


mkal55

SQL 2008 distribution clean up causing CPU to spike to 91%

0
0

We have a large sql 2008 distribution db (25 gb) where when the distribution clean up job runs, the CPU spikes up to 91%.  We have 66 million rows in the last 3 days (our retention period is 72 hours) in the ms_repl_commands to have deleted.  We have 11 publications going to our remote distributor and 4 of the publications have immediate_sync on and the rest do not.  We notice that the msrepl_commands and mssubscriptions tables have indexes that are highly fragmented.  We are planning to try a reorg tonight to see if that helps.  I also just recompiled the proc sp_msdelete_publisherdb_trans (theory being that there are different code paths for publications with immediate_sync on and off) and the average I/Os went down but we still have 66 million rows of commands to delete.  Our commands are getting to our subscribers so we are still servicing DML requests.

We also saw the following article:

http://www.databaseteam.org/1-ms-sql-server/fb589585367f06a1.html

I wanted to get some opinions on options at this point.  Would it be safe to do with recompile hints on sp_msdelete_publisherdb_trans?  Should we set all of our publications to immediate_sync off?  I'm not sure about increasing the size of the number of commands from 2k to something else since we're already having CPU pressure.  What about adding the update stats to the ms_msdelete_publisherdb_trans proc?  I don't want to hack Microsoft code unless we feel comfortable doing that.

Thanks in advance!

Resetup replication

0
0

Hi All,

we have live database on one SQL instance, and setup the transactional replication DB on the other instance. After the setting, we did purge live database daily, so replication DB keeps all historical data and live DB only keeps 70 days data. We had some replica issues before, because live and replica DBs are not identical, we had to rename the current replica DB to a new name, resetup replication again. But problem is that, we have 2 replication DBs, one is old replica (when replica was broken), the other is current replica (resetup from live DB), and customers have to choose which replica DBs they will search. 

I just wonder if there is anyway to still setup one replica DB when replica was broken and live DB was purged?

Thanks

David

Restoring Source Database on Destination

0
0

Guys, I have a question about replication.

I have transactional replication going from Server A to Server B.  Let's say for example I take a backup copy of the source database of Server A, and restore it on Server B destination database; would it affect replication in a negative way after restoring the database that is being replicated?

Why aren't msrepl_commands and MSrepl_transactions getting data for this publication?

0
0

Greetings. I have a transactional publication with one subscriber. The replication itself is working fine, but I was wanting to experiment more with the setting in this article, and these tables stay empty even though I believe they should be getting populated. I have verified that immedite_sync and allow_anonymous are set to true for this publication, and the distribution cleanup job has the following settings, and runs every 10 minutes: 

EXEC dbo.sp_MSdistribution_cleanup @min_distretention = 0, @max_distretention = 72

There are entries in these table from yesterday for another Publication, but not this one even though I've been modifying some data.

Any ideas?


Thanks in advance! ChrisRDBA

Subscription Already Exists

0
0

I am running SQL Server 2014 on Windows Server 2012 R2 Standard. The database server is setup to be both a publisher and distributor for replication out to several remote databases running on Windows 7. One of the remote computers running windows 7 had to be replaced. Once the new computer was setup and running, I deleted the existing subscription using SSMS. The new computer had to be named the same as the old computer that was taken out of commission. I tried to setup replication on the new computer and I get the following error.

Cannot create the subscription because the subscription already exists in the subscription database. Only one subscription to the same publication is allowed in each subscription database. Drop the subscription and add it again if necessary. If the problem persists, replication metadata might be incorrect; see Books Online for troubleshooting information.
Parameter 2 is incorrect for this DBCC statement.
Supply either @credential_id or @credential_name.
Changed database context to 'ScaleFusion'. (Microsoft SQL Server, Error: 14058)

I have done this many times before without any issues. Now I have 4 machines behaving in the same way. I have tried to find information on how to address this issue but so far I have found nothing that has been of any help. Please let me know what I can do to fix this.




synchronizing BLOB and VARBINARY fields

0
0
How can I synchronize BLOB and VARBINARY fields in sql server 2012 such that they move with their associated files to whre the databases are stored?

Can't Generate Scripts - Error 18456

0
0

First of all, this is all on Sql Server 2012 and everything is transactional.  We have replication set up and I am just trying to add a new server as a publisher.  We have a separate server as a distributor.

Yesterday I reset the distribution password because we could not find it.  So I used the Update Replication Password wizard in Mgt Studio first on the distributor, our publisher and our 3 subscribers.  All went well.

However, we are having a couple of problems.  The first one is that if I go to the publisher and right click on Replication and do Generate Scripts, I get the following error:

"Sql Server could not generate information about SERVER A

Login failed for distributor_admin Error 18456."

What could be wrong?  Should I just run through the whole process again?

CDC & Replication on same Database. How to tweak @maxtrans & @maxscans

0
0

We have CDC & Replication on same Database. When there are huge DML i.e. 30-40 million updates within 60 minutes the CDC is behind for 3+ hours. We wanted to tweak @maxtrans & @maxscans options as per the below article to improve performance however we cannot use  sys.sp_cdc_change_job to make the change as CDC is handled through replication. What are the alternate options available to make the change?

https://technet.microsoft.com/en-us/library/dd266396(v=sql.100).aspx


Thanks, Kranthi

The problem with transactional replication using articles filters and delete operations.

0
0

I have a problem with my transactional replication when I use articles filters and delete operation. When I insert the new data into the publisher all the data that meet the specified filter is inserted to the subscriber - everything works fine. When I delete some data from the publisher not all data that meet the specified filter is deleted from the subscriber and I don't know why.

I have three servers:

 A - publisher (Microsoft SQL Server 2012),

 B - distributor (Microsoft SQL Server 2012),

C - subscriber (Microsoft SQL Server 2012).

There are six tables in my publisher database. Each table has primary key and some of them have foreign key as shown in the attached picture:

Only the first manufacturer (manufacturer ID=1) data I want to replicate from the publisher to the subscriber, so I use these filters:

 

SELECT<published_columns>FROM [dbo].[Manufacturer]

WHERE [dbo].[Manufacturer].IDIN(Select M.IDfrom [dbo].[Manufacturer]AS M where M.ID= 1)

 

SELECT<published_columns>FROM [dbo].[Catalog]

WHERE [dbo].[Catalog].IDIN(Select C.IDfrom [dbo].[Catalog]AS C

INNERJOIN [dbo].[Manufacturer]AS M ON M.ID= C.MID where M.ID = 1)

 

SELECT<published_columns>FROM [dbo].[Cars]

WHERE IDIN(Select CA.IDfrom [dbo].[Cars]AS CA

INNERJOIN [dbo].[Catalog]AS C ON C.ID= CA.CID

INNERJOIN [dbo].[Manufacturer]AS M ON M.ID= C.MID where M.ID = 1)

 

SELECT<published_columns>FROM [dbo].[CarParts]

WHERE IDIN(Select CP.IDfrom [dbo].[CarParts]AS CP

INNERJOIN [dbo].[Cars]AS CA ON CA.ID= CP.CarID

INNERJOIN [dbo].[Catalog]AS C ON C.ID= CA.CID

INNERJOIN [dbo].[Manufacturer]AS M ON M.ID= C.MID where M.ID = 1)

 

SELECT<published_columns>FROM [dbo].[Parts]

WHERE IDIN(Select P.IDfrom [dbo].[Parts]AS P

INNERJOIN [dbo].[CarParts]AS CP ON CP.PID= P.ID

INNERJOIN [dbo].[Cars]AS CA ON CA.ID= CP.CarID

INNERJOIN [dbo].[Catalog]AS C ON C.ID= CA.CID

INNERJOIN [dbo].[Manufacturer]AS M ON M.ID= C.MID where M.ID = 1)

 

SELECT<published_columns>FROM [dbo].[PartDetails]

WHERE IDIN(Select PD.IDfrom [dbo].[PartDetails]AS PD

INNERJOIN [dbo].[Parts]AS P ON P.ID= PD.PartID

INNERJOIN [dbo].[CarParts]AS CP ON CP.PID= P.ID

INNERJOIN [dbo].[Cars]AS CA ON CA.ID= CP.CarID

INNERJOIN [dbo].[Catalog]AS C ON C.ID= CA.CID

INNERJOIN [dbo].[Manufacturer]AS M ON M.ID= C.MID where M.ID = 1)

 

When I insertthe new data into the publisher CarParts table, Parts table or PartDetails table all the data that meet the specified filter(manufacturer ID=1) is inserted to the subscriber.

When I deletedata from the publisher CarParts table, Parts table or PartDetails table not all data that meet the specified filter(manufacturer ID=1) is deleted from the subscriber - only deletes data from CarParts table, but not from Parts table and PartDetails table.

The same filter is used for insert and delete operations.Where could be the problem? Maybe it is Microsoft SQL Server 2012 Bug?


Replication doesn't work after installed SQL 2012 SP3 to SQL 2005

0
0

Hi Sir/Madam,

I installed SQL 2012 SP3(Enterprise Edition,Microsoft SQL Server 2012 (SP3) (KB3072779) - 11.0.6020.0 (X64) ) in a prodcution database server, in which we are using transactional replications to

1). SQL 2012 database server , it works fine;

2). SQL 2005 database server(Standard Edition, Microsoft SQL Server 2005 - 9.00.4340.00 (X64) ), it doesn't work;

The error message is,

Message: declare @event_type SMALLINT = 0, @distributor_major_version SMALLINT = 11, @distributor_minor_version SMALLINT = 0, @distributor_build_number SMALLINT = 6020 if object_id(N'sys.sp_repl_generate_subscriber_event') is not null
exec sys.sp_repl_generate_subscriber_event @event_state = @event_type, @distributor_major_version = @distributor_major_version, @distributor_minor_version = @distributor_minor_version, @distributor_build_number = @distributor_build_number
2016-01-22 19:22:02.180 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  139
Message: Cannot assign a default value to a local variable.
2016-01-22 19:22:02.180 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  137
Message: Must declare the scalar variable "@event_type".

I couldn't found any solution to fix it.

Please advise,

Thanks,

Replication Error number: 18752

0
0

Hi Everyone,

Could someone help on this issue?

Please check the error message and kindly let me know how to troubleshoot this issue!

Error messages:
The process could not execute 'sp_repldone/sp_replcounters' on 'SLSERVER01'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20011)
Get help: http://help/MSSQL_REPL20011
Only one Log Reader Agent or log-related procedure (sp_repldone, sp_replcmds, and sp_replshowcmds) can connect to a database at a time. If you executed a log-related procedure, drop the connection over which the procedure was executed or execute sp_replflush over that connection before starting the Log Reader Agent or executing another log-related procedure. (Source: MSSQLServer, Error number: 18752)
Get help: http://help/18752
The process could not set the last distributed transaction. (Source: MSSQL_REPL, Error number: MSSQL_REPL22017)
Get help: http://help/MSSQL_REPL22017
The process could not execute 'sp_repldone/sp_replcounters' on 'SQLSERVER01'. (Source: MSSQL_REPL, Error number: MSSQL_REPL22037)
Get help: http://help/MSSQL_REPL22037

Thanks,

V


DBA

SQL2014 Replication error

0
0
I have setup a publisher on a server running SQL2014. That publisher is setup for merge replication with 7 subscribers. I have setup four tables to publish and each table is set to download only. On two of the subscriptions I continue get this error after the first successful replication:

The Merge Agent failed because the schema of the article at the Publisher does not match the schema of the article at the Subscriber. This can occur when there are pending DDL changes waiting to be applied at the Subscriber. Restart the Merge Agent to apply the DDL changes and synchronize the subscription.  (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199398)

I have reinitialized the subscriptions, validated the subscriptions, created a new snapshot and I even have dropped the subscriptions and recreated them. Each time I try one of these tasks the replication seems to work once and any subsequent iterations of the scheduled replication fails with the error above. Any ideas what might be wrong with these two subscriptions?

John


CDC capture job fails with error #2601

0
0

Hello.

I used CDC feature for a time to collect application data and send it to data warehouse and everything worked well. Then few weeks ago I noticed that my function that retrieves net changes (in my case [cdc].[fn_cdc_get_net_changes_dbo_info_rg_3830]) became to work very slow. I found article (https://support.microsoft.com/en-us/kb/2989478) about poor performance for cdc.fn_cdc_get_net_changes_<capture_instance> in SQL Server 2012 SP2 and since my SQL Server version was 11.0.5343.0 (2012 SP2) I decided to update Microsoft SQL Server 2012 to Service Pack 3 (version 11.0.6020.0).

So, after update I'm unable to use CDC at all. Each time I try to start capture job in Agent it fails and raises a bunch of errors first of those is 2601:

Entry Time 2016-03-10 11:58:44.173, Msg 2601, Level 14, State 1, Cannot insert duplicate key row in object "cdc.dbo_info_rg_3830_CT" with unique index "dbo_info_rg_3830_CT_clustered_idx". The duplicate key value is (0x00e6dd33000043080012, 0x00e6dd33000042d0000d, 1). For more information, query the sys.dm_cdc_errors dynamic management view.

Neither sys.dm_cdc_errors nor sys.dm_cdc_log_scan_sessions DMV provide any valuable information.

That clustered index on the changes table is defined as follows:

CREATE UNIQUE CLUSTERED INDEX [dbo_info_rg_3830_CT_clustered_idx] ON [cdc].[dbo_info_rg_3830_CT]
(
	[__$start_lsn] ASC,
	[__$seqval] ASC,
	[__$operation] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [com_cdc_fg]
GO

Of course specific values of index columns that cause error every time are different. But I noticed that [__$operation] is always 1. So duplicates are always about deleting rows.

I tried do disable/re-enable CDC on database and table, tried to enable different table in the same database, tried to backup/shrink transaction log and then re-enable CDC and result was always the same. The database I try to enable CDC for doesn't participate in mirroring, replication etc.

What is interesting is that I can enable CDC on different database on the same server instance and it works well, collects data and writes it to the changes tables just as it should. So the problem is relevant with that specific database.

Any ideas?

Access Denied to SQL Replication Snapshot folder

0
0

 I have a SQL server 2008 installed, Transactional(PULL) Replication has been implemented der,everthng was working fine but suddenly snapshots are failing to generate.When I execute the snapshot agent it shows me error that,

Access to the path 'path of a snapshot folder' is denied.

snapshot folder is shared to everyone with all securities,I can access the path through run.Folder is shared to SQL agent and main SQL service.

ANY HELP........?

What is the effect when I increase the QueryTimout parameter of Replication Merge Agent Profile?

0
0

What is the effect when I increase the QueryTimout parameter of Replication Merge Agent Profile?

Will it comsume more resources or any other side effect?

•Syntax error, permission violation, or other nonspecific error

0
0

Hi Experts,

Microsoft SQL Server 2008 (SP3) - 10.0.5500.0 (X64)

Enterprise Edition (64-bit)

Distribution agent is getting failed with below error messages,

Command attempted:

if @@trancount > 0 rollback tran
(Transaction sequence number: 0x000507F60000A40D029500000000, Command ID: 2)

Error messages:

  • Syntax error, permission violation, or other nonspecific error (Source: MSSQLServer, Error number: 20025)
    Get help: http://help/20025
  • Syntax error, permission violation, or other nonspecific error (Source: MSSQLServer, Error number: 42000)
    Get help: http://help/42000

With sp_sp_browsereplcmds, found the statement which is being failed to delete in subscriber though the records exists on the particular table

{CALL [dbo].  [sp_MSdel_xxxxxxxxx] (7,9426,20160422)}

I do not want to reinitialize the subscriber. Kindly help to fix this issue

The process could not connect to Subscriber and Login failed for user

0
0

I am having some problems configuring a replication. After the installation, once I tested via replication monitor, I got this errors:

 Error messages:
The process could not connect to Subscriber 'CDBSRV01'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20084)
Get help: http://help/MSSQL_REPL20084
Login failed for user 'CCV\EBSRV01$'. (Source: MSSQLServer, Error number: 18456)
Get help: http://help/18456

I am using a domain login to connect to the windows server and sql server.

Servers CDBSRV01 and EBSRV01 are connected to different networks, they are connected trough Cisco routers.

Also, there are two domain controllers on the domain each server belongs to one site.

Thanks,

Ismael

Viewing all 4054 articles
Browse latest View live




Latest Images