转:Move all SQL Server system databases at one time
Problem
One task that you may need to do as a DBA is to move the system databases from one location to another. The documentation that is found on the Microsoft site is helpful, but the steps are more geared toward moving one database at a time. In this tip we look at a streamlined process of moving all system databases at the same time.
Solution
There are few Microsoft KB articles that show you step by step on how to move the SQL Server system databases from one location to another location. The steps for moving SQL Server 2000 system databases is much more convoluted than moving SQL Server 2005, 2008 or 2008R2 databases.
The following KB articles show you step by step how to move the system databases, but the process does not need to be as long as the details show.
- How to move SQL Server databases to a new location by using Detach and Attach functions in SQL Server
- Moving System Databases
Moving all SQL Server 2005, SQL Server 2008 or SQL Server 2008R2 System Databases
Once you have reviewed the KB articles above, you can follow these steps to move all system databases at once.
- Update the -d and -l startup parameters for SQL Server for the new location of the master data and log file
- Issue ALTER DATABASE commands to change the file location for the model, msdb and tempdb database files
- Stop SQL Server
- Move the MDF and LDF files to the new locations specified in steps 1 and 2 for the master, model and msdb databases
- Start SQL Server
- Delete the old tempdb files
In addition to the master, model, msdb and tempdb databases SQL Server 2005 introduces the mssqlsystemresourcedatabase. Microsoft recommends not moving this database, but if you do want to move this database as well you will follow these steps. Note you cannot move the mssqlsystemresource database for SQL Server 2008 or SQL Server 2008R2.
- Update the -d and -l registry startup parameters for SQL Server for the new location of the master data and log file
- Issue ALTER DATABASE commands to change the file location for the model, msdb and tempdb database files
- Stop SQL Server
- Move the MDF and LDF files to the new locations specified in steps 1 and 2 for the master, model and msdb databases
- Put SQL Server in minimal configuration mode by adding these two startup parameters -f and -T3608 and then start SQL Server
- Issue ALTER DATABASE commands for the mssqlsystemresource MDF and LDF files using same path as the master database
- Move the MDF and LDF files to the location specified in step 6 for the mssqlsystemresource database
- Stop SQL Server
- Remove the startup options added in step 5
- Start SQL Server
- Delete the old tempdb files
Moving all SQL Server 2000 System Databases
Once you have reviewed the KB articles above, you can follow these steps to move all system databases at once.
- Update the -d and -l startup parameters for SQL Server for the new location of the master data and log file
- Issue ALTER DATABASE commands to change the file location for the tempdb database files
- Stop SQL Server
- Move the MDF and LDF files to the new location specified in steps 1 for the master database
- Put SQL Server in single user mode by adding these three startup parameters -c, -m and -T3608 and then start SQL Server
- Detach the msdb and model databases
- Move the MDF and LDF files to the new location for the model and msdb databases
- Attach the model database from its new location
- Stop SQL Server
- Remove the startup options added in step 5
- Start SQL Server
- Attach the msdb database
- Delete the old tempdb files
Although it still seems like a lot of steps this will cut down on the need to stop and start SQL Server as much if you move one database at a time. As you can see moving all of the databases for SQL Server 2005, 2008 and 2008R2 is much easier than moving the databases for SQL Server 2000 especially if you do not move the mssqlsystemresource database.
Next Steps
- Before you move your system databases, make sure you understand the steps as outlined in these documents.
- Even though one of these documents shows how to move the SQL Server 2005 model and msdb databases by using detach and attach the ALTER DATABASE option is much simpler
转:Move all SQL Server system databases at one time的更多相关文章
- The Windows account sa does not exist and cannot be provisioned as a SQL Server system administrator
今天遇到一个案例,在使用命令修改一个测试服务器(SQL Server 2014标准版)的服务器排序规则时,遇到了下面错误信息 (具体账号信息脱敏处理,随机生成一个账号密码) The Windows a ...
- Exam 70-462 Administering Microsoft SQL Server 2012 Databases 复习帖
好吧最近堕落没怎么看书,估计这个月前是考不过了,还是拖到国庆之后考试吧.想着自己复习考试顺便也写点自己的复习的概要,这样一方面的给不准备背题库的童鞋有简便的复习方法(好吧不被题库的同学和我一样看MSD ...
- SQL Server System.Data.SqlClient.SqlException:已成功于服务器建立连接,但是在 登录前的握手期间发生错误
一.错误描述 错误名称如上.整体错误如下: System.Data.EntityException 基础提供程序在Open上失败--> System.Data.SqlClient.SqlExce ...
- System Databases in SQL Server
https://docs.microsoft.com/en-us/sql/relational-databases/databases/system-databases SQL Server incl ...
- P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1
P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1 May ...
- SQL Server 2012 无人值守安装(加入新实例)
方法1,通过指定条个參数安装 setup.exe /Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /PID=<validpid> /FEA ...
- Migrating Oracle on UNIX to SQL Server on Windows
Appendices Published: April 27, 2005 On This Page Appendix A: SQL Server for Oracle Professionals Ap ...
- Microsoft SQL Server Version List [sqlserver 7.0-------sql server 2016]
http://sqlserverbuilds.blogspot.jp/ What version of SQL Server do I have? This unofficial build ch ...
- Microsoft SQL Server Version List(SQL Server 版本)
原帖地址 What version of SQL Server do I have? This unofficial build chart lists all of the known Servic ...
随机推荐
- Android实现SQLite数据库联系人列表
Android实现SQLite数据库联系人列表 开发工具:Andorid Studio 1.3 运行环境:Android 4.4 KitKat 工程内容 实现一个通讯录查看程序: 要求使用SQLite ...
- color the python console text
//install termcolor module cd \ cd python27 cd scripts pip install termcolor pip install colorama // ...
- Ionic 2 Guide
Ionic 2 Guide 最近一直没更新博客,业余时间都在翻译Ionic2的文档.之前本来是想写一个入门,后来觉得干脆把官方文档翻译一下算了,因为官方文档就是最好的入门教程.后来越翻译越觉得这个事情 ...
- 揭开NodeJS的神秘面纱!
一.NodeJS是什么? Node是一个服务器端JavaScript解释器.Node.js是一套用来编写高性能网络服务器的JavaScript包. 二.Node的目标是什么? Node 公开宣称的目标 ...
- 新装Centos常见问题及解决方案
1.可以ping通,但无法通过ssh连接虚拟机的解决方案 虚拟机上装了一个 Linux 玩玩, 但在启动 Linux 后,在 Windows 中通过 Xshell 以 SSH 方式连接到 Linux ...
- C#基础——三元表达式
采用三元操作符对?:对表达式进行运算,这种操作符比较特别,因为它有三个操作对象,但它确实属于操作符的一种,它最终也会生成一个值.其表达式采取下述形式: boolean-exp ? value0 : v ...
- Hibernate内存溢出分析一例
公司业务系统在进行压力测试时,压测24小时后系统发生内存溢出.经过分析读dump文件,发现org.hibernate.stat.StatisticsImpl类的hashmap类型的变量存储了大量数据( ...
- 前端之JavaScript第三天学习(8)-JavaScript-对象
JavaScript 中的所有事物都是对象:字符串.数字.数组.日期,等等. 在 JavaScript 中,对象是拥有属性和方法的数据. 属性和方法 属性是与对象相关的值. 方法是能够在对象上执行的动 ...
- Window.document对象(2)
四.操作样式 首先利用元素的ID找到该元素,存于一个变量中: var a = document.getElementById("id"): 然后可以对该元素的属性进行操作: a.s ...
- CSRF(跨站请求伪造)攻击方式
一.CSRF是什么? CSRF(Cross-site request forgery),中文名称:跨站请求伪造,也被称为:one click attack/session riding,缩写为:CSR ...