SQL wont start after moving Model database

  • I used the code below to move the Model database and Model log file to new drive locations.

    ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name , FILENAME = 'new_path/os_file_name' )

    After running the commands I stopped the SQL server and moved the physical files to the new location.

    Now I am unable to start SQL server, I get error 17204 Could not open file:Access is denied

    I think the problem maybe that for FILENAME=new_path I put "J:\SQL Server\MSSQL.1\MSSQL\Data"

    but did not include model.mdf in the file path.

    How do I correct the path now that SQL service won't start?

    The SQL error log is below.

    Thanks for your help

    2007-09-11 13:19:31.82 Server      Microsoft SQL Server 2005 - 9.00.3042.00 (X64)

     Feb 10 2007 00:59:02

     Copyright (c) 1988-2005 Microsoft Corporation

     Standard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)

    2007-09-11 13:19:31.82 Server      (c) 2005 Microsoft Corporation.

    2007-09-11 13:19:31.82 Server      All rights reserved.

    2007-09-11 13:19:31.82 Server      Server process ID is 3264.

    2007-09-11 13:19:31.82 Server      Authentication mode is MIXED.

    2007-09-11 13:19:31.82 Server      Logging SQL Server messages in file 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.

    2007-09-11 13:19:31.82 Server      This instance of SQL Server last reported using a process ID of 2648 at 9/11/2007 1:10:02 PM (local) 9/11/2007 8:10:02 PM (UTC). This is an informational message only; no user action is required.

    2007-09-11 13:19:31.82 Server      Registry startup parameters:

    2007-09-11 13:19:31.82 Server        -d D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf

    2007-09-11 13:19:31.82 Server        -e D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG

    2007-09-11 13:19:31.82 Server        -l D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf

    2007-09-11 13:19:31.84 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.

    2007-09-11 13:19:31.84 Server      Detected 4 CPUs. This is an informational message; no user action is required.

    2007-09-11 13:19:31.96 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.

    2007-09-11 13:19:31.98 Server      Attempting to initialize Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.

    2007-09-11 13:19:32.00 Server      Attempting to recover in-doubt distributed transactions involving Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.

    2007-09-11 13:19:32.00 Server      Database mirroring has been enabled on this instance of SQL Server.

    2007-09-11 13:19:32.00 spid5s      Starting up database 'master'.

    2007-09-11 13:19:32.09 spid5s      SQL Trace ID 1 was started by login "sa".

    2007-09-11 13:19:32.10 spid5s      Starting up database 'mssqlsystemresource'.

    2007-09-11 13:19:32.10 spid5s      The resource database build version is 9.00.3042. This is an informational message only. No user action is required.

    2007-09-11 13:19:32.26 spid5s      Server name is 'SS02'. This is an informational message only. No user action is required.

    2007-09-11 13:19:32.26 spid9s      Starting up database 'model'.

    2007-09-11 13:19:32.26 spid9s      Error: 17207, Severity: 16, State: 1.

    2007-09-11 13:19:32.26 spid9s      FCB:pen: Operating system error 5(Access is denied.) occurred while creating or opening file 'J:\SQL Server\MSSQL.1\MSSQL\Data'. Diagnose and correct the operating system error, and retry the operation.

    2007-09-11 13:19:32.26 spid9s      Error: 17204, Severity: 16, State: 1.

    2007-09-11 13:19:32.26 spid9s      FCB:pen failed: Could not open file J:\SQL Server\MSSQL.1\MSSQL\Data for file number 1.  OS error: 5(Access is denied.).

    2007-09-11 13:19:32.26 spid9s      Error: 5120, Severity: 16, State: 101.

    2007-09-11 13:19:32.26 spid9s      Unable to open the physical file "J:\SQL Server\MSSQL.1\MSSQL\Data". Operating system error 5: "5(Access is denied.)".

    2007-09-11 13:19:32.26 spid9s      Error: 17207, Severity: 16, State: 1.

    2007-09-11 13:19:32.26 spid9s      FCB:pen: Operating system error 5(Access is denied.) occurred while creating or opening file 'I:\SQL Server\MSSQL.1\MSSQL\Data'. Diagnose and correct the operating system error, and retry the operation.

    2007-09-11 13:19:32.26 spid9s      Error: 17204, Severity: 16, State: 1.

    2007-09-11 13:19:32.26 spid9s      FCB:pen failed: Could not open file I:\SQL Server\MSSQL.1\MSSQL\Data for file number 2.  OS error: 5(Access is denied.).

    2007-09-11 13:19:32.26 spid9s      Error: 5120, Severity: 16, State: 101.

    2007-09-11 13:19:32.26 spid9s      Unable to open the physical file "I:\SQL Server\MSSQL.1\MSSQL\Data". Operating system error 5: "5(Access is denied.)".

    2007-09-11 13:19:32.26 spid9s      File activation failure. The physical file name "I:\SQL Server\MSSQL.1\MSSQL\Data" may be incorrect.

    2007-09-11 13:19:32.26 spid9s      Error: 945, Severity: 14, State: 2.

    2007-09-11 13:19:32.26 spid9s      Database 'model' cannot be opened due to inaccessible files or insufficient memory or disk space.  See the SQL Server errorlog for details.

    2007-09-11 13:19:32.26 spid9s      Could not create tempdb. You may not have enough disk space available. Free additional disk space by deleting other files on the tempdb drive and then restart SQL Server. Check for additional errors in the event log that may indicate why the tempdb files could not be initialized.

    2007-09-11 13:19:32.26 spid9s      SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

  • I haven't ever tried to move the model database, but a stupid question, have you checked that the account running sqlserver has access to your new drive/folder (local system/nt account)?

  • Would I be wrong in assuming that you put the model database on a network drive?  And more than that the tempdb too?  I think that is your issue. 

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply