Solved

help- sql server service can' t be started

Posted on 2014-02-14
4
299 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 69

Accepted Solution

by:
Scott Pletcher 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:Scott Pletcher
ID: 39865512
You're welcome!

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

690 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