0

The Auditdata table in my sharepoint site is becoming huge (over 70 Gb and 200 Million records) running the Trimauditlog command (http://technet.microsoft.com/en-us/library/cc706879.aspx) times out as it is very slow.

Can i simply truncate that table? or there are side effects to doing that (other than losing audit data)

squillman
  • 37,883
  • 12
  • 92
  • 146

2 Answers2

2

You should break up your stsadm commands in batch.

Query your databases and get a start date. Then use excel to create the stsadm commands day by day and put them in a text file. Sample:

time /T
date /T
echo %date% %time% >> output.txt
stsadm -o trimauditlog -date 20070729 -databasename WSS_Content >> output.txt

time /T
date /T
echo %date% %time% >> output.txt
stsadm -o trimauditlog -date 20070730 -databasename WSS_Content >> output.txt

run them using the task scheduler. One note. I noticed it ran a lot faster after we disabled all audits setup in the site collections for the content db. Might be my imagination but it seemed to help.

user9517
  • 115,471
  • 20
  • 215
  • 297
1

(You didn't specify if you'd tried this approach already) Why not trim the table in smaller chunks up to your target date using the '-date' parameter instead of all at once?

vinny
  • 456
  • 3
  • 6