{"id":6279,"date":"2019-03-07T14:35:11","date_gmt":"2019-03-07T14:35:11","guid":{"rendered":"https:\/\/ittutorial.org\/?p=6279"},"modified":"2019-11-28T07:05:52","modified_gmt":"2019-11-28T07:05:52","slug":"sql-server-change-tempdb-file-location","status":"publish","type":"post","link":"https:\/\/ittutorial.org\/sql-server-change-tempdb-file-location\/","title":{"rendered":"SQL Server Change TempDB File Location"},"content":{"rendered":"<p>Hi,<\/p>\n<p>TempDB is one of the most important system databases of SQL Server.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6280\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/03\/tempdb-uneven.gif\" alt=\"\" width=\"1226\" height=\"769\" \/><\/p>\n<p><!--more--><\/p>\n\n<p>There are many database operations in TempDB like\u00a0GROUP BY, ORDER BY, UNION, online re-indexing, multiple active record sets, user-created temporary objects, internal temporary objects and version stores.<\/p>\n<p>&nbsp;<\/p>\n<p>So if the tempdb is located on slow disk like sas or sata, these operations will be very slow.<\/p>\n<p>If TempDB is located on fast disk like SSD or Flash, you will see extra SQL Server Performance.<\/p>\n<p>You can change TempDB file location like following query.<\/p>\n<p>&nbsp;<\/p>\n<pre>USE master\r\nGO\r\nALTER DATABASE tempdb \r\nMODIFY FILE (NAME = tempdev, FILENAME = 'E:\\TEMP\\tempdb.mdf')\r\nGO\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4><span style=\"color: #ff0000;\">Do you want to learn Microsoft SQL Server DBA Tutorials for Beginners, then read the following articles.<\/span><\/h4>\n<p><a href=\"https:\/\/ittutorial.org\/sql-server-tutorials-microsoft-database-for-beginners\/\">https:\/\/ittutorial.org\/sql-server-tutorials-microsoft-database-for-beginners\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, TempDB is one of the most important system databases of SQL Server.<\/p>\n","protected":false},"author":1,"featured_media":6280,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2227],"tags":[1028,1031,1600,1610,2231,2264,2263,2276,2275,2232,2273,2279,2280,2278,2237,2236,2267,2270,2269,2277,2230,2229,2274,2265,2266],"class_list":["post-6279","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-sql-server-2","tag-mehmet-deveci","tag-mehmet-salih-deveci","tag-sql-server-2012","tag-sql-server-2014","tag-sql-server-2019","tag-sql-server-active-sessions","tag-sql-server-active-sessions-and-status","tag-sql-server-change-tempdb-file-location","tag-sql-server-database-wait-events","tag-sql-server-inventory-script","tag-sql-server-optimizer","tag-sql-server-performance-problem","tag-sql-server-performance-problem-tempdn","tag-sql-server-performance-tempdb","tag-sql-server-select-inventory","tag-sql-server-select-machine-name","tag-sql-server-sessions","tag-sql-server-statistics","tag-sql-server-stats","tag-sql-server-tempdb","tag-sql-server-useful-query","tag-sql-server-useful-script","tag-sql-server-wait-events","tag-sql-server-whoisactive","tag-whoisactive"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/03\/tempdb-uneven.gif","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/6279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/comments?post=6279"}],"version-history":[{"count":2,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/6279\/revisions"}],"predecessor-version":[{"id":12971,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/6279\/revisions\/12971"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media\/6280"}],"wp:attachment":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media?parent=6279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/categories?post=6279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/tags?post=6279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}