x
login about faq Site discussion (meta-askssc)

Purging MOSS DB, auditdata table in SQL

Hi, There is MOSS database (ContentDB) which contains auditdata table of 150GB size and one million rows. This table has a column with datatype ntext. A delete command is fired from sharepoint side (stsadm command) which deletes data from table for one day. When delete is happening, log file grows to 240GB and finally fails as we dont have any more space for log file to grow. It seems sharepoint tables should not be deleted directly from SQL side. I tried changing recovery mode to bulk logged but no help as delete is not a minimally logged operation. Also truncate log doesnot work as whole delete is one huge transaction.

Why deleting just one day's data creating 240+GB of log?Is there anyway to handle this?

Thanks

more ▼

asked Nov 11 '10 at 06:31 PM in Default

Sonali gravatar image

Sonali
11 1 1 1

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

If you delete data from a table and DB is in Full recovery or bulk mode, then every deleted record is logged to a transaction log. If you need to delete large amount of data and don't have enought log space, you have several possibilities.

  1. Delete data in batches and backup log between batches
  2. Try backup the log before deleting and if there is still not enought space, add some space to log.
  3. If you want to delete all the data, then switch to bulk logged and truncate table
  4. Switch to simple mode and delete data. Then go back to full recovery mode.
more ▼

answered Nov 11 '10 at 10:47 PM

Pavel Pawlowski gravatar image

Pavel Pawlowski
20.3k 5 10 20

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x44

asked: Nov 11 '10 at 06:31 PM

Seen: 1014 times

Last Updated: Nov 11 '10 at 06:31 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.