[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

help- sql server service can' t be started

Posted on 2014-02-14
4
Medium Priority
?
314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 70

Accepted Solution

by:
Scott Pletcher earned 2000 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 70

Expert Comment

by:Scott Pletcher
ID: 39865512
You're welcome!

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

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how the fundamental information of how to create a table.

649 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