转: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 ...
随机推荐
- 微软职位内部推荐-SDEII
微软近期Open的职位: Software Engineer II for Customer Experience (Level 62+) Location: Suzhou Contact Perso ...
- git创建分支并提交项目
git 创建分支, 切换分支, 合并分支, 删除分支及提交[commit提交到本地仓库push名利提交到远程服务器], 检出[pull], 冲突修改, 本地仓库同步远程服务器[pul和push命令l] ...
- RHEL6.4找回root密码的方法
1.先在系统启动的时候提示:press any key to enter menu 时按下e键(其实其他键也可以,只不过我习惯e键而已) 2.进入如下界面: 3.按上下箭头方向键选中第二项,按e键,进 ...
- ORA-12154:TNS:无法解析指定的连接标识符
ORA-12154:TNS:无法解析指定的连接标识符 1问题的描述 Oracle11g server 64bit服务器端安装在Windows Server2008 Enterprise上,安装Orac ...
- 20145120 《Java程序设计》实验四实验报告
20145120 <Java程序设计>实验四实验报告 实验名称:Android开发基础 实验目的与要求: 用SDK成功编译出HelloWorld 实验内容.步骤 PSP 步骤 耗时 百分比 ...
- 学习笔记--HashMap浅析
HashMap 实现了Map 接口,其底层以一个线性数组保存哈希表,所以它既有数组查询的高效,也有哈希存取的方便. HashMap提供了默认构造器,和有参构造器,在有参构造器中,提供了两个参数,可以对 ...
- C#日志编写
在一个完整的信息系统里面,日志系统是一个非常重要的功能组成部分.它可以记录下系统所产生的所有行为,并按照某种规范表达出来.我们可以使用日志系统所记录的信息为系统进行排错,优化系统的性能,或者根据这些信 ...
- 学习Linux第七天
1.shell echo $HOME 默认在shell中编写的变量全部是局部变量,如果重新打开console的话,那么这些变量将全部丢失,全局的变量可以写在文件~/.bashrc文件. 2.判断 !/ ...
- 1.项目开发-->Memcached之ASP.NET实现
1.Memcached安装 第一步:下载windows稳定版Memcached 1.2.1 win32,解压后,将memcached.exe文件放到自己想存放的盘符内,例如C:\Windows\Sys ...
- WWDC2014 debugging_in_xcode_6 总结
1.GCD的waiting queue 可以在Xcode左侧的面板中查看. 2.可以对View进行debug类似reveal. 3.查看运行时的对象,对于自定义对象可以实现- (id)debugQui ...