Showing posts with label transactional. Show all posts
Showing posts with label transactional. Show all posts

Thursday, March 29, 2012

Delete data in publisher database

I have set up a transactional replication to replicate data from database A to B. As the data in database A is just a temporary db, I need to clean up periodically. I have already replaced the delete command in the stored procedure so that delete action will not triggered in subscriber database when I use delete command in publisher database.

However, using delete command in publisher db will generate a huge txn log that make my drive out of disk space. I can't use 'truncate table' function as the table is participated in replication.

Anyone has a good idea how to clean up the publisher database?

thanks,
PWell...the only option I can think of will be to backup/truncate the log whenever you do batch-deletes.

BACKUP LOG MyNwind
WITH TRUNCATE_ONLY

Be aware though that when doing this the log not be recoverable! Hope this works for you...

Thursday, March 22, 2012

Delete

I've got 2000-to-2000 immediate, one way, transactional replication set up.
I am curious about something: if I go into the Publishers tab on the server
that is the "master", i.e. distributor and right click on the publication one
of the options it gives me is "Delete". But I know it's critical that this
would be done correctly as before the publisher is deleted, it must delete
all subscriptions and articles.
If I hit delete, will this do all this cleaning out of subscriptions and
articles correctly?
No, it doesn't.. Delete the subscription first and then you can delete the
publication. Even after this, the articles don't get deleted.
but reading your previous posts, it looks like your publication will be set
to drop tables and recreate on subscriber... so, that would take care of it
or on subscriber, i assume you can do it manually...
Tej
|||Thx. That's what I thought. And if you leave anything orphaned, I've seen
it cause problems in times past. Again, thx for the help...
"Tejas Parikh" wrote:

> No, it doesn't.. Delete the subscription first and then you can delete the
> publication. Even after this, the articles don't get deleted.
> but reading your previous posts, it looks like your publication will be set
> to drop tables and recreate on subscriber... so, that would take care of it
> or on subscriber, i assume you can do it manually...
> Tej
|||Delete it. It will warn you that you are deleting existing subscriptions and
for the most part it will correctly clean up objects on the publisher and
subscriber.
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
"CLM" <CLM@.discussions.microsoft.com> wrote in message
news:CBAECE0E-2C1B-454F-8998-5CC0ED4D2A86@.microsoft.com...
> I've got 2000-to-2000 immediate, one way, transactional replication set
> up.
> I am curious about something: if I go into the Publishers tab on the
> server
> that is the "master", i.e. distributor and right click on the publication
> one
> of the options it gives me is "Delete". But I know it's critical that
> this
> would be done correctly as before the publisher is deleted, it must delete
> all subscriptions and articles.
> If I hit delete, will this do all this cleaning out of subscriptions and
> articles correctly?