Table of Contents
The sections below explain move the tempdb and master databases on SQL server in a clear and practical way. Review the key details, examples, and considerations before applying the information.
Due to various reasons, moving the database and recording files to another hard drive to increase performance is essential.When you want to move a typical user database to another drive to increase performance or to split logs, you can run Sp_detach And Sp_attach To perform the migration.However, for moving the Master and Tempdb databases, you must apply other rules.In this article, let's take a look at the steps of moving these databases. Move the Master database Have you ever had to move the master database file to another drive? If you have never performed this function, follow these guidelines to successfully migrate the master database. First, right-click SQL Server on Enterprise Manager (EM) and select Properties . Then click Startup Parameters As shown in Figure A, we will see the following parameters:
-
-d is the full path of the master database data file.
-
-e is the full path of the error log file.
-
-l is the full path of the master database record
How Move the Tempdb and Master Databases on SQL Server Works
Picture A
Now when needed to move the files, you will have to remove the current entry and recreate a new entry with the correct path. For example, you will move the Master database table to (C: Test). You will delete -l [path] By selecting the old parameter and selecting remove (Figure B). The next step is to add the following entry (Figure C), -l (c: Testmastlog. ldf) And click OK Twice. Then stop SQL Server and move the mastlog. ldf to the new location.
Figure B
Note : Make sure the mastlog. ldf is moved to the location you configured at the boot parameters. If you move the file to an unknown location on the boot parameters, SQL Server will not be activated.
Figure C
If you successfully move the Master database, when you start SQL Server, you will see the following screen:
Figure D
Move Tempdb To move the tempdb database, open the query analysis tool and run the following query:
Use master go Alter database tempdb modify file (name = tempdev, filename = 'E: Sqldata empdb. mdf') go Alter database tempdb modify file (name = templog, filename = 'E: Sqldata emplog. ldf') Go
Depends on where you move Tempdb which specifies the file name = parameter. You will move the templog to (c: est) as shown in Figure E. After running the query, delete the old file immediately after starting SQL Server.
Figure E
Move MSDB database To move the MSDB and Model databases, follow these steps. First, right-click the name of SQL-Server and click Properties . From the General tab, select the boot parameters. Next, enter the parameter -T3608 . Click OK , stop and restart SQL Server. After restarting, remove the database and move them to the appropriate locations. Hard disk space is getting more crowded and you need to transfer system database files to another drive, following the above procedures will help you transfer data efficiently and reliably.
FAQ
What is the main benefit of move the tempdb and master databases on SQL server?
The main benefit is a clearer understanding of the topic and a practical way to apply the information covered in this guide.
What should I check before using move the tempdb and master databases on SQL server?
Confirm compatibility, review the required settings, protect important data, and use the latest supported version whenever possible.
What should I do if the result is different?
Repeat the steps carefully, verify permissions and version differences, and consult the product's official support documentation for changes not shown in the article.
Reader Comments 0
Sign in with email or Google to join the discussion.