To move the master database, follow these steps.
- From the Start menu, point to All Programs, point to Microsoft SQL Server, point to Configuration Tools, and then click SQL Server Configuration Manager.
- In the SQL Server Services node, right-click the instance of SQL Server (for example, SQL Server (MSSQLSERVER)) and choose Properties.
- In the SQL Server (instance_name) Properties dialog box, click the Startup Parameters tab.
- In the Existing parameters box, select the –d parameter to move the master data file. Click Update to save the change.
In the Specify a startup parameter box, change the parameter to the new path of the master database. - In the Existing parameters box, select the –l parameter to move the master log file. Click Update to save the change.
In the Specify a startup parameter box, change the parameter to the new path of the master database.The parameter value for the data file must follow the -d parameter and the value for the log file must follow the -l parameter. The following example shows the parameter values for the default location of the master data file.-dC:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\master.mdf-lC:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\mastlog.ldfIf the planned relocation for the master data file is E:\SQLData, the parameter values would be changed as follows:-dE:\SQLData\master.mdf-lE:\SQLData\mastlog.ldf - Stop the instance of SQL Server by right-clicking the instance name and choosing Stop.
- Move the master.mdf and mastlog.ldf files to the new location.
- Restart the instance of SQL Server.
- Verify the file change for the master database by running the following query.
SELECT name, physical_name AS CurrentLocation, state_desc FROM sys.master_files WHERE database_id = DB_ID('master'); GO
Source:
http://msdn.microsoft.com/en-us/library/ms345408.aspx
No comments:
Post a Comment