Solved

help- sql server service can' t be started

Posted on 2014-02-14
4
290 Views
Last Modified: 2014-02-17
I want to move all system dbs from C to E drive for testing. First I tried to move move model and msdb from c to e drive, I executed:
--Move Model Database
USE master;
GO
ALTER DATABASE model
MODIFY FILE (NAME = modeldev,FILENAME = 'E:\MSSQL\model.mdf');
GO
ALTER DATABASE model
MODIFY FILE (NAME = Modellog,FILENAME = 'E:\MSSQL\modelLog.ldf');
GO

--Move MSDB Database
USE master;
GO
ALTER DATABASE msdb
MODIFY FILE (NAME = MSDBData,FILENAME = 'E:\MSSQL\MSDBData.mdf');
GO
ALTER DATABASE msdb
MODIFY FILE (NAME = MSDBLog, FILENAME = 'E:\MSSQL\MSDBLog.ldf');
GO

And then I stoped SQL server service and copy msdb.* and model*.db from C:\program file\.. to E:\MSSQL.

Now I try to restart, it failed with following errors:
FCB::Open failed: Could not open file E:\MSSQL\model.mdf for file number 1.  OS error: 5(Access is denied.).
FCB::Open failed: Could not open file E:\MSSQL\modelLog.ldf for file number 2.  OS error: 5(Access is denied.).
A file activation error occurred. The physical file name 'E:\MSSQL\modelLog.ldf' may be incorrect. Diagnose and correct additional errors, and retry the operation.

Can you please help me to on this asap. Thanks very much.
0
Comment
Question by:shirleyz8821
  • 2
4 Comments
 
LVL 40
ID: 39860652
I find that the easiest way to move a database is to first Detach it from the server, move the files, reattach it to the server.

It can be done through SQL commands, but since it is only for testing purpose, the easiest way is probably through SQL Management Studio. Right click on a database, and Detach is found under Tasks.

To reattach, right Click on Databases and you will find the Attach option.
0
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 500 total points
ID: 39860784
>>  OS error: 5(Access is denied.). <<

It looks like the SQL service account for database services does not have authority to read that drive and folder.

Make sure to give the SQL service account has full authority to that folder.
0
 

Author Closing Comment

by:shirleyz8821
ID: 39865484
yes, it is permission issue. The account running as sql service has been removed from local admin group. readded it back and all good now. Thanks!
0
 
LVL 69

Expert Comment

by:ScottPletcher
ID: 39865512
You're welcome!

Sometimes the error message actually does contain useful info about what the error is :-) .
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now