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

Trace SQL Statements

$
0
0

Hi

I'm new a replication so don't smile about it ;-)

We've got a replication with Updateables Subscribers running under SQL2012.
One DB is replication in 8 targets in the same Instance, local distributor.
Sometimes updates on a bit field are not replicated.
The strange thing is, the update runs fine in the most subscriber DBs, but fails in others.  Even worse, the failing DBs arn't  the same one all the time.
The replication Monitor delivers no errors :-(

I'm now trying to trace the statements. The result for a correct replication should be something like this:

Statement run on publishing DB at 19:23:01
Statement arrived in Distributor at 19:23:30
Statement arrived in Subscriber DB 1 at 19:23:45
Statement arrived in Subscriber DB 2 at 19:23:45
...
Statement arrived in Subscriber DB 7 at 19:23:47

For replications that fail, I guess something like this will drop out

Statement run on publishing DB at 19:23:01
Statement arrived in Distributor at 19:23:30
Statement arrived in Subscriber DB 1 at 19:23:45
...
Statement arrived in Subscriber DB 7 at 19:23:47
with Subscriber DB 3 missing.

When I run the statement:
se [distribution]
select top 10
D.publisher_DB,A.article,
T.*,
CAST(SUBSTRING(command, 7, 8000) AS NVARCHAR(MAX)) as Statememt
from
MSrepl_transactions T,
MSrepl_commands        C,
[MSpublisher_databases] D,
[dbo].[MSarticles]     A
where C.publisher_database_id = T.publisher_database_id
and  D.id =  C.publisher_database_id
and A.publication_id = T.publisher_database_id
and A.article = 'xxx'

I get information about which statements are distributet, right?
Is there a way to 'join' this statements with the statements that run in the publisher and subscriber DB, via LSN or something like this.

Thx
Christian


Microsoft SQL Server 2008 R2 Transaction log shipping large logs at 2AM

$
0
0

Hi everyone, i have an odd question.

We've recently migrated to MS SQL 2008 R2 with SP2 and the latest CU, (as in this week)
We use Transaction log shipping to our DR facility for recovery purposes

The issue we are facing is this:
At about 1AM every day so far since we re-introduced the log shipping we have been receiving our WSS_Content database Transaction logs in an out of character large chunk e.g. 19GB over a 50mbps link to our DR SQL server normally the Transaction logs sit at around the 800MB mark sometimes less sometimes more.

I'd like to find out exactly what is happening, additionally I'd like to point out our log shipping time is 15 minutes, during this period the Veeam backup has not been running either so it's not like the logs have built up

I've been able to find out that there is a job called syspolicy_purge_history which is scheduled to run daily @ 2AM however this doesn't fit the picture

How to create hourly SQL snapshot

$
0
0

Hi, 

I need to create hourly snapshot in my SQL data base. how do i create it?

Thanks 

satchi 

Bulk Copy failure where subscriber Article contains additional columns to publisher Article

$
0
0

Hi

I have a transactional publication containing an Article that is column filtered (i.e some columns are not to be replicated). The corresponding Article in the subscriber is IDENTICAL to the Article in the Publisher. That is, the subscriber article contains the columns of the publisher article that are not replicated. Also, these "additional" subscriber columns both allows null .

Neverthless the application of the snapshot fails with

"The process could not bulk copy into table <Table>."
"End of file reached, terminator missing or field data incomplete"

The bcp file, naturally enough ,only contains values for the replicated columns. I have read advice that states that if the subscriber article specifies defaults for the unreplicated columns then everything should be OK.

How can this be fixed without redefining the subscribers schema definition. Does bcp assume all column values are provided

Can parameters on the bcp command be altered in the publication definition to cater for this situation

Removing rows in Conflict table

$
0
0

I have a merge replication publication. I want to provide an interface for subscribers to see conflicts after they occur by placing the conflict records in a holding table that will be used to highlight differences. It will run as a batch job each night. I will use the table's conflict table to load the holding table. If I delete the conflict table row after adding to the hold table, it is the same as just removing the conflict from the SSIS conflict tool, right? I don't have to do anything else and this will not affect the merge replication, correct?

SQL 2008r2 Replication does not restart after VPN Connection was reset

$
0
0

The replication on my servers work over Zywall USG200 IPSEC VPN. If the VPN resets and reconnect, the SQL replication stops replication, then I have to reboot the server that's replication is not connecting. All other connections like map drives between the servers reconnects. Can someone points me in the right way. Why does the replication not start automatically again?

I am newbee in SQL replication so please be patient. 

Merge Agent job failure intermittently

$
0
0

Hi,

Intermittently on of the servers, merge agent job is failing intermittently. Job runs every day once and some days it fails with below error.

I am planning to enable verbose logging by specifying -Output C:\Temp\OUTPUTFILE.txt -Outputverboselevel 4

let me know any other things I can test

Step ID 1
Server XXXX
Job Name XXXX
Step Name Run agent.
Duration 00:00:19
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0

Message
-XParentProcessHandle 0000000000000490
2013-05-31 12:45:03.020 Connecting to Subscriber 'XXXX'
2013-05-31 12:45:05.270 Connecting to Subscriber 'XXXX'
2013-05-31 12:45:06.348 The upload message to be sent to Publisher 'Publsiher_Server' is being generated
2013-05-31 12:45:06.379 The merge process is using Exchange ID '4B753726-7926-4412-AB76-DDF019E85C1C' for this web synchronization session.
2013-05-31 12:45:19.832 The server name or address could not be resolved

2013-05-31 12:45:19.942 Category:NULL
Source: Merge Process
Number: -2147209497
Message: The server name or address could not be resolved

2013-05-31 12:45:19.957 Category:NULL
Source: Merge Process(Web Sync Client)
Number: -2147023888
Message: The Merge Agent could not connect to the URL 'https://webserver/path/SQLRep//replisapi.dll' during Web synchronization. Please verify that the URL, Internet login credentials and proxy server settings are correct and that the Web server is reachable.

Can i set up peer to peer replication between SQL server 2008R2 and SQL server 2012 nodes

$
0
0

Hi All,

Is it possible to configure peer to peer replication between nodes running in sql server 2008r2 and SQL Server 2012 (basically different versions)?

Should i need to follow any different steps if im configuring peer to peer topology between different versions.

I can able to configure peer to peer topology between two Sql server 2012 nodes.

But getting some error while configuring between 2008r2 and 2012.Please help

Thanks


replication best practice - restore once a month?

$
0
0

We have a main OLTP database and are setting up transaction replication for a reporting database.

We have say 1,000 tables.

Maybe 500 of them clearly need to be replicated in near-real time.

Another 100 are transaction related and do NOT need to be replicated at all, do not really need to be present on the reporting side but are harmless if old copies are there.

Another 200 need to be present on both sides, but will be written on both sides so should NOT be replicated - do not need to communicate changes either way.

The remaining tables might be needed sometimes on the destination side, but maybe it's just as easy not to fix up their PKs and not to publish them, but just as a best practice (??) resync the two sides once a month or so with a full backup, let us assume they would be read-only on the reporting side.

The total database size is a modest 20gb or so.

Does that make sense?  Or should I bite the bullet and replicate the last 200 or so just in case?

Thanks,

Josh

SQL 2005 SP3 - Republishing server Error when attempting to Create a 2nd publication for a table which is already used in the First Publication "The specified automatic identity support parameters conflict with the settings in another article"

$
0
0

Hi all,

I have a problem and would appreciate any advice in order to troubleshoot and address it.

I have the following setup

SQL 2005 SP3 on the Publisher and this is Merge Replication.

The Republishing Server has 1 publication for a table which uses the Automatic Identity Key Management
feature. Note that this all works great but when I try and create another Publication using the same table but filtering the data in a different way
I now run into the error "The specified automatic identity support parameters conflict with the settings in another article"[i][/i].

So as a Basic Example we have

1. First publication looking in Table_1 for a Filter to look at Company Code 1

2. Second publication looking at Table_1 for a filter to at Company Code 2

On attempting to create the second publication the above error is thrown.

Any advice on how to troubleshoot further?

Kind Regards,

MMck


Replication or Failover Clustering - Need help to choose the correct option

$
0
0

Hello all,

We actually have a standalone SQL server 2008 R2 running on a Windows 2008 R2 server.

We now have a second server room (in an other building, but connected to the internal network) that we want to use as a Disaster Recovery Site. What is the best option ?

a) To install a second SQL server in the second site and then replicate the database on it

b) To install a second SQL server in the second site and then mirror the database on it

c) To build a Failover Cluster between the two sites

All advices and link to useful documentation, best practices will be greatly appreciated

Thanks in advance

web merge replication - snapshot

$
0
0

I have setup merge replication a lot when the computers are in the same network (even if they are not in the same physical location, but they are connected via VPN).

Well, now i have to setup merge replication over the web. I have done all of the steps (setting up IIS, publication, etc).

Now, i have setup the pull agent on the subscriber and when i start it the error shows that it can't pull the snapshot. The key thing is my subscriber and publisher have identical data - i backed up the data from the publisher and restored it on the subscriber before i started this process.

I know when i setup the merge replication for push it asks about initializing the subscription and i always answer that NO, because the subscriber already has the data. How do i do that with pull?

On the subscriber, i did:

exec sp_addmergepullsubscription_agent @publisher='publisher',@publisher_db='publisherDB',@publication='Publication1',@use_web_sync=1,@internet_url='the correct URL for replisapi.dll',@internet_security_mode=1,@internet_login='userlogin',@internet_password='password'

In the history on the subscriber i see it is applying scripts and all that looks fine (like it does on push merge). then i get:

2013-06-06 01:49:36.290 The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.
2013-06-06 01:49:36.291 Category:NULL
Source:  Merge Replication Provider
Number:  -2147201001
Message: The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.
2013-06-06 01:49:36.291 Category:AGENT

Then i get duplicate key errors because it is trying copy data from the publisher to the subscriber. This is the step i want to skip because the data is already at the subscriber.

Thanks in advance.

How does SQL Server handle synchronization failure?

$
0
0

For a Merge Pull Subscription. In terms of data changes that were supposed to be uploaded or downloaded, what happens if synchronization fails say midway into the process? For example, if there is a power outage, network failure or termination of the application which initiated the sync. 

SQL Server 2008R2 Bespoke replication - Initialize a Transactional Subscription without a snapshot

$
0
0

SQL Server 2008R2 Bespoke replication - Initialize a Transactional Subscription without a snapshot

Hi, 

We need to migrate our subscriber archive database from Server A to B. However replication should ideally remain active from the publisher to A at all times. 

Ideally I would initialize the subscription databases at B using the ‘initialize with backup’ sync_type which requires that I restore a backup of ourpublisherdatabase to Server B. 

Unfortunately this is not possible as we are using an in house modified version of MS Transactional replication which does not delete at the subscriber but rather updates a flag to mark the record as deleted. 

Therefore the subscriber database acts as an archive solution and contains historical data which no longer exists at the publisher.

My question is, is there a way to copy thesubscriber backup from Server A to B, update the distributor retention period, restore thesubscriber backup to Server B and then sync all missing commands from the publisher.

Alternatively I could take the system offline and use the ‘replication support only’ sync_type option but this is not ideal. 

I notice that there is ainitialize from lsn snyc_typeoption, although it specifies that it is only for use in a peer-to-peer topology. 

Many thanks in advance.


SQL Replication Sync

$
0
0

Hi,

Replication is for down for some time. It is fixed now.. but it has more than 1 million records to sync which is taking for ever. Should we wait for the subscription to sync with the publication or is there any other work around?

Thanks in advance


Peer to Peer Replication conflict

$
0
0

There is any way to specify a rule for replication to automatically resolve conflicts?  For instance, publisher always wins?

We want publisher to be win conflict all the time and data to be replicate to subscribers.

Peer to Peer Replication 2008 2012

$
0
0

Hi I am a vb Developer trying to investigate the ability of adding an sql server 2012 node into an existing peer to peer replication of 2 nodes running sql server 2008.

I cannot find any support articles from MS specifically indicating that this is possible and acceptable practice in a peer to peer environment.

Can anybody Point me in the right direction?

any help would be appreciated.

add a new subscription to an existing publication

$
0
0

We are using SQl 2008 push replication and distributor is on its own physical server.  We have an existing publication and one subscriber already established and running in production.  Recently we have a need to add another subscriber and plan to use the same existing publication.   What is the best way to add the second subscriber without affecting the exising subscriber? 

My understandng is that in the normal steps to creating a new subscriber, I need to create an snapshot for it.  Since i have an existing subscription already, if I do that, it would initialze both subscribers.  I don't want this new subscription affecting my existing one.   Obviously I can create a new publication and not using the exisitng publication but it seems there has to be a better way to do that.  Is there a way?

OD


Ocean Deep

Initialize from LSN doesn't work

$
0
0

Hi,

For some reason we cannot initialize from LSN in a mirrored setup.

We have 3 servers and push replicate from A to B, SRVB and C are setup with database mirroring.

SRVA – Publisher

SRVB – Principal

SRVC – Mirror

Basically We have followed the MS document (http://go.microsoft.com/fwlink/?LinkId=213051) that is hyperlinked from this webpagehttp://msdn.microsoft.com/en-GB/library/ms151799.aspx

In the document it contradicts itself saying that we shouldn’t allow the ‘Allow initialization from backup files’ option but then later in the document it says that we should allow this in order to initialize from LSN ??

So to test this replication was running, I manually failed over B to C. 

On C I ran the code below to get the latest LSN,

SELECTtransaction_timestamp,*

FROMdbo.MSreplication_subscriptions

WHEREpublisher     =‘xxxxxxxx’

   ANDpublisher_db ='xxxxxxx'

   ANDpublication ='xxxxxxxx';

Once I had the transaction_timestamp I went back over to the Publisher server (SRVA) and ran the below using the transaction_timestamp I got from the previous step

EXECsp_addsubscription

@publication      =N'xxxxxxxxx',

@subscriber       =N'xxxxxxxx',--This needs to be set to the new subscriber/what you have just failed over to.

@destination_db   =N'xxxxxxxxxxx',

@subscription_type=N'push',

@sync_type        =N'initialize from LSN',

@article          =N'all',

@update_mode      =N'read only',

@subscriber_type  = 0,

@subscriptionlsn  = 0x0001D3FC0000030B0001000000000000

execsp_addpushsubscription_agent

@publication=xxxxxxxxxxxx',

@subscriber=N'xxxxxxxxxxx',--This needs to be set to the new subscriber/what you have just failed over to 

@subscriber_db=N'xxxxxxxxx', 

@subscriber_security_mode= 0,

@subscriber_login=N'xxxxxx',

@subscriber_password=N'xxxxxxxxxxxxxx',

@frequency_type= 64,

@frequency_interval= 1,

@frequency_relative_interval= 1,

@frequency_recurrence_factor= 0,

@frequency_subday= 4,

@frequency_subday_interval= 5,

@active_start_time_of_day= 0,

@active_end_time_of_day= 235959,

@active_start_date= 0,

@active_end_date= 0,

@dts_package_location=N'Distributor'

GO

So when doing that we originally got the error about allowing to init from backup so we set that to true as the document was contradicting itself, when running the above it then produced this error.

The transactions required for synchronizing the subscription with the specified log sequence number (LSN) are unavailable at the Distributor. Specify a higher LSN.

Does anyone know if we did something wrong here?  The next step would have been to drop the previous subscription but we didn’t get that far, just a little worrying that we followed the MS whitepaper but it didn’t work :-/

Any help is appreciated, thanks.

Issues with Adding a new subscriber to an existing transactional replication setup

$
0
0

I am trying to add a new subscriber to an existing transactional replication with pull subscription.

Steps followed:

At the publisher:
1. Changed the value for allow_initialize_from_backup to true using execute sp_changepublication
2. Create the backup of publication database
3. Restored the backup on the subscriber daatbase
4. At the publisher on the publication database, exeucted the following script to add the subscription
use [subscription_db]
exec sp_addsubscription @publication = N'Trans',  @article = 'all', @subscriber = N'subscriber-server', @destination_db = N'testdb', @sync_type = N'initialize with backup', @backupdevicetype = N'Disk', @backupdevicename = N'C:\testdb.bak',
@subscription_type = N'pull', @update_mode = N'read only'
GO

5. At the subscriber server on the subsribing database, executed the following script to add pull subscription
use [testdb]
exec sp_addpullsubscription @publisher = N'publisher-server', @publication = N'Trans', @publisher_db = N'testdb',
@independent_agent = N'True', @subscription_type = N'pull', @description = N'', @update_mode = N'read only', @immediate_sync = 0
go

exec sp_addpullsubscription_agent @publisher = N'publisher-server', @publisher_db = N'testdb', @publication = N'Trans', @distributor = N'distributo-server', @distributor_security_mode = 0,
@distributor_login = N'xxx', @distributor_password = 'xxxx', @enabled_for_syncmgr = N'False', @frequency_type = 64, @frequency_interval = 0, @frequency_relative_interval = 0, @frequency_recurrence_factor = 0,
@frequency_subday = 0, @frequency_subday_interval = 0, @active_start_time_of_day = 0, @active_end_time_of_day = 235959, @active_start_date = 20130606, @active_end_date = 99991231, @alt_snapshot_folder = N'',
@working_directory = N'', @use_ftp = N'False', @job_login = null, @job_password = null, @publication_type = 0
GO

Everything looks fine till now, and when i synchronize the subscription, i am running into an errors like
Cannot update identity column col1
Could not find stored procedure 'sp_MSins_dboTABLE'

Can you guys please help

Thanks,
Kumar

Viewing all 4054 articles
Browse latest View live




Latest Images