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

Change Data Capture Database went to inconsistent

$
0
0

Hi,

We are working in a environment we replication and CDC are enabled. We accidently dropped CDC metadata elements like tables,view and users. When we try to disable CDC for that particulare database we getting below error, we tried to overcome this error by creating the deleted object manually but still struck with the error. Please guide to over come this error.

EXEC sys.sp_cdc_Disable_db
Msg 3930, Level 16, State 1, Procedure sp_cdc_disable_db_internal, Line 225
The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.
Msg 22831, Level 16, State 1, Procedure sp_cdc_disable_db_internal, Line 231
Could not update the metadata that indicates database Trading is not enabled for Change Data Capture. The failure occurred when executing the command 'create user cdc'. The error returned was 297: 'The user does not have permission to perform this action.'. Use the action and error to determine the cause of the failure and resubmit the request.
Msg 266, Level 16, State 2, Procedure sp_cdc_disable_db_internal, Line 0
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.
Msg 266, Level 16, State 2, Procedure sp_cdc_disable_db, Line 0
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.
Msg 3998, Level 16, State 1, Line 1
Uncommittable transaction is detected at the end of the batch. The transaction is rolled back.

I create User CDC to get rid of above error then I am getting below error

Msg 3930, Level 16, State 1, Procedure sp_cdc_disable_db_internal, Line 225
The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.
Msg 22831, Level 16, State 1, Procedure sp_cdc_disable_db_internal, Line 231
Could not update the metadata that indicates database Trading is not enabled for Change Data Capture. The failure occurred when executing the command 'DROP user cdc'. The error returned was 297: 'The user does not have permission to perform this action.'. Use the action and error to determine the cause of the failure and resubmit the request.
Msg 266, Level 16, State 2, Procedure sp_cdc_disable_db_internal, Line 0
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.
Msg 266, Level 16, State 2, Procedure sp_cdc_disable_db, Line 0
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.
Msg 3998, Level 16, State 1, Line 1
Uncommittable transaction is detected at the end of the batch. The transaction is rolled back.

We are not able to fix the above error.


Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.


Changing the subscriber's server (IP and name)

$
0
0

Hello, I am facing a problem about subcriber's server. We have a replication configuration with a server that publishing changes from a table to another same table on a subsciber server. The subscriber server will change to another server with different IP and Name. I went to link servers that resides the subscriber server to see if there is somthing to change about but I couldn't find something. The setup of the replication from the beginning is not an option.

Thanks


Identiy replicated records

$
0
0

Hello Experts,

I have a set up transactional replication and I want to know which record(s) have been replicated to the subscriber, so that they can be deleted thereafter from the publisher.

Is this doable?

R,

Shola

Preventing transaction replication to be broken after a big update/delete query runs

$
0
0

Hi experts,

For one of our env, for the transaction replication set up:

Publisher: (prod OLTP DB server) SQL server 2005, Database[DB]size : 220 GB also act as the distributor 

Subscriber (Prod reporting DB server) : SQL server 2005  , DB gets replicated and is currently in sync.

Now, as per the yearly activity there would  be a script run on OLTP publisher to delete more than 1816009 records..

Now will this break replication? Or is there a way i can prevent one because setting that up is tedious?

Also, something similar was done 2 years back and we only have the error as

"

"The process could not execute 'sp_replcmds' on 'xxxxxx'." "Status: 2, code: 0, text: 'Timeout expired'" "A time out occurred while waiting for memory resources to execute the query." "Agent 'xxx' is retrying after an error. 0 retries attempted. See agent job history in the Jobs folder for more details." "The step was cancelled (stopped) as the result of a stop job request""

But we do not have any solution listed and will this break if we do it this time, just curious how can i move from here?

Thanks..



storage capacity estimation for distirubtiion database

$
0
0

Hello Expert,

Are there any guidance in the disk/lun size of a distribution database. 

Is it mean to be proportionate to the size of the database transaction log?

R,

Issues when setting filters in merge Replication

$
0
0

Hello,

I'm trying to update a filter in a merge replication.

When trying to valided, I have the error : 

A column used in filter clause ‘%s’ either does not exist in the table ‘%s’ or cannot be excluded from the current partition.

The column exits in the table.

How should I do to avoid the error?

Thank you.

Best regards.

sp_MScheckIsPubOfSub does not exist

$
0
0

I have created Many replications in a MSSQL 2008 Publisher/Distributor.

It has run fine to 1 MSSQL 2008 Subscriber and 2 MSSQL2000 Subscribers.

Then all of a sudden it stops replicating and comes up with an error:

Error messages:
·    The merge process could not set the status of the subscription correctly. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147200963)
Get help: http://help/MSSQL_REPL-2147200963
·    Could not find stored procedure 'dbo.sp_MScheckIsPubOfSub'. (Source: MSSQLServer, Error number: 2812)
Get help: http://help/2812

That sp exists on the Publisher/Distributor. Why would it start showing up now after replicating successfully for 3 days?


 

 

Replication - Subscriber Indexes

$
0
0

I am using SQL Server 2014. I currently have an OLTP database that is used for our services.  Currently our reports are run off of it too, which I know is a big no no and makes everything slow.  So we are working on removing this issue.  They want to be able to run reports on real time data and not have to wait for it to update once a day, so I thought best way is to put in transactional replication and only replicate those articles/columns that I need.  When running a test of a query on the new replicated database it is suggesting indexes to be created. 

I know you don't take all suggestions as sometimes they slow it down more than speed it up, but my question is can you have an index on the subscriber (replicated table) that is not on the publisher table?

Is that a good idea or should I just ignore suggestions on the replicated tables all together?

Thanks in advance for your input.


possible log shipping bug: backup history logged to wrong db name on secondary server

$
0
0

I just observed this on SQL Server 2008R2. I don't have a pair of newer servers to test whether this also happens on later versions, so if someone could check it on 2012 or 2014 so that would be appreciated.

Steps to reproduce:

On ServerB:

  1. create a database called 'example_db'

On ServerA:

  1. create a database called 'example_db'
  2. set up log shipping from this database to server B, with a secondary database name of 'logship_target_example_db'

So, we now have:
ServerA.example_db -> log ships to ServerB.logship_target_example_db
ServerB.example_db -> is a local database on ServerB, completely independent of ServerA.example_db

Run a few iterations of the log shipping jobs, then in SSMS right-click ServerB.example_db and go to Properties.

"Last Database Log Backup" shows as the time the log shipping job last ran, even though ServerB.example_db has nothing to do with the log shipping configuration and has never had its log backed up.

Right-clicking ServerB.logship_target_example_db shows "Last Database Log Backup: None".

(If the above steps don't reproduce the issue, it may be necessary to first set up log shipping with ServerB.example_db as the target name, then delete that log shipping configuration, then delete ServerB.example_db, then follow the above instructions.)

Edit:

I have confirmed through experimentation that only the backup history is ending up with the wrong database: log shipping restores do go to ServerB.logship_target_example_db; that is, SQL server is not trying to replay ServerA.example_db's logs onto ServerB.example_db -- so this bug might be harmless, but I don't know what the implications are of having the wrong backup history associated with a database.



Best Way to Manage Replication to Back End

$
0
0

Team -

Please forgive me if I have posted in the wrong forum, or if this is a noob question but I am bit lost.

Situation:  INHOUSE database (SQL Standard 2012) publishes to WEB database (SQL Express).  This works great for read only access.  However our business has changed a bit where now users are updating records on the WEB database that I need to bring back to the INHOUSE database.  Right now we have just accessed the main WEB database with our inhouse system (.NET Winform Application) but I don't think this is the best practice.

What is the best way to manage this?  Do I need to upgrade the WEB database to (SQL Standard 2012) so it can publish as well back to main system?  Will this cause a loop?

This is new territory for me and I am not great at MS Sql.  Thanks for your advice.

Dewayne

sp_MSreplcheck_qv

$
0
0

I am trying to replicate a database from SS2005 to SS2008, I have setup the distribution server as the 2008 server and am now trying to publish from the 2005 server, on doing that I get a error of  Could not find stored procedure ‘sp_MSrepcheck_qv’. (Microsoft SQL Server Error: 2812)

After searching and scratching my head for 2 day I must finally admit that I need help, if someone can point me in the right direction I will be most grateful

how to Add a new article using sp_addarticle with an oracle publisher

$
0
0
I want to add article using the procedure sp_addarticle but the problem is that my publisher is oracle database.so how can i achieve my goal and also where i have to run this package??..kindly help me out as i am struck badly.

CommitBatchSize parameter

$
0
0

Hello Experts,

Please I need to understand what the Commitbatchsize parameter is. Is this the number of records that will be committed to the subscriber and what's the default value?

R,

Shola

Does SQL Server Replication work with Oracle 12C?

$
0
0

Hi,

We've been using SQL Replication to pull down Oracle data for years using SQL 2008 R2 Enterprise Edition. Since we upgraded to Oracle 12C we can no longer create an Oracle Publisher on the SQL Server.  Same lack of results with SQL 2014.  However, existing replication subscriptions continue to work. 

The error we receive when creating a new Oracle Publisher is 21613.  'Constraint column 'PRIKEY' not found in table 'xxx'.  Changed database context to 'distribution'.

Any helpful advice?

Thanks.

can't figure values for sp_addmergepullsubscription_agent

$
0
0

Hi 

I'm trying to configure a web synchronization, I completed all steps and stuck on the very last one "Configuring the subscription"

the Subscriber can only connect to the Publisher through a Web server by using HTTP
I'm following this tutorial "
https://msdn.microsoft.com/en-us/library/ms345206(v=sql.105).aspx"

here is the t-sql i tried (at the subscriber)

USE [rep_db]
EXEC sp_addmergepullsubscription 
@publisher = 'https://www.mydomain.com/SQLReplication/replisapi.dll', 
@publication = N'rep_db_publication', 
@publisher_db = N'rep_db',
@subscriber_type = N'anonymous';

Command(s) completed successfully.

EXEC sp_addmergepullsubscription_agent 
@publisher = 'https://www.mydomain.com/SQLReplication/replisapi.dll', 
@publisher_db = N'rep_db', 
@publication = N'rep_db_publication', 
@distributor = 'https://www.mydomain.com/SQLReplication/replisapi.dll', 
@job_login = N'subscriber-pc\user1', 
@job_password = N'password',
@use_web_sync = 1,
@internet_security_mode = 0,
@internet_url = N'https://www.mydomain.com/SQLReplication/replisapi.dll',
@internet_login = N'net_login',
@internet_password = N'mypassword';

Command(s) completed successfully.

but the agent can't be started (even if I try to start it from the cmd)

kind regards


Merge Replication Issue: The coulmn value ins_conflict_proc is null for sysmergearticles table

$
0
0

Hi,

We have merge replication topology with 15 subscribers and central publisher. After we added new article in existing publication, the entry for column ins_conflict_proc in sysmergearticles table getting missing at subscribers and have to create the same procedure manually and tehn have to add entry to it. This causes to slowness of merge replication.

Please Suggest the reasons for this issue.

Regards,

Shrutika

Comparing Merge Vs Transactional Replication

$
0
0

Hello Expert,

Are there any pointers or documentation with regards measuring the speed of a merge vs transactional replication using the same dataset. My intention is to essentially know which replication process is faster? Merge or transactional replication.

I know this depends on variety of factors i.e network latency, CPU, IO. However, anybody with an experience can assist.

R,

Transactional Replication Bandwidth Requirements

$
0
0

Hello Experts,

In the Enhance General Replication performance, it is said that:

  • Use a fast network.

    The network can be a significant performance bottleneck, particularly for transactional replication. The propagation of changes to Subscribers can be significantly enhanced by using a fast network of 100 megabits per second (Mbps) or faster. If the network is slow, specify appropriate network settings and agent parameters.

My ask is, is the 100Mbps a bare minimum requirement to allow transactional replication across geographical sites or could work smoothly on a lower bandwidth.

R

Reinitialization of P2P expired subscriptions in a ring topology

$
0
0

We have a 3 node P2P replication in a ring topology (each node is connected to every other node), A, B, C.  Occasionally the connection between A and B is interrupted for a long enough period that the subscription that B has for A gets marked as inactive.  However because A is also connected to node C which is then connected to node B I had assumed that B could still go on functioning as normal as all the updates from A could flow to B via C and vice versa.

So when this happens it seems that I am forced to remove B from the topology and reinitialise B from a backup of A or C and re-add the node to the topology.  This is a problem for me as the databases are large and backups take up to 12 hours to transfer from one node to the other, essentially putting the node out for nearly a day.

So currently I've increased the transaction retention on the 3 distributors from 3 to 5 days to try and alleviate the issue.

However I would like to know why I can't simply "reinstate" the connection between A and B rather than having to go through all the hassle of restoring B from a backup.  If someone can advise if I'm going about this the wrong way that would be much appreciated.

Thank you,

Warren

The schema script 'TableName_5.sch' could not be propagated to the subscriber. (Merge replication)

$
0
0

I had spent several days searching for the cause of this error (The schema script 'TableName_5.sch' could not be propagated to the subscriber) in a merge replication issue on SQL Server 2014, finally I discovered the problem by trial and error. I found lots of hits when googling this error message but none related to my actual problem, so I determined to document it for anyone else who may have similar problem.

My publication includes tables for 2 schemas but these tables have the same name i.e. "dbo.Customers" and "schema2.Customers" when setting up the articles in the publisher UI the tables they are listed as "Customers (dbo)" and"Customers (schema2)", and all appears to be okay.

But when replication starts it appears the .sch file in the snapshot folder is only named with the table name "Customers" and the schema portion of the name is dropped. This caused me lots of trouble, it wasn't until I remove the articles for all the duplicate table names that this error disappeared and replication started working again. Also added to the elusiveness of this was the entire replication setup was scripted so I had not opportunity for the UI to offer any warnings. So beware if you are replicating table articles with same names across multiple schemas. I hope this can help someone else avoid days of trial and error.

Viewing all 4054 articles
Browse latest View live




Latest Images