{"id":1403,"date":"2015-07-01T15:38:29","date_gmt":"2015-07-01T12:38:29","guid":{"rendered":"http:\/\/www.fatihacar.com\/blog\/?p=1403"},"modified":"2015-07-01T15:45:52","modified_gmt":"2015-07-01T12:45:52","slug":"how-to-move-datafiles-to-new-disk-in-mssql-server-2008","status":"publish","type":"post","link":"https:\/\/www.fatihacar.com\/blog\/how-to-move-datafiles-to-new-disk-in-mssql-server-2008\/","title":{"rendered":"How to Move Datafiles to New Disk in MsSQL Server 2008"},"content":{"rendered":"<p>If database data disk space is full or you have another problem about of disk, you can move datafiles to new disk in MsSQL Server 2008 database.<\/p>\n<p><strong>Show Current Paths and Names<\/strong><\/p>\n<blockquote><p>use master<br \/>\ngo<br \/>\nselect name,physical_name from sys.master.files where database_id = DB_ID(&#8216;DATABASENAME&#8217;)<br \/>\ndbf1 D:\\OLDLOCATION\\disk_1.mdf<br \/>\ndbf1_log D:\\OLDLOCATION\\disk1_log.ldf<br \/>\ngo<\/p><\/blockquote>\n<p><strong>Shutdown Database<\/strong><\/p>\n<blockquote><p>\nuse master<br \/>\ngo<br \/>\nalter database DATABASENAME modify file(dbf1,filename=&#8217;E:\\NEWLOCATIOB\\disk_1.mdf&#8217;);<br \/>\ngo<br \/>\nalter database DATABASENAME modify file(dbf1_log,filename=&#8217;E:\\NEWLOCATIOB\\disk1_log.ldf&#8217;);\n<\/p><\/blockquote>\n<p><strong>Move Datafiles to New Disk<\/strong><br \/>\n<!--more--><\/p>\n<blockquote><p>Copy Paste datafiles to new location<\/p><\/blockquote>\n<p><strong>Open Database<\/strong><\/p>\n<blockquote><p>\nuse master<br \/>\ngo<br \/>\nalter database DATABASENAME set online<\/p><\/blockquote>\n<p>You can look database file locations with sql query or SQL Server Management Studio interface.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If database data disk space is full or you have another problem about of disk, you can move datafiles to new disk in MsSQL Server 2008 database. Show Current Paths and Names use master go select name,physical_name from sys.master.files where database_id = DB_ID(&#8216;DATABASENAME&#8217;) dbf1 D:\\OLDLOCATION\\disk_1.mdf dbf1_log D:\\OLDLOCATION\\disk1_log.ldf go Shutdown Database use master go alter database&#8230;<\/p>\n","protected":false},"author":37,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11],"tags":[14,96],"class_list":["post-1403","post","type-post","status-publish","format-standard","hentry","category-administration-mssql-server","tag-database-administration","tag-mssql-server"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p39NFI-mD","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/1403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/comments?post=1403"}],"version-history":[{"count":6,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/1403\/revisions"}],"predecessor-version":[{"id":1409,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/1403\/revisions\/1409"}],"wp:attachment":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/media?parent=1403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/categories?post=1403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/tags?post=1403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}