Showing posts with label replicating. Show all posts
Showing posts with label replicating. Show all posts

Monday, March 12, 2012

removing replication table

Hi all,

Can Enterprise Manager remove a table from replicating to another server? I've tried looking at the article tab of the property of the publication but couldn't find a way to delete a table from the article.

Any idea?

Thanks!
Hi Alan,

In SQL Server 2000, if there is an active subscription or the publication allows anonymous subscriptions, you will not be able to drop an article either through Enterprise manager or through scripts.

This has been relaxed in SQL Server 2005 and you can freely add/drop articles and in some cases you need to reinitialize the subscriptions.|||Many thanks for the info!
|||

Hello Mahesh,

Background:

I installed MS CRM 1.2 last year for the company to test out. When MS released CRM 3.0 to us (we are part of the MS PP via the Action Pack) I tried installing that. I had a database issue (error on my part in SQL Server with null values) that I corrected. However when I went back into to reinstall CRM 3.0 the app complained about database replication. I have not used replication at anytime prior to any of this. So when I went into the database to look sure enough a database MyCompanyName_MSCRMDistrubution was there and had database replication on it. However when I looked into the tables there was nothing in there (no publishers, no subscribers, null, ect). So I first tried to us the MS KB article on removing database replication however the first couple of stored_procs need pubs and subs params (args) which I could not include. So I then found a stored_proc named sp_removedreplication which I ran successfully. However through EM the offending database still is showing replication and hence I can not detach and remove it.

Someone mentioned that I should remove the MyCompanyName_METABASE (which I can at this point) to see if this helped. Another mentioned I should open up a Support Case with MSB.

Before opening up a case do you have any recommendations? (or anyone else for that matter)

Thank you in advance.

|||

Not sure if this is a recommended approach but you can try and update the category column in the sysdatabases table (for your db) to 0 and that should take care of the problem. Also have the Allow modifications to be made directly to the system catalogs option checked before you do the update.

update sysdatabases

set category = 0

where name = <your database name>

|||

A better way is to try:

If using Merge replication:

exec sp_replicationdboption 'MyCompanyName_MSCRMDistrubution ', 'merge publish', 'false'

If Tran replication:

exec sp_replicationdboption 'MyCompanyName_MSCRMDistrubution ', 'publish', 'false'

See if that serves the purpose.

|||

Mahesh,

I tried this and it ran successfully, but to no avail. The replication was still on at this point. However see my replied to Sachin

|||

Sachin,

Thank you. What I did was the following:

1. I ran Mahesh stored_proc for merged replication, it ran fine but the replication was still there.

2. I attempted to run your script above but I did not have ad hoc updates on.

3. Being curious I rans some simple selects and verifyed that you were correct that for that particular db and the category was a value of 16. So after turning on the ad hoc updates I created an update table and changed the cat to 0.

4. Then I created a drop database query and ran that.

5. That dropped the table from the system just fine!

Thank you.

|||

Don,

I am glad I could help. :)

|||

Sachin,

Me too. Step 5 should have been "dropped the database" instead of table.

Best Regards~

Don

removing replication table

Hi all,

Can Enterprise Manager remove a table from replicating to another server? I've tried looking at the article tab of the property of the publication but couldn't find a way to delete a table from the article.

Any idea?

Thanks!
Hi Alan,

In SQL Server 2000, if there is an active subscription or the publication allows anonymous subscriptions, you will not be able to drop an article either through Enterprise manager or through scripts.

This has been relaxed in SQL Server 2005 and you can freely add/drop articles and in some cases you need to reinitialize the subscriptions.|||Many thanks for the info!
|||

Hello Mahesh,

Background:

I installed MS CRM 1.2 last year for the company to test out. When MS released CRM 3.0 to us (we are part of the MS PP via the Action Pack) I tried installing that. I had a database issue (error on my part in SQL Server with null values) that I corrected. However when I went back into to reinstall CRM 3.0 the app complained about database replication. I have not used replication at anytime prior to any of this. So when I went into the database to look sure enough a database MyCompanyName_MSCRMDistrubution was there and had database replication on it. However when I looked into the tables there was nothing in there (no publishers, no subscribers, null, ect). So I first tried to us the MS KB article on removing database replication however the first couple of stored_procs need pubs and subs params (args) which I could not include. So I then found a stored_proc named sp_removedreplication which I ran successfully. However through EM the offending database still is showing replication and hence I can not detach and remove it.

Someone mentioned that I should remove the MyCompanyName_METABASE (which I can at this point) to see if this helped. Another mentioned I should open up a Support Case with MSB.

Before opening up a case do you have any recommendations? (or anyone else for that matter)

Thank you in advance.

|||

Not sure if this is a recommended approach but you can try and update the category column in the sysdatabases table (for your db) to 0 and that should take care of the problem. Also have the Allow modifications to be made directly to the system catalogs option checked before you do the update.

update sysdatabases

set category = 0

where name = <your database name>

|||

A better way is to try:

If using Merge replication:

exec sp_replicationdboption 'MyCompanyName_MSCRMDistrubution ', 'merge publish', 'false'

If Tran replication:

exec sp_replicationdboption 'MyCompanyName_MSCRMDistrubution ', 'publish', 'false'

See if that serves the purpose.

|||

Mahesh,

I tried this and it ran successfully, but to no avail. The replication was still on at this point. However see my replied to Sachin

|||

Sachin,

Thank you. What I did was the following:

1. I ran Mahesh stored_proc for merged replication, it ran fine but the replication was still there.

2. I attempted to run your script above but I did not have ad hoc updates on.

3. Being curious I rans some simple selects and verifyed that you were correct that for that particular db and the category was a value of 16. So after turning on the ad hoc updates I created an update table and changed the cat to 0.

4. Then I created a drop database query and ran that.

5. That dropped the table from the system just fine!

Thank you.

|||

Don,

I am glad I could help. :)

|||

Sachin,

Me too. Step 5 should have been "dropped the database" instead of table.

Best Regards~

Don

Friday, March 9, 2012

Removing Merge Replication

Hi,
I have two databases which have previously been replicating via merge replication.
I have removed replacation from one of the databases (the smaller) one, and noticed during this process the system slowed to an absolute crawl.
My problem is, i need to do the second (and much larger database) but cant afford for the system to a) take so long b) be virtually unusable during this period.
Is there any way around this? Can it be done manually? Can you change the priority or limit the maximum i/o usage during the removal period?
Also, is it normal for replicated databases to be double the size of non-replicated databases?
Thanks,
Andrew
Andrew,
can you try disabling the merge agent then dropping the subscriber out of
hours?
As for the size of the database, have a look at the main merge replication
tables:
sp_spaceused msmerge_contents
sp_spaceused msmerge_tombstone
sp_spaceused MSmerge_genhistory
This is probably where you'll find the extra space is used up. Cleaning up
metadata can aid in this issue.
HTH,
Paul Ibison
|||Unfortunately we dont have an after hours period, we are a 24/7 business. Any suggestions?
Thanks,
Andrew
"Paul Ibison" wrote:

> Andrew,
> can you try disabling the merge agent then dropping the subscriber out of
> hours?
> As for the size of the database, have a look at the main merge replication
> tables:
> sp_spaceused msmerge_contents
> sp_spaceused msmerge_tombstone
> sp_spaceused MSmerge_genhistory
> This is probably where you'll find the extra space is used up. Cleaning up
> metadata can aid in this issue.
> HTH,
> Paul Ibison
>
>
|||dropping replication should not be causing this problem. I would run
profiler to determine exactly where it is failing.
You can drop a merge subscription by using
sp_dropmergepullsubscription
sp_dropmergesubscription and set the ignore_distribution parameter to true.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:7ED41D2D-F59F-4F37-BDD2-DF5DDDACEC5A@.microsoft.com...
> Unfortunately we dont have an after hours period, we are a 24/7 business.
Any suggestions?[vbcol=seagreen]
> Thanks,
> Andrew
> "Paul Ibison" wrote:
of[vbcol=seagreen]
replication[vbcol=seagreen]
up[vbcol=seagreen]
|||dropping replication should not be causing this problem. I would run
profiler to determine exactly where it is failing.
You can drop a merge subscription by using
sp_dropmergepullsubscription
sp_dropmergesubscription and set the ignore_distribution parameter to true.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:7ED41D2D-F59F-4F37-BDD2-DF5DDDACEC5A@.microsoft.com...
> Unfortunately we dont have an after hours period, we are a 24/7 business.
Any suggestions?[vbcol=seagreen]
> Thanks,
> Andrew
> "Paul Ibison" wrote:
of[vbcol=seagreen]
replication[vbcol=seagreen]
up[vbcol=seagreen]
|||Hi Hilary,
Thanks for your reply.
Does the procedure you describe do the same as deleting the subscription via enterprise manager?
If I start the procedure described via Query Analyser, can it be stopped? (If the load on the server becomes too high?)
Andrew
"Hilary Cotter" wrote:

> dropping replication should not be causing this problem. I would run
> profiler to determine exactly where it is failing.
> You can drop a merge subscription by using
> sp_dropmergepullsubscription
> sp_dropmergesubscription and set the ignore_distribution parameter to true.
>
> --
> Hilary Cotter
> Looking for a book on SQL Server replication?
> http://www.nwsu.com/0974973602.html
>
> "Andrew" <Andrew@.discussions.microsoft.com> wrote in message
> news:7ED41D2D-F59F-4F37-BDD2-DF5DDDACEC5A@.microsoft.com...
> Any suggestions?
> of
> replication
> up
>
>
|||Hi Hilary,
Thanks for your reply.
Does the procedure you describe do the same as deleting the subscription via enterprise manager?
If I start the procedure described via Query Analyser, can it be stopped? (If the load on the server becomes too high?)
Andrew
"Hilary Cotter" wrote:

> dropping replication should not be causing this problem. I would run
> profiler to determine exactly where it is failing.
> You can drop a merge subscription by using
> sp_dropmergepullsubscription
> sp_dropmergesubscription and set the ignore_distribution parameter to true.
>
> --
> Hilary Cotter
> Looking for a book on SQL Server replication?
> http://www.nwsu.com/0974973602.html
>
> "Andrew" <Andrew@.discussions.microsoft.com> wrote in message
> news:7ED41D2D-F59F-4F37-BDD2-DF5DDDACEC5A@.microsoft.com...
> Any suggestions?
> of
> replication
> up
>
>

Monday, February 20, 2012

removing and adding objects from publication

I am replicating all tables and views in a database with snapshot
replication. It is giving an error because View2 is dependent on View1 but it
is trying to create View2 first. I was going to delete and recreate View2 so
it would come after View1 but when I went to delete View2 I got an error
saying that I couldn't delete the view because it is being used by
replication. Is there any way I can delete and recreate View2 without having
to delete all of my replication setup? Is there an easy way to remove and add
objects to a publication? Thanks!
Thanks Paul - I see that this will help me delete the view. When it is
recreated how can I add it back into the publication? Thanks!
"Paul Ibison" wrote:

> You should be able to use this type of approach:
> exec sp_dropsubscription @.publication
> = 'PDS_to_Cab_Tables'
> , @.article = 'SNAPSHOT_RELEASE_INFO'
> , @.subscriber = 'RSCOMPUTERXXX'
> , @.destination_db = 'delivery'
>
> for each subscriber, then...
> exec sp_droparticle @.publication = 'PDS_to_Cab_Tables'
> , @.article = 'SNAPSHOT_RELEASE_INFO'
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||sp_addarticle and sp_addsubscription will do it.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)