{"id":411,"date":"2014-07-10T00:43:04","date_gmt":"2014-07-10T05:43:04","guid":{"rendered":"http:\/\/www.terrcon.com\/dynamics-gp-support\/?p=411"},"modified":"2018-01-11T17:41:08","modified_gmt":"2018-01-11T22:41:08","slug":"sql-log-files-full-hard-drive","status":"publish","type":"post","link":"https:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/","title":{"rendered":"SQL log files fill hard drive: how to fix. Dynamics GP Support"},"content":{"rendered":"<p>If you have a SQL server with a full hard drive there&#8217;s a pretty good chance that the drive was filled with SQL log files (.ldf files). You have to backup the Transaction logs before you can shrink the log file; the problem is that from SQL Management Studio you can typically only backup to local hard drives. If all your local hard drives are full &#8211; this is a problem! SQL Management Studio doesn&#8217;t backup to mapped drives either.<\/p>\n<p>Note: A database needs to be using the Full recovery model for this article to be relevant.<\/p>\n<p>You could mess around with scripting a backup or changing the account that SQL Agent uses, but the quickest easiest solution is to backup to a UNC path: \\\\Server\\Share<\/p>\n<p>Start the Transaction Log Backup from within SQL Management Studio. Choose to Backup the database, select &#8216;Transaction Log&#8217; for Backup Type, then Add a Disk to the Destination: Browsing to the network share won&#8217;t work, you need to type in the entire path: \\\\server\\share\\filename.trn<br \/>\nBe sure and &#8216;Remove&#8217; the other backup destination.<br \/>\nClick on the Options page, then make sure &#8216;Truncate the transaction log&#8217; is selected.<br \/>\nClick OK to start the transaction log backup.<\/p>\n<p>This first backup should be about the same size as the ldf file. Now do another Transaction Log Backup of the database &#8211; save it to a different .trn file. This file should be considerably smaller than the first backup. At this point you can manually shrink the (.ldf) log file:<br \/>\nRight click on the database and choose Tasks &gt; Shrink &gt; Files<br \/>\nSelect Log as the File Type &#8211; you may need to choose which File Name if there are more than one.<br \/>\nMake sure &#8216;Release unused space&#8217; is listed.<br \/>\nClick OK to shrink the file. Look at the ldf file in Windows Explorer to verify that the file actually shrunk.<\/p>\n<p>To prevent the hard drive from filling up again, you have two choices:<\/p>\n<ol>\n<li>Change the database&#8217;s recovery model to Simple. You will no longer be able to restore the database to a specific point in time, but the log files won&#8217;t grow out of control as long as regular database backups are performed.<\/li>\n<li>Schedule Transaction Log backups of this database to occur multiple times each day.<\/li>\n<\/ol>\n<h2>Terrapin Consulting is your best choice for top-notch Dynamics GP Support.<\/h2>\n<p>full hard drive | hard drive full | no space | ldf | log file | transaction log | log backup | can&#8217;t save | won&#8217;t shrink<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have a SQL server with a full hard drive there&#8217;s a pretty good chance that the drive was filled with SQL log files (.ldf files). You have to backup the Transaction logs before you can shrink the log file; the problem is that from SQL Management Studio you can typically only backup to &#8230; <a title=\"SQL log files fill hard drive: how to fix. Dynamics GP Support\" class=\"read-more\" href=\"https:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"generate_page_header":"","footnotes":""},"categories":[1,17],"tags":[18,19],"class_list":["post-411","post","type-post","status-publish","format-standard","hentry","category-dynamicsgphelp","category-dynamics-gp-tech-tips","tag-gp-tech-tips","tag-sql-tech-tip"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL log files fill hard drive: how to fix. Dynamics GP Support<\/title>\n<meta name=\"description\" content=\"For SQL or Dynamics GP Help call Terrapin Consulting @ 888.368.6670 - we&#039;re a top provider of Dynamics GP Support. We&#039;ll support you across USA &amp; Canada.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL log files fill hard drive: how to fix. Dynamics GP Support\" \/>\n<meta property=\"og:description\" content=\"For SQL or Dynamics GP Help call Terrapin Consulting @ 888.368.6670 - we&#039;re a top provider of Dynamics GP Support. We&#039;ll support you across USA &amp; Canada.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/\" \/>\n<meta property=\"og:site_name\" content=\"Dynamics GP Support Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-10T05:43:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-11T22:41:08+00:00\" \/>\n<meta name=\"author\" content=\"Terrapin Consulting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Terrapin Consulting\" \/>\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:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/\",\"url\":\"https:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/\",\"name\":\"SQL log files fill hard drive: how to fix. Dynamics GP Support\",\"isPartOf\":{\"@id\":\"https:\/\/www.terrcon.com\/dynamics-gp-support\/#website\"},\"datePublished\":\"2014-07-10T05:43:04+00:00\",\"dateModified\":\"2018-01-11T22:41:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.terrcon.com\/dynamics-gp-support\/#\/schema\/person\/02c72c40ab08bc1e4ef8f30ff1e5504f\"},\"description\":\"For SQL or Dynamics GP Help call Terrapin Consulting @ 888.368.6670 - we're a top provider of Dynamics GP Support. We'll support you across USA & Canada.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.terrcon.com\/dynamics-gp-support\/#website\",\"url\":\"https:\/\/www.terrcon.com\/dynamics-gp-support\/\",\"name\":\"Dynamics GP Support Blog\",\"description\":\"Call 888-368-6670 for Great Plains Help\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.terrcon.com\/dynamics-gp-support\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.terrcon.com\/dynamics-gp-support\/#\/schema\/person\/02c72c40ab08bc1e4ef8f30ff1e5504f\",\"name\":\"Terrapin Consulting\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.terrcon.com\/dynamics-gp-support\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9bda9f99c132dcddf11f9040c1c0828174e109d12fac8808d2d9ba8636806d5e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9bda9f99c132dcddf11f9040c1c0828174e109d12fac8808d2d9ba8636806d5e?s=96&d=mm&r=g\",\"caption\":\"Terrapin Consulting\"},\"sameAs\":[\"http:\/\/www.terrcon.com\"],\"url\":\"https:\/\/www.terrcon.com\/dynamics-gp-support\/author\/Randy\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL log files fill hard drive: how to fix. Dynamics GP Support","description":"For SQL or Dynamics GP Help call Terrapin Consulting @ 888.368.6670 - we're a top provider of Dynamics GP Support. We'll support you across USA & Canada.","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:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/","og_locale":"en_US","og_type":"article","og_title":"SQL log files fill hard drive: how to fix. Dynamics GP Support","og_description":"For SQL or Dynamics GP Help call Terrapin Consulting @ 888.368.6670 - we're a top provider of Dynamics GP Support. We'll support you across USA & Canada.","og_url":"https:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/","og_site_name":"Dynamics GP Support Blog","article_published_time":"2014-07-10T05:43:04+00:00","article_modified_time":"2018-01-11T22:41:08+00:00","author":"Terrapin Consulting","twitter_misc":{"Written by":"Terrapin Consulting","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/","url":"https:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/","name":"SQL log files fill hard drive: how to fix. Dynamics GP Support","isPartOf":{"@id":"https:\/\/www.terrcon.com\/dynamics-gp-support\/#website"},"datePublished":"2014-07-10T05:43:04+00:00","dateModified":"2018-01-11T22:41:08+00:00","author":{"@id":"https:\/\/www.terrcon.com\/dynamics-gp-support\/#\/schema\/person\/02c72c40ab08bc1e4ef8f30ff1e5504f"},"description":"For SQL or Dynamics GP Help call Terrapin Consulting @ 888.368.6670 - we're a top provider of Dynamics GP Support. We'll support you across USA & Canada.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.terrcon.com\/dynamics-gp-support\/2014\/07\/sql-log-files-full-hard-drive\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.terrcon.com\/dynamics-gp-support\/#website","url":"https:\/\/www.terrcon.com\/dynamics-gp-support\/","name":"Dynamics GP Support Blog","description":"Call 888-368-6670 for Great Plains Help","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.terrcon.com\/dynamics-gp-support\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.terrcon.com\/dynamics-gp-support\/#\/schema\/person\/02c72c40ab08bc1e4ef8f30ff1e5504f","name":"Terrapin Consulting","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.terrcon.com\/dynamics-gp-support\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9bda9f99c132dcddf11f9040c1c0828174e109d12fac8808d2d9ba8636806d5e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9bda9f99c132dcddf11f9040c1c0828174e109d12fac8808d2d9ba8636806d5e?s=96&d=mm&r=g","caption":"Terrapin Consulting"},"sameAs":["http:\/\/www.terrcon.com"],"url":"https:\/\/www.terrcon.com\/dynamics-gp-support\/author\/Randy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.terrcon.com\/dynamics-gp-support\/wp-json\/wp\/v2\/posts\/411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.terrcon.com\/dynamics-gp-support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.terrcon.com\/dynamics-gp-support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.terrcon.com\/dynamics-gp-support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.terrcon.com\/dynamics-gp-support\/wp-json\/wp\/v2\/comments?post=411"}],"version-history":[{"count":35,"href":"https:\/\/www.terrcon.com\/dynamics-gp-support\/wp-json\/wp\/v2\/posts\/411\/revisions"}],"predecessor-version":[{"id":443,"href":"https:\/\/www.terrcon.com\/dynamics-gp-support\/wp-json\/wp\/v2\/posts\/411\/revisions\/443"}],"wp:attachment":[{"href":"https:\/\/www.terrcon.com\/dynamics-gp-support\/wp-json\/wp\/v2\/media?parent=411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.terrcon.com\/dynamics-gp-support\/wp-json\/wp\/v2\/categories?post=411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.terrcon.com\/dynamics-gp-support\/wp-json\/wp\/v2\/tags?post=411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}