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

Log shipping re-enable problem following primary db restore

$
0
0

Hi Folks,

Hope you can help... I have a database running on Microsoft SQL Server 2008 R2 (SP1)  that has been happily log shipping to standby (along with a bunch of others) for 5 years. Occasionally a user or developer will screw up and need the primary to be restored from backup at which point I'll disable the log shipping, do the primary restore and then re-enable the log shipping with a full backup. I've never run into any issues before.

Yesterday I needed to restore a backup from a couple of days previous. When I re-enable the log shipping the database backs up and restores fine, the scheduled backup, copy and restore jobs are created and both the backup and copy jobs work fine. However the tran log restore job is failing. It's skipping old tran log files as expected, then finding one that it verifies, tries to apply, then fails as the tran log is from before this restore. I can manually apply logs from after the restore with no issues, but I can't get the LSrestore/sqllogship.exe job to skip further than this particular old log and start applying logs from the correct point.

Log msgs:

"Error: Could not apply log backup file <old log file name> to secondary database <databasename>" 

"This backup set cannot be applied because it is on a recovery path that is inconsistant with the database." 

"The log backup file was verified but could not be applied to secondary database <databasename>."

So far I've tried simply renaming the offending log to move it out of the way but then it fails saying it can't find it.

I also tried setting the primary database to simple recovery then back to full recovery, followed by dumping the log then running the re-enable/restore again. No joy.

I've deleted the database at the standby side to remove the history. No joy.

Does anyone have any ideas? I've hunted high and low for information on where the restore is getting the restore sequence from but either I'm not understanding it or not finding it. Yes, I'm looking through BOL... Everything I'm reading suggests that a full backup/restore ought to start the sequence from the correct point.

Any help greatly appreciated!

A bit more info... (I've masked the path/filenames)

This is the old log it's failing on:

restore headeronly from disk ='xxxxxx_20160105101505.trn'
FirstLSN  LastLSN  ChkptLSN DBBkpLSN
387176000001509900001 387177000000060200001 387176000001503100144 387176000001503100144

this is the new backup and subsequent logs

restore headeronly from disk = 'xxxxxx.bak'
387176000001915300040 387176000001916900001 387176000001915300040 387176000001912700040

restore headeronly from disk ='xxxxxx_20160106151504.trn'
387176000001917700001 387176000001917700001 387176000001915300040 387176000001915300040

restore headeronly from disk ='xxxxxx_20160106153004.trn'
387176000001917700001 387176000001917700001 387176000001915300040 387176000001915300040

restore headeronly from disk ='xxxxxx_20160106154504.trn'
387176000001917700001 387176000001917700001 387176000001915300040 387176000001915300040

After checkpoint on primary...

restore headeronly from disk ='xxxxxx_20160106175539.trn'
387176000001918700001 387176000001921700001 387176000001918700070 387176000001915300040





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,

Wrong type of field in updatedDataSet Custom BusinessLogicHandler

$
0
0

Hi,

In some cases, in update handler, I need to reject data modified by the subscriber (sql compact 3.5 sp2) and return the publisher's data (sql server 2008 R2 SP3).

Here is the problem because type of fields in updateddataset is wrong for decimal fields  (seen as string fields) or for long fields (seen as decimal) and updates fail. Decimal.parse fails except if I declare cultureinfo..InvariantCulture but in this case I get an error message "ERROR: ErrNo = 0x8004565a, ErrSrc = <null>, ErrType = 8, ErrStr = 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" 

This error was normally corrected by a fix in cumulative update 13 for SQL Server 2008 R2 SP2 but is back with SP3.

Any help will be appreciated.


Replication reinitiation

$
0
0

Hello Experts,

What happens in a scenario where the subscriber looses connection with the publisher...may be for 2 days. Is the subscriber able to catch up with the lost amount of data when the connection is restored?

R,

sp_showpendingchanges returns wrong changes

$
0
0

Hi,

I've got a merge publication with SQL Compact 3.5 SP2 subscribers on Windows Mobile Pro 6.5.3 and SQL Server 2008 R2 SP3.

First I set @keep_partition_changes to false and @use_partition_groupsto true but due to multiple issues encountered (deletes not correctly propagated and more rows sent to the subscriber than expected), I set@keep_partition_changes to true and @use_partition_groups to false as mentioned in msdn documentation -> https://technet.microsoft.com/en-us/library/ms176103(v=sql.105).aspx?f=255&mspperror=-2147217396 and
especially

"With SQL Server Compact 3.5 SP2 subscribers,
keep_partition_changes must be set to true to ensure that deletes are correctly
propagated. When set to false, the subscriber might have more rows than
expected"

I note in this case thatsp_showpendingchanges always returns the totality of rows contained in published articles although
sent updates when synchronizing are corrects.

Example :

Rows returned par sp_showpendingchanges for a subscriber:

updates sent to the subscriber displayed in the replication monitor

Is this a bug or this behavior is normal and how can I get correct pending changes ?

Many thanks in advance.

Pascal

How to reconfigure Replication(Transactional)?

$
0
0

Hello all, Question about setting up Transnational replication. 

During the Replication reconfigure do we need to keep the publisher database off to the users?

No transactions should not made on publisher database until the replication starts?

Transnational replication broken in our environment so planning to reconfigure. Here is my plan to reconfigure. Please suggest me the steps.

1. Generate scripts for existing Publisher and subscriptions.

2. Remove the existing replication using "SP_RemoveDBReplication

3. Delete all the Publications & Subscriptions

4. Backup publisher database & restore on Subscriber server

5. Run the scripts which are taken at step 1.

Thanks

 

Compatibility level problem

$
0
0

Hi All,

I have the following replication setup.

A SQL server 2008 (Host) hosting MyDB. There's transactional relication setup for this database, and Host acts as publisher and distributor.

There are 2 subscribers, both of which uses SQL server 2008.

Now I want to add a new subscriber which resides on a SQL 2014 instance. I am using the New Subscription Wizard in Management Studio, but on page Subscribers I get the following error when I choose the SQL 2014 instance.

'The selected Subscriber does not satisfy the minimum version compatibility level of the selected publication.'

Could you help me to resolve this?

Thanks.

There is insufficient system memory in resource pool 'internal' to run this query on Merge Replication Synchronization

$
0
0

Hi,
I have recently enabled replication of full text index for Subscribers and we started facing issues as mentioned below

Merge Replication scenario

Publisher: SQL Server 2008R2 Standard SP1
Distributor: SQL Server 2008R2 Standard SP1
Subscriber: SQL Server 2008R2 Express with Advance Services SP2/ SQL Server 2008R2 Standard SP3

Issue:
QUOTE
There is insufficient system memory in resource pool 'internal' to run this query
UNQUOTE

After some research on Google I found its bug in SQL Server 2008/2008R2 Builds for Full text Index.

https://support.microsoft.com/en-us/kb/982854

But in our case all our Publisher, Distributor and Subscriber are having at least SP1 or greater version.

1. What are the chances that due to this error subscriber's Database might be corrupted during synchronization or without synchronization if this error remains unfixed on their end.
2. What does this do to the state of the data on the Subscribers?
3. How we can check Data Integrity at Publisher and Subscribers end?
4. Please suggest me the fixes for the issue.

Thanks in advance for your help.

Thanks,
Rahul



Archive Transnational replication Question

$
0
0

Hello,

I have a database that is been replicated like a archive data, where we put old data (15 years old)

Recently my boss ask me to add 4 columns to the archive data. my question is :

due my source database (publication)  has only the last 3 years and my subscription has all the data (15 years) , when I add those 4 columns and re initialize the replicate , the data will be lost?

replication type : Transnational 

How to create path of Snapshot Folder Through FTP in SQL 2014 Standard edition while create publications

$
0
0

Hi,

we have not found any option for "snapshot folder" using "ftp" in sql 2014 standard edition

kindly help us for our this problem.

Adding Tables after Initializing Subscription from Backup

$
0
0

We have a transaction publication with two subscribers. One was recently re-initialized using a backup. I'm now trying to add tables to the publication. When I do this and generate a snapshot to populate the added tables, the distribution agent ignores the snapshot and continues applying transactions. It then stops when a transaction hits one of the added tables because the "not for replication" identity column option that would have been taken care of by the snapshot isn't there. Is this because the subscription was initialized from a backup and is there a workaround?

System Info: The subscriber and publisher are both SQL 2012 64-bit.

Issue while adding article to existing subscription(Transactional Replication)

$
0
0

We are haing issues while adding article on existing subscription.

The replication is setup with Initialize from backup=true.

Below is the command I tired to use aftet transfering the rows thru export import wizard but the table on the subscriber isnt refreshing.

exec sp_addarticle @publication = N'marcus8rpl' , @article = N'appnames' , @source_owner = N'dbo' , @source_object = N'appnames' , @type = N'logbased' , @description = null , @creation_script = null , @pre_creation_cmd = N'NONE' , @identityrangemanagementoption = N'manual' , @destination_table = N'appnames' , @destination_owner = N'dbo' , @vertical_partition = N'false' , @ins_cmd = N'CALL sp_MSins_dboappnames' , @del_cmd = N'CALL sp_MSdel_dboappnames' , @upd_cmd = N'CALL sp_MSupd_dboappnames'

Rule based Database Replication Tools

$
0
0

Hi

Can someone please show some pointers for using any rule based software/tool for Database/file Replication between Corporate and 1200+ Store nodes?

Some of the tables are bidirectional and some are unidirectional (either of the way).

These nuances should be configured by a rule base/rule engine.

Database is in SQL Server 2008 across all nodes and central server.

Thanks, Jebah

RCSI impact on SQL Server Transactional Replication

$
0
0

I've been suffering with blocking for several year and now have the go ahead to turn on RCSI.

Does any one know how RCSI will affect transactional replication?

I'm aware of the impact RCSI have on tempdb, are there other gotcha to watch out for?

Additional Distributor in Transitional Replication in SQL SERVER 2008R2

$
0
0

Hi,

Current Scenario : I have SQL SERVER 2008R2 in DC/DR Environment.and configured transaction replication to a govt. agency with  central distributor at their end.

Now I want to configure another new set of transaction replication with separate distributor (Configured on Reporting Instance in DC ) and publisher.

IS it possible to configure more than one distributors in a single instance? Or Suggest any better way.

(Because when i try to add another distributor . Error occurs )

Other HA (Clustering/Mirroring) already configured . Log shipping is not appropriate option in our current connectivity standard.


Regards Naveen MSSQL DBA


Snapshot stuck at 74% The process is running and is waiting for a response from the server.

$
0
0

Hi

I've created a local Publication using the wizard.

But the inital snapshot gets stuck at 74% with the message: The process is running and is waiting for a response from the server.

I've increased Querytime to more then 24 hours, it will contiune to reach the timeout periode and stop.

The database is only 2-3 GB, so not that big.

Any ideas?

Replication between DB2 and SQL

$
0
0

Does anyone have any recommendations on real time data capture between SQL Server and IBM DB2 and vice versa.

Thank you.

Merge Replication - Speed up initial Subscription creation

$
0
0

Hi All,

 

We currently have an environment where we have subscribers running SQL Express 2008 R2 clients.  On the initial install of the subscription on the local client it takes a bit to pull down the initial data pull from the server (First replication).  Is there a way to speed this up somehow? Like build the subscription and provide the snapshots to the initial DB build so it would only have to pull the deltas from the server? 

I don't know if that is possible or not, but it would be nice to be able to apply the snapshot on the initial subscription creation and then when they sync it only has to go and get the deltas.

As always greatly appreciate the info.

 

--B

 

Can Merge Replication sync Subscribers into Publisher only or other solution because of Subscriber's storage size and speed

$
0
0

I plan to use Merge Replication to sync data between a SQL Server 2008/SQL Server 2008 R2 and 1000 barcode scanners with Windows Moible 5 to manage 1 million assets. All asset's inventory status should be checked in every two months (because all inventory history data must be keeped in database, I have to create two table, INVENTORY and INVENTORY ASSET. INVENTORY includes inventory-sn, inventory time, location, etc. INVENTORY ASSET includes inveontory_sn, assets ID, inventory check status, etc.) Because the data size is very big and every scanner's storage is only 1GB. I use HOST_NAME to filter every location to reduce the sync data size for every device. I have some questions:

Q1. Can I only sync inventory data from every device into SQL Server 2008? (I check some merge replication books and online articles, it seems impossible. When I setup publisher, only two selections for synchronization direction: Bidirectional and Download only to Subscriber)

Q2. If I can't sync inventory data from a device into SQL Server 2008. Can I sync INVENTORY and INVENTORY ASSET's schema (table only but not data into device), and inset inventory data into INVENTORY and INVENTORY ASSET table during the inventory. Then to sync the data back to SQL Server 2008?

Q3. If the answers of Q1 and Q2 are no,  can I sync other tables only into every device, then create INVENTORY and INVENTORY ASSET table in the synced database on a device? After inventory is finished, I use my mobile program to insert the records in these two tables into SQL Server 2008? Or do you have any good idea?

Thanks for your help

Charlie

Check Mirroring Status and speed

$
0
0
Is there a way to check the current speed of transfer and current amount of data waiting to be transfered??

I found how to check the status in one of the DMVs but I can't seem to find the other information. Google is being no help either.

Thanks ahead of time.

OHH... SQL 2005 enterprise SP2.
Viewing all 4054 articles
Browse latest View live




Latest Images