{"id":351,"date":"2016-02-06T11:55:45","date_gmt":"2016-02-06T18:55:45","guid":{"rendered":"http:\/\/s1095387061.online-home.ca\/?p=351"},"modified":"2016-09-10T12:41:14","modified_gmt":"2016-09-10T18:41:14","slug":"shrink-database-files-and-dbcc-checkdb","status":"publish","type":"post","link":"https:\/\/databaserefresh.com\/blog\/shrink-database-files-and-dbcc-checkdb\/","title":{"rendered":"Shrink database files and DBCC CheckDB"},"content":{"rendered":"<p>Shrinking database files is never a good idea. Read this article about alternative method on removing free space from the files: <a href=\"http:\/\/www.sqlskills.com\/blogs\/paul\/why-you-should-not-shrink-your-data-files\/\" target=\"_blank\">http:\/\/www.sqlskills.com\/blogs\/paul\/why-you-should-not-shrink-your-data-files\/<\/a>.<\/p>\n<p>In rare occasion when you decide to do this make sure you run DBCC CHECKDB after shrinking the file. You may encounter allocation errors:<\/p>\n<p><i>CHECKDB found 1 allocation errors and 0 consistency errors in database&#8230;<\/i><\/p>\n<p>Some of these errors could be fixed by running table or index rebuild command:<\/p>\n<p><em><span style=\"color: blue;\">ALTER TABLE dbo.Test_1 REBUILD;<\/span><\/em><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shrinking database files is never a good idea. Read this article about alternative method on removing free space from the files: http:\/\/www.sqlskills.com\/blogs\/paul\/why-you-should-not-shrink-your-data-files\/. In rare occasion when you decide to do this make sure you run DBCC CHECKDB after shrinking the &hellip; <a href=\"https:\/\/databaserefresh.com\/blog\/shrink-database-files-and-dbcc-checkdb\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[7,3],"tags":[112,114,113,16],"class_list":["post-351","post","type-post","status-publish","format-standard","hentry","category-sql_maint","category-sql_server","tag-dbcc-checkdb","tag-rebuild","tag-shrink","tag-sql-server"],"_links":{"self":[{"href":"https:\/\/databaserefresh.com\/blog\/wp-json\/wp\/v2\/posts\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/databaserefresh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/databaserefresh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/databaserefresh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/databaserefresh.com\/blog\/wp-json\/wp\/v2\/comments?post=351"}],"version-history":[{"count":4,"href":"https:\/\/databaserefresh.com\/blog\/wp-json\/wp\/v2\/posts\/351\/revisions"}],"predecessor-version":[{"id":355,"href":"https:\/\/databaserefresh.com\/blog\/wp-json\/wp\/v2\/posts\/351\/revisions\/355"}],"wp:attachment":[{"href":"https:\/\/databaserefresh.com\/blog\/wp-json\/wp\/v2\/media?parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/databaserefresh.com\/blog\/wp-json\/wp\/v2\/categories?post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/databaserefresh.com\/blog\/wp-json\/wp\/v2\/tags?post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}