dbTalk Databases Forums  

Moving system databases in SQL 2005

microsoft.public.sqlserver.setup microsoft.public.sqlserver.setup


Discuss Moving system databases in SQL 2005 in the microsoft.public.sqlserver.setup forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
guv
 
Posts: n/a

Default Moving system databases in SQL 2005 - 03-22-2010 , 05:53 AM






I am using sql 2005 standard edition, and i want to move my system databases
from the C drive to a new E drive I have setup on my windows 2003 server. I
have first moved the tempdb database to the E drive by using the below
method:

1 using the following code:

Use master;
Go
Alter DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'E:\SQLData\tempdb.mdf' );
GO
ALter DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'E:\SQLLog\templog.ldf' );
GO

2. Then stopped and start the sql server
3 Verify the file change, by doing a select command from the
sys.master_files
4. Then delete the tempdb files from the original location.

This above method worked fine in moving the tempdb database, but I now want
to move the other system databases. I started with the model database. I
used the above the method, but when i stopped the sql server, I moved the
model databases files to the new location mentioned in the code, but when I
now start the sql service it does not start. The error message I get is :

The request failed or the service did not respond in a timely fashion. In
the event log the error reads Operating system error 2 (error not found)
occured while creating or opening file 'E:\sql\data\modellog.mdf'. Diagnose
and correct the operating system error and retry the operation.


Is there any reason why I would get this error message, I moved the model
files back but still it will not start.

But more importantly I need to know the best way to move the system
databases like model, master, msdb to a new location. I have checked some
microsoft articles but they dont seem to work.. Has anyone moved their
system databases on sql 2005 to a different location and worked. I should
just need a list of steps.
Can anyone advise on the error above and a list of steps in moving the
system databases.

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Moving system databases in SQL 2005 - 03-22-2010 , 04:04 PM






guv (guv@) writes:
Quote:
I am using sql 2005 standard edition, and i want to move my system
databases from the C drive to a new E drive I have setup on my windows
2003 server. I have first moved the tempdb database to the E drive by
using the below method:

1 using the following code:

Use master;
Go
Alter DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'E:\SQLData\tempdb.mdf' );
GO
ALter DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'E:\SQLLog\templog.ldf' );
GO
...
This above method worked fine in moving the tempdb database, but I now
want to move the other system databases. I started with the model
database. I used the above the method, but when i stopped the sql
server, I moved the model databases files to the new location mentioned
in the code, but when I now start the sql service it does not start. The
error message I get is :

The request failed or the service did not respond in a timely fashion. In
the event log the error reads Operating system error 2 (error not found)
occured while creating or opening file 'E:\sql\data\modellog.mdf'.
Error 2 is (NET HELPMSG 2)

The system cannot find the file specified.

I note that above you have E:\SQLData, the error message says
E:\SQL\Data.

Quote:
But more importantly I need to know the best way to move the system
databases like model, master, msdb to a new location. I have checked some
microsoft articles but they dont seem to work.. Has anyone moved their
system databases on sql 2005 to a different location and worked. I should
just need a list of steps.
Have you search in Books Online on "Moving system databases"? There is a
good topic for this.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #3  
Old   
guv
 
Posts: n/a

Default Re: Moving system databases in SQL 2005 - 03-22-2010 , 04:46 PM



Thanks for the books online, but are you aware of the steps on how to move,
as I followed some online articles before and they have not worked
"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> wrote

Quote:
guv (guv@) writes:
I am using sql 2005 standard edition, and i want to move my system
databases from the C drive to a new E drive I have setup on my windows
2003 server. I have first moved the tempdb database to the E drive by
using the below method:

1 using the following code:

Use master;
Go
Alter DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'E:\SQLData\tempdb.mdf' );
GO
ALter DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'E:\SQLLog\templog.ldf' );
GO
...
This above method worked fine in moving the tempdb database, but I now
want to move the other system databases. I started with the model
database. I used the above the method, but when i stopped the sql
server, I moved the model databases files to the new location mentioned
in the code, but when I now start the sql service it does not start. The
error message I get is :

The request failed or the service did not respond in a timely fashion.
In
the event log the error reads Operating system error 2 (error not found)
occured while creating or opening file 'E:\sql\data\modellog.mdf'.

Error 2 is (NET HELPMSG 2)

The system cannot find the file specified.

I note that above you have E:\SQLData, the error message says
E:\SQL\Data.

But more importantly I need to know the best way to move the system
databases like model, master, msdb to a new location. I have checked
some
microsoft articles but they dont seem to work.. Has anyone moved their
system databases on sql 2005 to a different location and worked. I
should
just need a list of steps.

Have you search in Books Online on "Moving system databases"? There is a
good topic for this.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #4  
Old   
Gail Erickson [MS]
 
Posts: n/a

Default Re: Moving system databases in SQL 2005 - 03-23-2010 , 11:15 AM



Quote:
Thanks for the books online, but are you aware of the steps on how to
move, as I followed some online articles before and they have not worked
The steps in the Books Online topic
(http://msdn.microsoft.com/en-us/libr...8(SQL.90).aspx ) are
correct. As Erland pointed out, the folder name that you specified in the
code and the folder name listed in the error message are different. That
is, you show E:\SQLData\... in your ALTER DATABASE statement for the
tempdb database but the error message indicates SQL Server expects to find
the model.mdf file in 'E:\sql\data\... You must have modified the ALTER
DATABASE statement

You should be able to resolve this by doing the following:
1. Create the folder E:\sql\data and move your model.mdf file there.
2. If you made the same mistake in the log file specification, you will also
need to create a E:\sql\log folder and put the model.log file there.
3. Start SQL Server service.
4. Assuming that E:\SQLData and E:\SQLLog are the folders that you actually
want to use, follow the instructions for "Planned Relocation and Scheduled
Disk Maintenance Procedure " in the BOL topic. These instructions will
work for all system databases in 2005 except the master and resource
databases. There are separate instructions for moving these databases in
the topic.

--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of SQL Server 2005 Books Online from
http://technet.microsoft.com/en-us/s.../bb428874.aspx
Download the latest version of SQL Server 2008 Books Online from
http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
"guv" <guv@> wrote

Quote:
Thanks for the books online, but are you aware of the steps on how to
move, as I followed some online articles before and they have not worked
"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> wrote in message
news:Xns9D43EABE6EBC7Yazorman (AT) 127 (DOT) 0.0.1...
guv (guv@) writes:
I am using sql 2005 standard edition, and i want to move my system
databases from the C drive to a new E drive I have setup on my windows
2003 server. I have first moved the tempdb database to the E drive by
using the below method:

1 using the following code:

Use master;
Go
Alter DATABASE tempdb
MODIFY FILE (NAME = tempdev, FILENAME = 'E:\SQLData\tempdb.mdf' );
GO
ALter DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'E:\SQLLog\templog.ldf' );
GO
...
This above method worked fine in moving the tempdb database, but I now
want to move the other system databases. I started with the model
database. I used the above the method, but when i stopped the sql
server, I moved the model databases files to the new location mentioned
in the code, but when I now start the sql service it does not start. The
error message I get is :

The request failed or the service did not respond in a timely fashion.
In
the event log the error reads Operating system error 2 (error not found)
occured while creating or opening file 'E:\sql\data\modellog.mdf'.

Error 2 is (NET HELPMSG 2)

The system cannot find the file specified.

I note that above you have E:\SQLData, the error message says
E:\SQL\Data.

But more importantly I need to know the best way to move the system
databases like model, master, msdb to a new location. I have checked
some
microsoft articles but they dont seem to work.. Has anyone moved their
system databases on sql 2005 to a different location and worked. I
should
just need a list of steps.

Have you search in Books Online on "Moving system databases"? There is a
good topic for this.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:
http://www.microsoft.com/sql/prodinf...ons/books.mspx



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.