{"id":37,"date":"2015-04-29T10:07:42","date_gmt":"2015-04-29T14:07:42","guid":{"rendered":"https:\/\/www.sqlskills.com\/blogs\/tim\/?p=37"},"modified":"2015-04-29T10:07:42","modified_gmt":"2015-04-29T14:07:42","slug":"be-careful-when-playing-with-features","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/tim\/be-careful-when-playing-with-features\/","title":{"rendered":"Be careful when playing with features"},"content":{"rendered":"<p><span style=\"color: #000000;\">I recently performed a health audit for a client and found several transaction logs that had grown exponentially larger than the data files. This is a fairly common thing to find when databases are in full recovery model with no log backups, however that was not this client\u2019s issue. The databases were in full recovery and log backups were being taken every 15 minutes, however the log was not truncating and reusing the existing log.<\/span><\/p>\n<p><span style=\"color: #000000;\">I looked for open transactions assuming that was the issue but that was a dead end. \u00a0I decided to do some digging and looked at the database properties in sys.databases and found that the log_reuse_wait_desc was set to \u2018REPLICATION\u2019. This was odd since the client stated they do not use replication. I reported what I found to my client and was told that a long time ago they toyed with replication trying to build a reporting server and ended up killing the project.<\/span><\/p>\n<p><span style=\"color: #000000;\">What didn&#8217;t happen was cleaning up and removing replication from the databases once the project was cancelled. I am not a big replication guy so this was a new area for me. With a quick search I was able to find <a style=\"color: #000000;\" href=\"https:\/\/technet.microsoft.com\/en-us\/library\/aa239336%28v=sql.80%29.aspx\">sp_removedbreplication<\/a> which removes all replication objects from the database. I was able to remove replication from each of the database by running the following:<\/span><\/p>\n<p><span style=\"color: #000000;\">sp_removedbreplication N&#8217;db_name&#8217;<\/span><\/p>\n<p><span style=\"color: #000000;\">Once replication was removed the log_reuse_wait_desc was updated to \u2018nothing\u2019 and the log was able to truncate. This didn\u2019t solve all the problems with these logs though. An adverse effect of the logs growing out of control were extremely large log files with a lot of virtual log files. I followed Kimberly\u2019s advice in her post (<a style=\"color: #000000;\" href=\"http:\/\/www.sqlskills.com\/blogs\/kimberly\/8-steps-to-better-transaction-log-throughput\/\"><em>8 steps to better transaction log throughput<\/em><\/a>) and was able to shrink the log file, resetting the number of virtual log files, and then properly grow the log files to efficient sizes with more appropriate auto growth sizes.<\/span><\/p>\n<p><span style=\"color: #000000;\">BTW, for an interesting twist on the REPLICATION value for log_reuse_wait_desc, see Paul\u2019s post: <a style=\"color: #000000;\" href=\"http:\/\/www.sqlskills.com\/blogs\/paul\/replication-preventing-log-reuse-but-no-replication-configured\/\"><em>REPLICATION preventing log reuse but no replication configured<\/em><\/a>.<\/span><\/p>\n<p><span style=\"color: #000000;\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently performed a health audit for a client and found several transaction logs that had grown exponentially larger than the data files. This is a fairly common thing to find when databases are in full recovery model with no log backups, however that was not this client\u2019s issue. The databases were in full recovery [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,8],"tags":[],"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/posts\/37"}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}