Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have installed SQL server 2008 express on a 64-bit virtual box and the service wont start.

Looking at the event log I get:

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.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

And also:

FileMgr::StartLogFiles: Operating system error 2(failed to retrieve text for this error. Reason: 1815) occurred while creating or opening file 'e:\sql10_main_t\sql\mkmastr\databases\objfre\i386\MSDBLog.ldf'. Diagnose and correct the operating system error, and retry the operation.

Note: Theres another error like this for the mdf file too.

Now what is odd is that there is no e drive mapped to this box so I dont know why this is trying to open a file from here. Don't know if this is something to do with the fact that is a virtual slice and maybe the host machine has this drive mapped?

Any advise welcome.

Chris.

share|improve this question

2 Answers 2

Try the following (Be aware I did this on 2005 Express so you may have to adjust as required):

Open up a console and try to start in single user mode:

sqlsvr.exe -m -s <instance_name>

If it starts you can now open up management studio and try the following:

-- alter the database
ALTER DATABASE tempdb MODIFY FILE ( NAME = 'tempdev', FILENAME = 'SomeWhere\Here\tempdb.mdf' )
ALTER DATABASE tempdb MODIFY FILE ( NAME = 'templog', FILENAME = 'SomeWhere\Here\templog.ldf' )

-- ensure that it has been moved
SELECT name, physical_name as CurrentLocation, state_desc
from sys.master_files
WHERE database_id IN (DB_ID('tempdev'), DB_ID('templog')

Now stop sql server and try to restart from the services console. It should successfully start now.

If it does also do the following to ensure new databases are created in the proper locations:

  1. Open Management Studio Express and login
  2. Right Click your server and select Properties
  3. Click Database Settings
  4. Change default Database Locations to what is on your VPS

This should change the default locations

share|improve this answer
    
sqlsvr.exe isnt in my path variables, where is this exe I cant find it. –  Owen Nov 20 '09 at 19:21
    
Should be where it was installed into say something like: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn. You could try a file system search in C:\Program Files –  Wayne Nov 21 '09 at 11:18
    
No file there, but in C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Binn there is a "sqlservr.exe". Though this just brings up an empty prompt box. Any ideas? –  Owen Nov 21 '09 at 19:57
    
C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Binn\sqlsvr.exe -m -s <instance_name> if the command prompt stays open it is running. You can then connect with management studio express and run the above TSQL commands –  Wayne Nov 22 '09 at 10:49

Hope this helps you...

In order to resolve this you have to rebuild the database using this command string below. This command MUST be run from this directory.

C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Release

Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName /SQLSYSADMINACCOUNTS=accounts /[SAPWD= StrongPassword]

If you are using Windows authentication you can ditch the strong password portion of the command like so.

Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName /SQLSYSADMINACCOUNTS=accounts

You can read more on the issue at http://msdn.microsoft.com/en-us/library/dd207003.aspx. Hope this can help somebody out.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.