{"id":1062,"date":"2012-03-21T13:54:00","date_gmt":"2012-03-21T20:54:00","guid":{"rendered":"http:\/\/blog.brainlitter.com\/2012\/03\/21\/taming-the-wss_logging-database\/"},"modified":"2012-03-21T13:54:00","modified_gmt":"2012-03-21T20:54:00","slug":"taming-the-wss_logging-database","status":"publish","type":"post","link":"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/","title":{"rendered":"Taming the WSS_Logging Database"},"content":{"rendered":"<p>As per <a href=\"http:\/\/it.ep-0.com\/?p=18\" target=\"_blank\" rel=\"noopener noreferrer\">this article by Eric Phillips<\/a>, the WSS_Logging database holds a bunch of legacy logging data.&nbsp; As the timer jobs for creating diagnostic reports are disabled by default (to prevent extra load on the system) and considering most folks aren\u2019t 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\u2019s 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 \ud83d\ude09<\/p>\n<blockquote>\n<p>Anyways, it seems perfectly reasonable to me to set retention to 3 days\u2026<\/p>\n<\/blockquote>\n<h2>To set the SPUsageDefinition data to 3 days (from the default of 14)<\/h2>\n<div class=\"csharpcode\">\n<pre class=\"alt\">Set-SPUsageDefinition -Identity <span class=\"str\">\"Sandboxed Requests\"<\/span> -DaysRetained 3<\/pre>\n<pre>Set-SPUsageDefinition -Identity <span class=\"str\">\"Content Import Usage\"<\/span> -DaysRetained 3<\/pre>\n<pre class=\"alt\">Set-SPUsageDefinition -Identity <span class=\"str\">\"Workflow\"<\/span> -DaysRetained 3<\/pre>\n<pre>Set-SPUsageDefinition -Identity <span class=\"str\">\"Clickthrough Usage\"<\/span> -DaysRetained 3<\/pre>\n<pre class=\"alt\">Set-SPUsageDefinition -Identity <span class=\"str\">\"Content Export Usage\"<\/span> -DaysRetained 3<\/pre>\n<pre>Set-SPUsageDefinition -Identity <span class=\"str\">\"Page Requests\"<\/span> -DaysRetained 3<\/pre>\n<pre class=\"alt\">Set-SPUsageDefinition -Identity <span class=\"str\">\"Feature Use\"<\/span> -DaysRetained 3<\/pre>\n<pre>Set-SPUsageDefinition -Identity <span class=\"str\">\"Search Query Usage\"<\/span> -DaysRetained 3<\/pre>\n<pre class=\"alt\">Set-SPUsageDefinition -Identity <span class=\"str\">\"Site Inventory Usage\"<\/span> -DaysRetained 3<\/pre>\n<pre>Set-SPUsageDefinition -Identity <span class=\"str\">\"Sandboxed Requests Monitored Data\"<\/span> -DaysRetained 3<\/pre>\n<pre class=\"alt\">Set-SPUsageDefinition -Identity <span class=\"str\">\"Timer Jobs\"<\/span> -DaysRetained 3<\/pre>\n<pre>Set-SPUsageDefinition -Identity <span class=\"str\">\"Rating Usage\"<\/span> -DaysRetained 3<\/pre>\n<\/div>\n<p>.csharpcode, .csharpcode pre<br \/>\n{<br \/>\n\tfont-size: small;<br \/>\n\tcolor: black;<br \/>\n\tfont-family: consolas, &#8220;Courier New&#8221;, courier, monospace;<br \/>\n\tbackground-color: #ffffff;<br \/>\n\t\/*white-space: pre;*\/<br \/>\n}<br \/>\n.csharpcode pre { margin: 0em; }<br \/>\n.csharpcode .rem { color: #008000; }<br \/>\n.csharpcode .kwrd { color: #0000ff; }<br \/>\n.csharpcode .str { color: #006080; }<br \/>\n.csharpcode .op { color: #0000c0; }<br \/>\n.csharpcode .preproc { color: #cc6633; }<br \/>\n.csharpcode .asp { background-color: #ffff00; }<br \/>\n.csharpcode .html { color: #800000; }<br \/>\n.csharpcode .attr { color: #ff0000; }<br \/>\n.csharpcode .alt<br \/>\n{<br \/>\n\tbackground-color: #f4f4f4;<br \/>\n\twidth: 100%;<br \/>\n\tmargin: 0em;<br \/>\n}<br \/>\n.csharpcode .lnum { color: #606060; }<\/p>\n<h2>To get the current retention<\/h2>\n<div class=\"csharpcode\">\n<pre class=\"alt\">Get-SPUsageDefinition<\/pre>\n<pre>&nbsp;<\/pre>\n<\/div>\n<p>.csharpcode, .csharpcode pre<br \/>\n{<br \/>\n\tfont-size: small;<br \/>\n\tcolor: black;<br \/>\n\tfont-family: consolas, &#8220;Courier New&#8221;, courier, monospace;<br \/>\n\tbackground-color: #ffffff;<br \/>\n\t\/*white-space: pre;*\/<br \/>\n}<br \/>\n.csharpcode pre { margin: 0em; }<br \/>\n.csharpcode .rem { color: #008000; }<br \/>\n.csharpcode .kwrd { color: #0000ff; }<br \/>\n.csharpcode .str { color: #006080; }<br \/>\n.csharpcode .op { color: #0000c0; }<br \/>\n.csharpcode .preproc { color: #cc6633; }<br \/>\n.csharpcode .asp { background-color: #ffff00; }<br \/>\n.csharpcode .html { color: #800000; }<br \/>\n.csharpcode .attr { color: #ff0000; }<br \/>\n.csharpcode .alt<br \/>\n{<br \/>\n\tbackground-color: #f4f4f4;<br \/>\n\twidth: 100%;<br \/>\n\tmargin: 0em;<br \/>\n}<br \/>\n.csharpcode .lnum { color: #606060; }<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As per this article by Eric Phillips, the WSS_Logging database holds a bunch of legacy logging data.&nbsp; As the timer jobs for creating diagnostic reports are disabled by default (to prevent extra load on the system) and considering most folks aren\u2019t asking for that data, 14 days of it just equals big databases. The default &hellip; <a href=\"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/\"><\/a><\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[14,334,450,428],"tags":[579,580,581,30,582],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Taming the WSS_Logging Database - Brainlitter - Inside the mind of Sean Wallbridge<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Taming the WSS_Logging Database - Brainlitter - Inside the mind of Sean Wallbridge\" \/>\n<meta property=\"og:description\" content=\"As per this article by Eric Phillips, the WSS_Logging database holds a bunch of legacy logging data.&nbsp; As the timer jobs for creating diagnostic reports are disabled by default (to prevent extra load on the system) and considering most folks aren\u2019t asking for that data, 14 days of it just equals big databases. The default &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/\" \/>\n<meta property=\"og:site_name\" content=\"Brainlitter - Inside the mind of Sean Wallbridge\" \/>\n<meta property=\"article:published_time\" content=\"2012-03-21T20:54:00+00:00\" \/>\n<meta name=\"author\" content=\"Sean Wallbridge\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sean Wallbridge\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/\",\"url\":\"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/\",\"name\":\"Taming the WSS_Logging Database - Brainlitter - Inside the mind of Sean Wallbridge\",\"isPartOf\":{\"@id\":\"https:\/\/regroove.ca\/brainlitter\/#website\"},\"datePublished\":\"2012-03-21T20:54:00+00:00\",\"dateModified\":\"2012-03-21T20:54:00+00:00\",\"author\":{\"@id\":\"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/74e1c0def190f181c1394c2b6d883e77\"},\"breadcrumb\":{\"@id\":\"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Brainlitter\",\"item\":\"https:\/\/regroove.ca\/brainlitter\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Taming the WSS_Logging Database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/regroove.ca\/brainlitter\/#website\",\"url\":\"https:\/\/regroove.ca\/brainlitter\/\",\"name\":\"Brainlitter - Inside the mind of Sean Wallbridge\",\"description\":\"Dad. Husband. Drummer. Learner of Things.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/regroove.ca\/brainlitter\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/74e1c0def190f181c1394c2b6d883e77\",\"name\":\"Sean Wallbridge\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/adf8cea6291c39d166616f2148d919a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/adf8cea6291c39d166616f2148d919a6?s=96&d=mm&r=g\",\"caption\":\"Sean Wallbridge\"},\"url\":\"https:\/\/regroove.ca\/brainlitter\/author\/swallbridge\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Taming the WSS_Logging Database - Brainlitter - Inside the mind of Sean Wallbridge","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/","og_locale":"en_US","og_type":"article","og_title":"Taming the WSS_Logging Database - Brainlitter - Inside the mind of Sean Wallbridge","og_description":"As per this article by Eric Phillips, the WSS_Logging database holds a bunch of legacy logging data.&nbsp; As the timer jobs for creating diagnostic reports are disabled by default (to prevent extra load on the system) and considering most folks aren\u2019t asking for that data, 14 days of it just equals big databases. The default &hellip;","og_url":"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/","og_site_name":"Brainlitter - Inside the mind of Sean Wallbridge","article_published_time":"2012-03-21T20:54:00+00:00","author":"Sean Wallbridge","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sean Wallbridge","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/","url":"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/","name":"Taming the WSS_Logging Database - Brainlitter - Inside the mind of Sean Wallbridge","isPartOf":{"@id":"https:\/\/regroove.ca\/brainlitter\/#website"},"datePublished":"2012-03-21T20:54:00+00:00","dateModified":"2012-03-21T20:54:00+00:00","author":{"@id":"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/74e1c0def190f181c1394c2b6d883e77"},"breadcrumb":{"@id":"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/regroove.ca\/brainlitter\/2012\/03\/21\/taming-the-wss_logging-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Brainlitter","item":"https:\/\/regroove.ca\/brainlitter\/"},{"@type":"ListItem","position":2,"name":"Taming the WSS_Logging Database"}]},{"@type":"WebSite","@id":"https:\/\/regroove.ca\/brainlitter\/#website","url":"https:\/\/regroove.ca\/brainlitter\/","name":"Brainlitter - Inside the mind of Sean Wallbridge","description":"Dad. Husband. Drummer. Learner of Things.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/regroove.ca\/brainlitter\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/74e1c0def190f181c1394c2b6d883e77","name":"Sean Wallbridge","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/adf8cea6291c39d166616f2148d919a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/adf8cea6291c39d166616f2148d919a6?s=96&d=mm&r=g","caption":"Sean Wallbridge"},"url":"https:\/\/regroove.ca\/brainlitter\/author\/swallbridge\/"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/posts\/1062"}],"collection":[{"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/comments?post=1062"}],"version-history":[{"count":0,"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/posts\/1062\/revisions"}],"wp:attachment":[{"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/media?parent=1062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/categories?post=1062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/tags?post=1062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}