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

replication

$
0
0

I'm looking to automate, replication set up. I have one pushliser and 2 subscribers.Distributor stays on the same instance of publisher.

This steps I follow.

Run the login script against the database.
Right click on replication folder and generate the script.,replace the null with the user password for logins.
break the replication by below query.

restore the database.
run the replication script that is taken in the step 2.
Expand the replication folder->expand  the local publications -> there will 2 publications.
Right click on each->view snapshot agent status->check the generate snapshot option ->click ok.
do the same for another publication.

Once snapshot is done, and if the it's fails while bulk copying then re-initiatation all subscriptions.

I like to know how to automate or generate query for  below steps

run the replication script that is taken in the step 2.
Expand the replication folder->expand  the local publications -> there will 2 publications.
Right click on each->view snapshot agent status->check the generate snapshot now option ->click ok.

Once snapshot is done, and if the it's fails while bulk copying then re-initiatation all subscriptions.

any help is greatly appreciated.

vivekanandhan periasamy



initialize from lsn and Initialize with Backup Difference

$
0
0
Kindly tell us something about initialize from lsn andInitialize with Backup as there very less knowledge available on scenarios.

Manish

Database Mirroring Monitor Job

$
0
0
I believe that Database Mirroring Monitor Job was created when we were experimenting with mirroring. Is it safe to drop the job? Will getting rid of the job affect our (snapshot) replication?

Moving REPLDATA folder cause reinitialization?

$
0
0
Does moving the repldata folder location require reinitializing replication?

John M. Couch

Agent message code 21100:replication job was running fine till yesterday without having such permission on folder now how suddenly job is getting failed?

$
0
0

Our replication job was getting failed with below error. To resolve this issue I have granted write permission to agent account on COM folder. Now job is running fine.

Error:Agent message code 21100. The distribution agent failed to create temporary files in 'C:\Program Files\Microsoft SQL Server\100\COM' directory

Question is, replication job was running fine till yesterday without having such permission on folder now how suddenly job is getting failed?

what does a delicated distributor server use RAM for?

$
0
0

We are setting up  a push transaction replication with a dedicated distributor server in 2008 R2 enterprise and wondering how the distributor is using the RAM.  What are the deciding factors to decide how much RAM I would put  into the server?  There are about 100 tables published and most of them are moderate write tables but one of them has an insert rate of 9000 per min during peak hours.

OD


Ocean Deep

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.

replication settings for a table that has high insert rate

$
0
0

We have set up a push publication for a single large article which has high insert rate.  We are in SQL 2008 enterprise.  This table has over billion rows and has an insert rate of 6,000 to 9,000 per min during peak hours.   We also have other publications on the same publishing database (the same one the big table resides) to the same subscriber.  Sometimes we encounter latency, double digits in mins.  We have a dedicated distrubtor server.  Are there some settings in replication or better methodology to replicate such a large table with high insert rate?  Can SQL transaction replication handle such a large and high insert article by design?  Would sQL 2012 be better?

OD


Ocean Deep


can't add new column to table in replication

$
0
0

I have a merge replication running and when I try to alter table with this commancd:

alter table mytable add cTestColumn nvarchar(10)

getting this error:

Msg 21531, Level 16, State 1, Procedure sp_MSmerge_altertable, Line 378
The data definition language (DDL) command cannot be executed at the Subscriber. DDL commands can only be executed at the Publisher. In a republishing hierarchy, DDL commands can only be executed at the root Publisher, not at any of the republishing Subscribers.
Msg 21530, Level 16, State 1, Procedure sp_MSmerge_ddldispatcher, Line 191
The schema change failed during execution of an internal replication procedure. For corrective action, see the other error messages that accompany this error message.
Msg 3609, Level 16, State 2, Line 1
The transaction ended in the trigger. The batch has been aborted.

I tried to drop the sunscription and publication and even after that I was not able to add the column or rename the table !!

I create a test db on the same server and everythign worked fine on test db

what is going on with my DB ? how can I get it reslved ? it's happening with almost all tables and not a specific table !!

any hints are valuable since I'm stuck and don't know how to progress

thank in advance,

Patrick


Patrick Alexander

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

Snapshot Replication fails - ALTER TABLE statement conflicted with the FOREIGN KEY constraint

$
0
0

Hi Everyone,

i have a strange problem when using Snapshot Replication on a Microsoft SQL Server 2012 - 11.0.2100.60 (X64) Standard Edition on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

I copy Data from a production-DB in a Test-DB. In "Article properties" I marked Copy foreign key constraints to "False" and ActionIfNameIsInUse to "Delete Data". When I ran the Replication the snapshot were created, but the distribution failed with the Error:

"The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_tbl1?GUID->tbl2?GUID". The conflict occurred in database "Training", table "tbl2", column 'GUID'."

First of all there are no FK's in the Test-Database. Second tbl1 is not part of the Snapshot. Maybe someone can help me out?

Dave

SQL Server 2012 as Subscriber to SQL Server 2008 R2 Snapshot

$
0
0

  While this is certainly not the situation I would recommend or prefer, I have a situation that I may have to TEMPORARILY have an newer SQL Server running 2012 be a Subscriber for an SQL Server 2008 R2 Snapshot that is Published.  Is there any thing that flat out prevents this?

  If there is not specific software rules in SQL Server that prevents this all together, Are there any gotchas or issues that I should be aware of and on the look out for?

Thanks,


George P Botuwell, Programmer

Generated Replication Publication Script adds pull subscription at the end

Article with a filter: Instead of updating, it is deleting rows at subscriber

$
0
0
EXEC sp_addarticle @publication = N'Sales_db__TranRepl', @article = N'DummyTable'
, @source_owner = N'dbo', @source_object = N'DummyTable', @type = N'logbased', @description = N''
, @creation_script = N'', @pre_creation_cmd = N'delete'
, @schema_option = 0x000000000803509F, @identityrangemanagementoption = N'manual'
, @destination_table = N'DummyTable', @destination_owner = N'dbo'
, @status = 24, @vertical_partition = N'false', @ins_cmd = N'CALL [dbo].[sp_MSins_dboDummyTable]'
, @del_cmd = N'CALL [dbo].[sp_MSdel_dboDummyTable]', @upd_cmd = N'SCALL [dbo].[sp_MSupd_dboDummyTable]'
, @filter_clause = N'[Delete_date] IS NULL'
GO
-- Adding the article filter
EXEC SP_ARTICLEFILTER @publication = N'Sales_db__TranRepl', @article = N'DummyTable'
, @filter_name = N'FLTR_DummyTable_1__91', @filter_clause = N'[Delete_date] IS NULL'
, @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
-- Adding the article synchronization object
EXEC sp_articleview @publication = N'Sales_db__TranRepl', @article = N'DummyTable'
, @view_name = N'SYNC_DummyTable_1__91', @filter_clause = N'[Delete_date] IS NULL'
, @force_invalidate_snapshot = 1, @force_reinit_subscription = 1
GO

Env details:

SQL SERVER 2008 R2 for both publisher and subscriber.
Both are ent edition.
Article in question has a filter at column Delete_date which is a date column (NOT datetime, date only)



All inserts, deletes and updates are running fine
Except:
When for the article, I am trying to update the value of column Delete_date for a record from Null to a date value, lets say 2013-06-12, it is deleting that record from the subscriber.
I verified and found that the replication sp is fired the moment I am updating the column value on which filter is defined.
This looks strange to me.

My requirement is that:
when the column Delete_date has a value of not null, it must not be processed by replication.
So in the above example when I am putting a value to  the column Delete_date for a record, it should be ignored by replication (No effect at the subscriber).

Please help. In case I need to furnish more details, please let me know.

Errors in Replication

$
0
0

Hi,

we are facing 'out of syncs' in our Replication (transactional with updateable Subscribers)

I checked MSrepl_errors and did a join to MSREPL_Commands over command ID - hope this is a valid one. In Comnands I found the  table (as article) which isn't updated.
I run the sp_browsereplcmds on the xact_seqno ofMSREPL_Commandsand found statements that should update the table  - but they didn't. (the column in subscriber is not changed)

The strange thing is, that in the errors table  an other table is named as causing an error (a constraint violation of a primary key) - thats confusing for me.

For example:
In errors an error on table A is writen. If a join command_id to commands table. Here TableB as article is listed. Running browserepcmds shows statements updating  tableB (which is the subscriber running out of sync)

Sorry, I'm new in replication, so a perhaps silly question:
Behind a seq_no there may be several statements, right?
What happens if the first statement fails? Will the other statements be run on subscriber or will the process just stop?

This issue is realy urgent for us, so I would be realy happy for some advice.

Thanks

Christian



Very slow replication

$
0
0

I have a replication with pull subscription. over the wan.

At times it is ok (Not briliant) but sometimes it gets realy slow.

For example today, we reached 2 commands per minute!!!!

at the same time we expirianced this, I copied from the same location a 13MB file and got 120-170kb/sec speed.

So I believe the IT guy saying the line is fine. I checked for locks - none. The waits are on network and they are short ones( a few seconds at the most).

The trace shows nothing during the wait (only at the end everything gushes through)

here is the agent log:

Date  10/06/2013 22:29:01
Log  Job History (HK-DB-LSD_HK-LSD_HK_PUB-ILREP01-LSD_HK_SUB-1AA4CA8A-B1AA-4D3D-8EC6-760F707898E6)

Step ID  1
Server  ILREP01
Job Name  HK-DB-LSD_HK-LSD_HK_PUB-ILREP01-LSD_HK_SUB-1AA4CA8A-B1AA-4D3D-8EC6-760F707898E6
Step Name  Run agent.
Duration  00:26:34
Sql Severity  0
Sql Message ID  0
Operator Emailed  
Operator Net sent  
Operator Paged  
Retries Attempted  0

Message
06-10-2013 22:55:34

Total Run Time (ms) : 1592521  Total Work Time  : 1580571
Total Num Trans     : 50  Num Trans/Sec    : 0.03
Total Num Cmds      : 50  Num Cmds/Sec     : 0.03
Total Idle Time     : 0

Writer Thread Stats
  Total Number of Retries   : 0
  Time Spent on Exec        : 46
  Time Spent on Commits (ms): 0  Commits/Sec         : 0.00
  Time to Apply Cmds (ms)   : 62  Cmds/Sec            : 806.45
  Time Cmd Queue Empty (ms) : 1581352  Empty Q Waits > 10ms: 3
  Total Time Request Blk(ms): 1581352
  P2P Work Time (ms)        : 0  P2P Cmds Skipped    : 0

Reader Thread Stats
  Calls to Retrieve Cmds    : 1
  Time to Retrieve Cmds (ms): 1580571  Cmds/Sec            : 0.03
  Time Cmd Queue Full (ms)  : 0  Full Q Waits > 10ms : 0
*******************************************************************************

2013-06-10 19:55:34.432 A total of 50 transaction(s) with 50 command(s) were delivered.


replication

$
0
0

I'm looking to automate, replication set up. I have one pushliser and 2 subscribers.Distributor stays on the same instance of publisher.

This steps I follow.

Run the login script against the database.
Right click on replication folder and generate the script.,replace the null with the user password for logins.
break the replication by below query.

restore the database.
run the replication script that is taken in the step 2.
Expand the replication folder->expand  the local publications -> there will 2 publications.
Right click on each->view snapshot agent status->check the generate snapshot option ->click ok.
do the same for another publication.

Once snapshot is done, and if the it's fails while bulk copying then re-initiatation all subscriptions.

I like to know how to automate or generate query for  below steps

run the replication script that is taken in the step 2.
Expand the replication folder->expand  the local publications -> there will 2 publications.
Right click on each->view snapshot agent status->check the generate snapshot now option ->click ok.

Once snapshot is done, and if the it's fails while bulk copying then re-initiatation all subscriptions.

any help is greatly appreciated.

vivekanandhan periasamy


mergreplication does not longer work

$
0
0

We have a mergereplication between different site W2008 Server and SQL Server 2008 R2. The replication stopped wit the following error

    Can not find the save procedure 'dbo.sp_MScheckIsPubOfSub'

In the meantime the content of the databases is different. How can I restart the replication

initialize from lsn and Initialize with Backup Difference

$
0
0
Kindly tell us something about initialize from lsn andInitialize with Backup as there very less knowledge available on scenarios.

Manish

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.

Viewing all 4054 articles
Browse latest View live




Latest Images