Taming the WSS_Logging Database

As per this article by Eric Phillips, the WSS_Logging database holds a bunch of legacy logging data.  As the timer jobs for creating diagnostic reports are disabled by default (to prevent extra load on the system) and considering most folks aren’t asking for that data, 14 days of it just equals big databases. The default duration it holds the information is 14 days, which can lead to really large WSS_Logging databases. Now, I can hear (my colleague) Keith’s eyes rolling into the back of his head as I paste 12 lines of PowerShell below, instead of creating a loop in 5 lines. But my approach took 30 seconds 😉

Anyways, it seems perfectly reasonable to me to set retention to 3 days…

To set the SPUsageDefinition data to 3 days (from the default of 14)

Set-SPUsageDefinition -Identity "Sandboxed Requests" -DaysRetained 3
Set-SPUsageDefinition -Identity "Content Import Usage" -DaysRetained 3
Set-SPUsageDefinition -Identity "Workflow" -DaysRetained 3
Set-SPUsageDefinition -Identity "Clickthrough Usage" -DaysRetained 3
Set-SPUsageDefinition -Identity "Content Export Usage" -DaysRetained 3
Set-SPUsageDefinition -Identity "Page Requests" -DaysRetained 3
Set-SPUsageDefinition -Identity "Feature Use" -DaysRetained 3
Set-SPUsageDefinition -Identity "Search Query Usage" -DaysRetained 3
Set-SPUsageDefinition -Identity "Site Inventory Usage" -DaysRetained 3
Set-SPUsageDefinition -Identity "Sandboxed Requests Monitored Data" -DaysRetained 3
Set-SPUsageDefinition -Identity "Timer Jobs" -DaysRetained 3
Set-SPUsageDefinition -Identity "Rating Usage" -DaysRetained 3

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

To get the current retention

Get-SPUsageDefinition
 

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

One response to “Taming the WSS_Logging Database

Comments are closed.