- When the drive is full and you are in a situation where you cannot extend that drive.
- Move tempdb to a separate drive to increase its performance.
This is a simple process and cannot be done by detaching and attaching the database, as we cannot attach or detach a system database.
Also we need to restart the SQL services.
Here is the process how we can move the tempdb to a new location.
Also we need to restart the SQL services.
Here is the process how we can move the tempdb to a new location.
- First get the list of tempdb files by using this query
- Then for each tempdb file that you need to move, execute statements like below
- Stop SQL Services
- Start SQL Services
- Verify the new Location
select name,physical_name from sys.master_files where DB_NAME(database_id)='tempdb'
select name,physical_name from sys.master_files where DB_NAME(database_id)='tempdb'
Alter Database tempdb modify file (NAME = 'tempdev' ,FILENAME = 'Drive:\Path\tempdb.mdf') -- Mention the new locationAlter Database tempdb modify file (NAME = 'templog' , FILENAME = 'Drive:\Path\templog.ldf') -- Mention the new location
3 comments:
This applies ONLY to TempDB
Correct and the same has alredy been mentioned in the title and the post.
Mua vé tại Aivivu, tham khảo
giá vé máy bay đi Mỹ khứ hồi
đặt vé máy bay giá rẻ từ mỹ về việt nam
vé máy bay giá rẻ nhật việt
vé máy bay từ đức về việt nam giá rẻ
vé máy bay từ canada về việt nam giá rẻ
giá vé máy bay hàn quốc về việt nam
chuyen bay chuyen gia ve viet nam
Post a Comment