Move the Tempdb and Master databases on SQL Server
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 on 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
Picture A
Now if you want 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 on 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.
You should read it
- How to use Clean Master to clean up, speed up Windows
- How to recover the database in MS SQL Server
- How to Open an Sql File
- How to restore Master Boot Record in Windows 10
- How to use the Clipboard Master to save files and documents to the Clipboard
- What is the Master Partition Table?
- Use the ALTER DATABASE command to migrate DATABASE in SQL Server
- Link to download Typing Master 10.1.1.849
May be interested
- How to use Clean Master to clean up, speed up Windowsclean master has a version on windows pc with features to clean up the system, speed up the computer similar to ccleaner.
- What is the Master Partition Table?the master partition table is a component of the master boot record / sector that describes the partitions on the hard drive, such as their type and size, and comes with the disk signature and the master boot code to create the master boot record.
- Instructions for installing SQL Server 2017 step by stepsql server 2017 comes with new features in the installation process. it now supports the machine learning service for r and python. it also includes ssis scale out master and scale out worker.
- Test SQL Server with Windows PowerShell - Part 6part 6 will show you how to check all existing databases in the sql server instance and query the database properties.
- Link to download Typing Master 10.1.1.849typing master is an easy-to-use tool that allows you to improve your typing accuracy and speed. if you're not good at typing, converting ideas into words on the screen can be a challenge.
- Use the ALTER DATABASE command to migrate DATABASE in SQL Servertechnically, you can use the alter database syntax to move any system or user database files that define, initialize, except for the resource database.
- EASEUS Partition Master - Download the latest EASEUS Partition Masterdisk partitioning and copying can be a complicated task, especially if you are not computer savvy. easeus partition master is an easy to use disk partitioning tool for pc.
- What is the Master Boot Code?the master boot code (sometimes abbreviated as mbc) is one of the components of the master boot record. it implements the first important function set during boot.
- How to install and configure MySQL server on Pidatabases like mysql are often the primary component of dynamic web pages and one of the best ways to store data for web applications. mysql is a database management system that allows you to store and maintain large amounts of data with ease.
- How to Set Up a Microsoft SQL Server Database in Docker on Linuxtraditionally, sql server databases were set up on dedicated servers or virtual machines, but docker has changed all that.