SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Moving MSDB database
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

winman
Starting Member

26 Posts

Posted - 04/06/2013 :  05:45:06  Show Profile  Reply with Quote
When i am trying to shift msdb database from it's default path(C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA) to another drive(E:\). After shifting the database i am getting error as shown below.(the error i am getting while expanding database node in SSMS an d now i am not able to access any database.)

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Database 'msdb' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details. (Microsoft SQL Server, Error: 945)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.2531&EvtSrc=MSSQLServer&EvtID=945&LinkId=20476

------------------------------


The procedure i followed to shift msdb database is as follows:

1. For each file to be moved, run the following statement.

ALTER DATABASE msdb
MODIFY FILE ( NAME = MSDBData , FILENAME = 'E:\' )
ALTER DATABASE msdb
MODIFY FILE ( NAME = MSDBLog , FILENAME = 'E:\' )

2. Stop the instance of SQL Server to perform maintenance.
3. Move the file or files to the new location.
4. Restart the instance of SQL Server or the server.
Also i did confirm the path by running following query

SELECT name, physical_name AS CurrentLocation, state_desc

FROM sys.master_files

WHERE database_id = DB_ID(N'msdb');

And output was showing current location of both MSDBdata and MSDBLog as E:

This error happened while i did it for testing server. I want to do it for a production server. So please help me on this error. How exactly to shift msdb database?

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 04/06/2013 :  21:45:33  Show Profile  Visit russell's Homepage  Reply with Quote
try this (assuming you put the files in the root of the E: drive) then restart the SQL Server service.

ALTER DATABASE msdb
MODIFY FILE ( NAME = MSDBData , FILENAME = 'E:\MSDBData.mdf' );

ALTER DATABASE msdb
MODIFY FILE ( NAME = MSDBLog , FILENAME = 'E:\MSDBLog.ldf' );
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000