Showing posts with label merge. Show all posts
Showing posts with label merge. Show all posts

Thursday, March 29, 2012

dropping default constraints

Hello

We've got a product which uses merge replication with anonymous pullsubscriptions.
At most custome sites it's running on SQL Server 2000, a few with SQL 2005, which is running wich replication compatibility level 80 due to .
As it happens, db schema changes. So I have to drop a column with a default constraint. First the constraint, then the column.
This works excellently on the publisher - but not on the subscriber Sad

The schema script 'exec sp_repldropcolumn '[dbo].[role_modul_rmd]', 'rmd_modul_enabled', 1' could not be propagated to the subscriber. (Quelle: MSSQL_REPL, Fehlernummer: MSSQL_REPL-2147201001)
Hilfe abrufen: http://help/MSSQL_REPL-2147201001
The object 'DF__role_modu__rmd_m__3119DB2C' is dependent on column 'rmd_modul_enabled'. (Quelle: MSSQLServer, Fehlernummer: 5074)
Hilfe abrufen: http://help/5074
ALTER TABLE DROP COLUMN rmd_modul_enabled failed because one or more objects access this column. (Quelle: MSSQLServer, Fehlernummer: 4922)
Hilfe abrufen: http://help/4922

What can bi done?

Thanks for your advice
Aline

We had this exact same problem.

First to recover your replication you can go in and drop the column manually on the subscribers. Then replication should recover.

This happens because replication does not deliver the commands in the correct order, it tries to drop the column first before droping the constraint which it cannot do. The only solution is to drop the constraint first then wait for everyone to replicate then try dropping the column.

Martin

Tuesday, March 27, 2012

dropping default constraints

Hello

We've got a product which uses merge replication with anonymous pullsubscriptions.
At most custome sites it's running on SQL Server 2000, a few with SQL 2005, which is running wich replication compatibility level 80 due to .
As it happens, db schema changes. So I have to drop a column with a default constraint. First the constraint, then the column.
This works excellently on the publisher - but not on the subscriber Sad

The schema script 'exec sp_repldropcolumn '[dbo].[role_modul_rmd]', 'rmd_modul_enabled', 1' could not be propagated to the subscriber. (Quelle: MSSQL_REPL, Fehlernummer: MSSQL_REPL-2147201001)
Hilfe abrufen: http://help/MSSQL_REPL-2147201001
The object 'DF__role_modu__rmd_m__3119DB2C' is dependent on column 'rmd_modul_enabled'. (Quelle: MSSQLServer, Fehlernummer: 5074)
Hilfe abrufen: http://help/5074
ALTER TABLE DROP COLUMN rmd_modul_enabled failed because one or more objects access this column. (Quelle: MSSQLServer, Fehlernummer: 4922)
Hilfe abrufen: http://help/4922

What can bi done?

Thanks for your advice
Aline

We had this exact same problem.

First to recover your replication you can go in and drop the column manually on the subscribers. Then replication should recover.

This happens because replication does not deliver the commands in the correct order, it tries to drop the column first before droping the constraint which it cannot do. The only solution is to drop the constraint first then wait for everyone to replicate then try dropping the column.

Martin

dropping database that had replication

Usually I use Enterprise Manager to remove the Merge Replication info before
trying to drop a database.
Now I used sp_dropmergepublication and successfully dropped the merge
publications associated with a database. When I try to do a DROP DATABASE
though, I receive :
Server: Msg 3724, Level 16, State 3, Line 1
Cannot drop the database 'xxxxxx' because it is being used for replication.
I cannot find what stored procedure(s) or other process I need to do to
remove any remaining replication info so the drop database will work.
TIA,
Doug
Doug,
please try sp_removedbreplication 'dbname'
failing that, sp_dboption 'dbname', 'merge publish','false'
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

dropping articles in a running merge replication

hi all, i need to drop some tables from a merge replication, i have a
publisher that is also the distrubuitor, and 2 subscribers, i have 2 tables
that i no longer need to replicate, my articles are set to on name conflits
leave the current table unchanged. Whats the best method of dropping the
tables i dont need, if i have to drop the subscriptions, can my clients at
the subscribers continue to use there system ?. Down time is a serious issue
to my clients lol..
Thanks Andrew
can't be done. You will have to drop the subscribers and do a nosync. Any
work your subscribers are doing will be lost.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"andrew bourne" <andrewbourne@.vardells.com> wrote in message
news:u8yAO4HKFHA.724@.TK2MSFTNGP10.phx.gbl...
> hi all, i need to drop some tables from a merge replication, i have a
> publisher that is also the distrubuitor, and 2 subscribers, i have 2
tables
> that i no longer need to replicate, my articles are set to on name
conflits
> leave the current table unchanged. Whats the best method of dropping the
> tables i dont need, if i have to drop the subscriptions, can my clients at
> the subscribers continue to use there system ?. Down time is a serious
issue
> to my clients lol..
> Thanks Andrew
>
sql

Dropping article

Hi,
I have setup merge replication to run between two SQL 2k (SP3) across the internet. But while selecting the articles via EM I forgot to select "Identity Resolver" for a particular table. And this is creating havoc in that table.
I have to solve this by dropping the article. Or is there any other way?
But if I try to drop the article it says that there is an active subscription for this publication. Would this mean that I will have to drop my entire publication and create the entire thing again?
Can someone help me with this?
Thank you.
Regards,
Karthik
Karthik,
it is not mandatory to reinitialize - you can drop the subscription to a particular article using sp_dropsubscription then drop the article using sp_droparticle, then sp_addarticle to readd then sp_refreshsubscriptions.
Incidentally, what is the error message you see?
Regards,
Paul Ibison
|||Hi Paul,
Thank you for the quick response.
I see a primary key violation for a column that has IDENTITY property set and marked as "YES NOT FOR REPLICATION".
So according to you I do the following -
1. Run sp_dropsubscription at the publisher.
2. Run sp_droparticle
3. Run sp_addarticle
4. Run sp_refreshsubscriptions
I am not all that experienced in Replication. So I still have a few queries on what you have said. I would like to be really clear before I do something as this is the production database.
If I drop a subscription from the publisher, will it not mean that I would need to initialize via the snapshots again?
And what does sp_refreshsubscriptions do actually? I did look at BOL, but didn't understand too much.
Regards,
Karthik.
|||Karthik,
apologies - I just reread your post and noticed that you are using merge replication. In this case my route won't work - it only works for snapshot and transactional. What you can do though is to script out your publication (inc subscriptions),delete the
publication (and prevent users from editing data on the subscriber), make necessary changes to the table, then recreate the publication. For each of the other articles you set @.sync_type to 'none' to establish that the table already exists on the subscrib
er. For the table that you want the identity value, you'll need to have @.sync_type set to 'automatic'.
Alternatively you can have several publications to separate the articles if this is a common issue.
As another point, I'd mention that you can be sure to avoid these PK violations if you set the increment of the identity column in such a way as there can never be an overlap eg publisher uses even numbers and subscriber odd ones. There is an article by M
ichael Hotek on this (http://www.mssqlserver.com/replicati...h_identity.asp).
HTH,
Paul Ibison
|||Hi Paul,
I did generate a script of both the publisher and subscribers. But nowhere could I see a @.sync_type. I searched the entire text file.
May be I forgot to specify that I have a pull subscription.
Do let me know if my posting part of the script file would help.
Thank you once again.
Regards,
Karthik
|||Karthik,
it's a parameter off sp_addmergepullsubscription or sp_addmergesubscription.
However, unfortunately it is not valid on a per article basis - hadn't
appreciated this subtle difference between transactional and merge, so you'd
have to set @.sync_type set to 'automatic' for the complete subscription. In
your case you might be able to make the required table modification to the
table on the publisher and subscriber then run this. As it involves identity
column changes whose ranges are saved to system tables I suspect this is not
viable and would advise another route:
(a) drop the publication! Add 2 new publications - one with the old tables
apart from the problemmatic one, one with the problemmatic table. For the
first one have @.sync_type set to 'none' (subscriber has schema) and have
@.sync_type set to 'automatic' for the second.
(b) if this is not feasible (due to PK-FK constraints between articles),
then go down the initial route of a complete recreation of the publication.
Sorry it's not easier advice.
Regards,
Paul Ibison
|||Hi Paul,
What you seemed to have mentioned seems quite complicated. I would like to stall it as much as possible. Anyways, may be I am trying to go about this the wrong way as I didn't specify why I want to drop the article.
Is there any way I can specify idenity ranges for an article after it has been published? What I need to do basically is, specify that my table "FTPFile" has a range of 1-1000 from my publisher with a threshold of 80%.
Is there any way of doing this?
Thank you once again!
Regards,
Karthik.
|||Karthik,
the only sp wich might be relevant is:
sp_adjustpublisheridentityrange
From BOL: For a publication which has the auto identity range enabled, the
Distribution Agent or Merge Agent is responsible for automatically adjusting
the identity range in a publication based on its threshold value. However,
if for some reason the Distribution Agent or Merge Agent has not been run
for a period of time, and identity range resource have been consumed heavily
to the point of threshold, users can call sp_adjustpublisheridentityrange to
allocate a new range of values for a Publisher.
The identity ranges are held in a system table and the infrastructure is
also implemented using check constraints, but I would not advise you to
change these manually.
My recommendation would be to set it up again and ensure there can't be any
problems by following Michael Hotek's example: eg publisher uses even
numbers and subscriber odd ones. There is an article on this
(http://www.mssqlserver.com/replicati...h_identity.asp).
HTH,
Paul Ibison
|||Hi Paul,
Thank you for all the help.
I was able to fix the problem as suggested in the link.
Thank you once again.
Regards,
Karthik

Sunday, March 25, 2012

Dropping a table from merge replication

Guys,
Merge replication server A to server B with NOSYNC option. (identities odd
at Server A and even at Server B)
I want to remove a table from merge replication.
Regards
Javed
Use sp_dropmergearticle
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"Javed Iqbal" <javediqbal98@.hotmail.com> wrote in message news:%23GyRlsm7FHA.3752@.tk2msftngp13.phx.gbl...
Guys,
Merge replication server A to server B with NOSYNC option. (identities odd
at Server A and even at Server B)
I want to remove a table from merge replication.
Regards
Javed
|||......provided the snapshot hasn't yet been run - otherwise you'll have to drop the subscriptions first and reinitialize (nosync again so not too arduous).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks Paul,
I have set up merge replication.
Server A = Publisher
Server B = Subscriber
Snapshot = NOSYNC
The identities are manually handled ie: Odd on Server A and Even on Server B.
Due to some reason I had to remove on table from my Publication. For this i dropped subscription then removed table from publication.
Mean while I allowed user to connect to publisher and change data. After say 20 minutes i again enabled to subscription with NOSYNC.
I got an error for OBSOLETE SNAPSHOT. so I ran the snap shopt again. and since then merge agent is running fine.
My concern is between that 20 minutes data changed is not propagated to the subscriber. How do i sync my database for those records?
Regards
Javed
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message news:ewVZUro7FHA.252@.TK2MSFTNGP15.phx.gbl...
.....provided the snapshot hasn't yet been run - otherwise you'll have to drop the subscriptions first and reinitialize (nosync again so not too arduous).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||If the extra changes were inserts you could run sp_addtabletocontents to include the rows then resynchronise. If they are general inserts and updates, you can use sp_mergedummyupdate for each single row. It might be difficult to find these changed rows, and something like datacompare could be used for this to decide what to do.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Droping a table in subscrier !

Hello,
I had a merge replication that was replicating a table, and i deleted it,
now it doesn't let me drop that replicated table in my subscriber database.
It says that it is being used for replication.
I even stoped and started my server, but no success.
Any help !!!!!!!!
Thanks,
Mathew
Matthew,
have a look at using sp_MSunmarkreplinfo.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
sql

Monday, March 19, 2012

Drop Subcription at subscriber

Sql Server 2000. I had a merge publication setup on one table that replicated to several sql servers (all 2000 SP3). The publication was deleted on the publisher - but somehow - the subscription information is still on the subscribers. How can I remove them? When trying to delete the tables at the subscribers I get error that they are part of replication.

P.S. Other tables in the same database are part of different merge replication.

Thanks.

Abe

If you do not want the subscriber database to be participated in replication, you can do

sp_replicationdboption 'subscriber_database', 'subscribe', 'false' on the subscriber side; then drop the table.

Thanks.

This posting is provided AS IS with no warranties, and confers no rights

|||Thank you for your reply. I forgot to mention in the original post (which i justed edited) that the database contains tables (not the table I'm trying to delete) that are part of another publication. Therefore I do not think I can run sp_replicationdboption. Also, I thought you can only run sp_replicationdboption on the publisher - but I stand to be corrected.|||Run sp_dropmergepullsubscription with required parameters at the subscriber database.

Drop merge filter (pull subscription)

Hi everybody,
I'm trying to remove a rowfilter (and 'JOINS') from one of my publication.
When I first tried this on a testdatabase everything seemed to work. But it's
not working on the productiondatabase. I always receive this message:
Cannot drop filter 'Table1_Table2' from publication 'NamePublication'
because its snapshot has been run and this publication could have active
subscriptions.
I don't know how to solve this. Any help would be appreciated!
Thanks!
Benno,
try scripting it out, delete the publication then run the script, be sure to
disable the snapshot agent, then remove the filter.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Hi Paul,
thanks for your reply bu I'm afraid I don't understand all of it: do you
think I should delete the publication (without deleting the subscriptions?)
and than recreate it (using the script I created first)? And how would you
delete the publication: EM or stored procedure?
Thanks!
"Paul Ibison" wrote:

> Benno,
> try scripting it out, delete the publication then run the script, be sure to
> disable the snapshot agent, then remove the filter.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||Benno - that's right. If you script out the publication and subscriptions,
you can then delete the subscriptions and the publication. Aftert that you
use the script to create the publication. Delete the filters you don't want
then add the subscriptions and initialize.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Hi Paul,
can I create and drop the PULL subscriptions "remotely". I don't want to
visit all subscribers to drop the subscription and recreate it afterwards...
Thanks!
"Paul Ibison" wrote:

> Benno - that's right. If you script out the publication and subscriptions,
> you can then delete the subscriptions and the publication. Aftert that you
> use the script to create the publication. Delete the filters you don't want
> then add the subscriptions and initialize.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
>
|||Benno,
in the case of merge replication, the script to be run at Subscriber
includes:
exec sp_addmergepullsubscription
exec sp_addmergepullsubscription_agent
If you can connect to and register in EM all the subscribers and run this,
then it can all be set up from one location.
The corresponding script to set up all these subscriptions is also
obtainable for EM: Right Clich the publications foldes and select to
Generate SQL Script...
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

drop manually table (on the subscriber) that was part of merge p

Hi ,
I am trying to drop manually table (on the subscriber) that was part of
merge publication before but got the below message. The publication was
dropped using E.M and even when try to re-create merge publication and add
this table it failed due to the fact that the it can not drop the specific
table on the subscriber .
Can I find any system store proc that force drop this table? Can I drop
it manually from system table (what tables )?
The message is :
Cannot drop the table 'XXXX' because it is being used for replication.
There is a stored procedure to do this called sp_MSunmarkreplinfo which
takes a tablename as a parameter. Alternatively, setting replinfo to 0 in
sysobjects for the particular table should do it. Finally, running
sp_removedbreplication can be used to remove all traces of replication in
the subscriber database, but obviously must only be done if this database is
not also configured as a publisher.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Friday, March 9, 2012

drop col from published table

I wish to add a col to a table I have published for merge replication.
When I attempt to do this I receive errors in regard to the rowguid col that
was added when creating my publication.
Do I need to drop the publication before adding col ?
Or is there another way out of this ?
You shouldn't have to if you use sp_repldropcolumn. What is the exact error
message you are getting?
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:eTmObDGBHHA.1012@.TK2MSFTNGP04.phx.gbl...
>I wish to add a col to a table I have published for merge replication.
> When I attempt to do this I receive errors in regard to the rowguid col
> that was added when creating my publication.
> Do I need to drop the publication before adding col ?
> Or is there another way out of this ?
>
|||Hi Hilary, and thanks for the response.
When I attempt to add (not drop) a col to a table I have published for
mobile merge replication I receive the following errors :
"Error validation the default for column 'rowguid'."
"It is invalid to drop the default constraint on the rowguid column that is
used by merge replication. The DDL operation failed inside merge DDL
replication manipulation. The transaction ended in the trigger. The batch
has been aborted."
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:ObR97mGBHHA.3380@.TK2MSFTNGP04.phx.gbl...
> You shouldn't have to if you use sp_repldropcolumn. What is the exact
> error message you are getting?
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
> news:eTmObDGBHHA.1012@.TK2MSFTNGP04.phx.gbl...
>