{"id":17670,"date":"2023-05-23T13:06:23","date_gmt":"2023-05-23T07:36:23","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=17670"},"modified":"2023-06-01T17:58:27","modified_gmt":"2023-06-01T12:28:27","slug":"how-to-reduce-shrink-the-sql-file-size","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/","title":{"rendered":"How to Reduce\/Shrink the SQL File Size?"},"content":{"rendered":"\n<p>Reducing or shrinking the size of an SQL file is beneficial for different reasons. It helps to optimize the storage space, improve the performance. SQL files, over the time, can grow large in size due to higher amounts of data storage, indexes and other elements.<\/p>\n\n\n\n<p>When you\u2019re using the SQL server with iBase, 2 SQL databases are created, one is for the data and the other is for the Logs. SQL server then creates a Log file for every database. This log file is an internal SQL server file, and does not impact the iBase.<\/p>\n\n\n\n<p>However, at some times, the size of the log file grows immensely and it starts blocking the SQL server.<\/p>\n\n\n\n<p>In this article, we will discuss how to reduce\/shrink the SQL file size.<\/p>\n\n\n\n<p>iBase might take longer to respond, or you receive an error message saying that there is no more free space on the disk.<\/p>\n\n\n\n<p>This happens, due to the below reasons:<\/p>\n\n\n\n<p>By default, when SQL creates a database, it does not create a Log file for this database.<\/p>\n\n\n\n<p>One option of this database is the Recovery Mode, which gets full.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Environment <\/h2>\n\n\n\n<p>SQL Server Storage<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Diagnose the Issue?<\/h2>\n\n\n\n<p>In Windows, click on the folder where the database files are stored. Then, search for the files with an LDF extension, and then check the size of the files.<\/p>\n\n\n\n<p>If files are large in size, you might want to reduce or shrink them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Reduce\/Shrink the SQL File Size:<\/h2>\n\n\n\n<p>In order to shrink the Transaction log in the SQL Server Management Studio.<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\" start=\"1\">\n<li>First, right-click on the database, and then, choose Properties, then Options.<\/li>\n\n\n\n<li>Ensure that the \u201cRecovery mode\u201d is set to \u201cSimple\u201d, not \u201cFull\u201d, and then click on OK.<\/li>\n\n\n\n<li>Right-click on the database again, choose Tasks &gt; Shrink Files.<\/li>\n\n\n\n<li>Now, change the file type to \u201cLog.\u201d<\/li>\n\n\n\n<li>Set the log File size to 100 MB and then click OK.<\/li>\n<\/ol>\n\n\n\n<p>Once you have performed these steps, check in the folder if the size has been reduced.<\/p>\n\n\n\n<p>Alternatively, for SQL to do it successfully:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SQL queries:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><em><strong>ALTER DATABASE mydatabase SET RECOVERY SIMPLE\nDBCC SHRINKFILE (mydatabase_Log, 1)<\/strong><\/em><\/pre>\n\n\n\n<p><strong>Warning:<\/strong> In the first sql script, its the main database, and in the 2nd script, its the Log database.&nbsp;<\/p>\n\n\n\n<p>Once you have completed the steps, check the folder that has been reduced.&nbsp;<\/p>\n\n\n\n<p><strong>Note: <\/strong>Revert the changes of &#8220;Recovery mode&#8221; from Simple to Full once log file shrink is done.&nbsp;<\/p>\n\n\n\n<p>Hope you have found this article helpful!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reducing or shrinking the size of an SQL file is beneficial for different reasons. It helps to optimize the storage space, improve the performance. SQL files, over the time, can grow large in size due to higher amounts of data storage, indexes and other elements. When you\u2019re using the SQL server with iBase, 2 SQL [&hellip;]<\/p>\n","protected":false},"author":36,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[230],"tags":[999,3003],"class_list":["post-17670","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-database","tag-sql","tag-sql-file-size"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Reduce\/Shrink the SQL File Size?<\/title>\n<meta name=\"description\" content=\"Many times the SQL file size increases, thus it\u2019s necessary to reduce it. In this article, we will understand the steps to reduce\/shrink the SQL file size.\" \/>\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.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Reduce\/Shrink the SQL File Size?\" \/>\n<meta property=\"og:description\" content=\"Many times the SQL file size increases, thus it\u2019s necessary to reduce it. In this article, we will understand the steps to reduce\/shrink the SQL file size.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-23T07:36:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-01T12:28:27+00:00\" \/>\n<meta name=\"author\" content=\"Nehal Khatri\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nehal Khatri\" \/>\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\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/\"},\"author\":{\"name\":\"Nehal Khatri\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/93565765cf85bc4be78b4d9ccbe294bb\"},\"headline\":\"How to Reduce\/Shrink the SQL File Size?\",\"datePublished\":\"2023-05-23T07:36:23+00:00\",\"dateModified\":\"2023-06-01T12:28:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/\"},\"wordCount\":407,\"commentCount\":0,\"keywords\":[\"sql\",\"SQL File Size\"],\"articleSection\":[\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/\",\"name\":\"How to Reduce\/Shrink the SQL File Size?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2023-05-23T07:36:23+00:00\",\"dateModified\":\"2023-06-01T12:28:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/93565765cf85bc4be78b4d9ccbe294bb\"},\"description\":\"Many times the SQL file size increases, thus it\u2019s necessary to reduce it. In this article, we will understand the steps to reduce\/shrink the SQL file size.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Reduce\/Shrink the SQL File Size?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/93565765cf85bc4be78b4d9ccbe294bb\",\"name\":\"Nehal Khatri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2022\/02\/nehal-khatri-150x150.png\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2022\/02\/nehal-khatri-150x150.png\",\"caption\":\"Nehal Khatri\"},\"description\":\"Nehal is an ardent content writer. She's passionate about crafting content that's simple but adds value. Her insatiable interest in writing has allowed her to explore her skills. She is adept and can write for different types of content formats.\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/nehal-khatri\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Reduce\/Shrink the SQL File Size?","description":"Many times the SQL file size increases, thus it\u2019s necessary to reduce it. In this article, we will understand the steps to reduce\/shrink the SQL file size.","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.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/","og_locale":"en_US","og_type":"article","og_title":"How to Reduce\/Shrink the SQL File Size?","og_description":"Many times the SQL file size increases, thus it\u2019s necessary to reduce it. In this article, we will understand the steps to reduce\/shrink the SQL file size.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2023-05-23T07:36:23+00:00","article_modified_time":"2023-06-01T12:28:27+00:00","author":"Nehal Khatri","twitter_misc":{"Written by":"Nehal Khatri","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/"},"author":{"name":"Nehal Khatri","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/93565765cf85bc4be78b4d9ccbe294bb"},"headline":"How to Reduce\/Shrink the SQL File Size?","datePublished":"2023-05-23T07:36:23+00:00","dateModified":"2023-06-01T12:28:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/"},"wordCount":407,"commentCount":0,"keywords":["sql","SQL File Size"],"articleSection":["Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/","name":"How to Reduce\/Shrink the SQL File Size?","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2023-05-23T07:36:23+00:00","dateModified":"2023-06-01T12:28:27+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/93565765cf85bc4be78b4d9ccbe294bb"},"description":"Many times the SQL file size increases, thus it\u2019s necessary to reduce it. In this article, we will understand the steps to reduce\/shrink the SQL file size.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-reduce-shrink-the-sql-file-size\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to Reduce\/Shrink the SQL File Size?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/93565765cf85bc4be78b4d9ccbe294bb","name":"Nehal Khatri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2022\/02\/nehal-khatri-150x150.png","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2022\/02\/nehal-khatri-150x150.png","caption":"Nehal Khatri"},"description":"Nehal is an ardent content writer. She's passionate about crafting content that's simple but adds value. Her insatiable interest in writing has allowed her to explore her skills. She is adept and can write for different types of content formats.","url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/nehal-khatri\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/17670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=17670"}],"version-history":[{"count":5,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/17670\/revisions"}],"predecessor-version":[{"id":17690,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/17670\/revisions\/17690"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=17670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=17670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=17670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}