Solved

help- sql server service can' t be started

Posted on 2014-02-14
4
293 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:
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using a hta file with MSSQL agent to schedule a script job 4 42
RESTORE A BACKUP IN SQL 2012 from SQL 2008 9 67
SQLCMD Syntax 2 17
sql 2016 data tools breakdown.. 1 15
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

820 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