Solved

help- sql server service can' t be started

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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

895 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