To change the method of tempdb location in a SQL Server 2005 database _mssql2005

Source: Internet
Author: User

Friends who understand SQL Server 2005 databases may know that the tempdb system database is a global resource that can be used by all users connected to instances of SQL Server 2005. We sometimes change the location of the tempdb database to make it easy to operate, so how do we do that? In this article we will describe the process of this change.

Get the original location of tempdb:

SELECT [Name],[physical_name] from 
 
sys.master_files  
 

To change the tempdb database location:

1. Copy the original tempdb.mdf and templog.ldf files to the target location, and then execute the following statement:

Use master 
 
go 
 
ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = ' F:\tempdb\tempdb.mdf ') 
 
go 
 
AL TER DATABASE tempdb MODIFY FILE (NAME = templog, FILENAME = ' F:\tempdb\templog.ldf ') 
 

2, restart the SQL Server service. The location of the tempdb database was changed successfully.

Knowledge about the tempdb database for SQL Server 2005 databases here, I hope to bring you a harvest!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.