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?


more ▼

asked Nov 11, 2010 at 06:31 PM in Default

avatar image

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, 2010 at 10:47 PM

avatar image

Pavel Pawlowski
22.7k 10 15 26

(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



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Nov 11, 2010 at 06:31 PM

Seen: 1838 times

Last Updated: Nov 11, 2010 at 06:31 PM

Copyright 2018 Redgate Software. Privacy Policy