Can't start 2008R2 from command prompt

  • Hi,

    I just installed a new instance of SQL2008R2 (Express) on our dev server. The install went fine and the instance is accessable, however I would like to be able to practice stop/start of this instance and add new users all from the command line.

    I've navigated to the \Binn folder for this instance and tried issuing the command "SqlServr.exe -m", from and Administrator Command Prompt, this returns a load of errors regarding access to the ERRORLOG file. (See below)

    The SQL Server service runs under a domain account which is also a local administer.

    I have also explicitly set full permissions on the folder "C:\Program Files\Microsoft SQL Server\..." to the account that runs the SQL service.

    Has anyone seen this before? I've googled around for this but nothing I've tried seems to work

    2015-01-15 14:08:15.43 Server Error: 17058, Severity: 16, State: 1.

    2015-01-15 14:08:15.43 Server initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'. Operating system error = 32(failed to retrieve text for this error. Reason: 15105).

    Anyone seen this before?

    Thanks

  • Is the service still running at this point?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi,

    Yes the service is still running.

    Made a little of progress. I explicitly named the instance like this

    sqlservr.exe -m -s "Dev\Express2008"

    This forces it to use the correct error log, however it still does not stop and I just get an error dialogue with no text. There is nothing in the

    ERRORLOG file for this time either.

  • thedavegray (1/15/2015)


    Yes the service is still running.

    Well there's your problem.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Exactly the same problem with the service stopped (via services.msc), still nothing in the ERRORLOG

  • Is the service named "Express2008"? That's not the default for Express.

    What are the command-line parameters for the service?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You see where it says "Operating system error = 32"? If you don't know what that error code means, go to a command prompt and type [font="Courier New"]net helpmsg 32[/font]. In this case, it means "the process cannot access the file because it is being used by another process". So it looks as if it is indeed because the service is already running, or you have a command prompt already open with that instance running, or maybe you have two instances pointing at the same errorlog.

    John

  • John Mitchell-245523 (1/15/2015)


    You see where it says "Operating system error = 32"? If you don't know what that error code means, go to a command prompt and type [font="Courier New"]net helpmsg 32[/font]. In this case, it means "the process cannot access the file because it is being used by another process". So it looks as if it is indeed because the service is already running, or you have a command prompt already open with that instance running, or maybe you have two instances pointing at the same errorlog.

    John

    Thanks, that probably was the case with the first error message as I was not specifying he instance [yes I know 🙁 ], so when I do specify the instance I get the attached, rather unhelpful dialogue box and nothing in the log.

    Have also jsut checked, both instances are using different ERRORLOG files as expected.

  • What does the application event log say?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • The Windows Logs.System tree node says

    Application popup: SQL Server :

    The XML says this

    - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

    - <System>

    <Provider Name="Application Popup" />

    <EventID Qualifiers="16384">26</EventID>

    <Level>4</Level>

    <Task>0</Task>

    <Keywords>0x80000000000000</Keywords>

    <TimeCreated SystemTime="2015-01-15T15:11:44.000000000Z" />

    <EventRecordID>7082</EventRecordID>

    <Channel>System</Channel>

    <Computer>xxxxxx.rkh.com</Computer>

    <Security />

    </System>

    - <EventData>

    <Data>SQL Server</Data>

    <Data />

    </EventData>

    </Event>

    Which looks to be a generic "application can't start popup".

  • Not the system event log. The application event log.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (1/15/2015)


    Is the service named "Express2008"? That's not the default for Express.

    What are the command-line parameters for the service?

    Sorry, missed this response.

    I named the instance Express2008 when I installed it.

    By command line parameters do you mean the "Startup parameters" from "SS Configuration Manager" for this instance? If so it's this:

    -dC:\Program Files\Microsoft SQL Server\MSSQL10_50.EXPRESS2008\MSSQL\DATA\master.mdf;-eC:\Program Files\Microsoft SQL Server\MSSQL10_50.EXPRESS2008\MSSQL\Log\ERRORLOG;-lC:\Program Files\Microsoft SQL Server\MSSQL10_50.EXPRESS2008\MSSQL\DATA\mastlog.ldf

  • GilaMonster (1/15/2015)


    Not the system event log. The application event log.

    The last entry in the (Event Viewer) Windows Logs.Application says this:

    SQL Server is now ready for client connections. This is an informational message; no user action is required.

    Which was the last one from when I started the service manually from services.msc

  • "SqlServr.exe -m" is server single user maintenance mode and you only need it in limited cases.

    Restoring the master database is one that comes to mind.

    If you goal is to start and stop the SQL Instance from the command line use

    NET START "SQL Service name"

    NET STOP "SQL Service name"

    If you want to add users from the command line,

    use sqlcmd, possibly with a script file.

  • And following on from my last post, if you do want to start the server in single user mode, drop the Dev\ from the

    instance name:

    sqlservr.exe -m -s "Express2008"

    http://msdn.microsoft.com/en-AU/library/ms180965(v=sql.100).aspx

    If you are still having trouble, check the permissions on the folder and make sure the user you are logged on has write access to the folder.

Viewing 15 posts - 1 through 14 (of 14 total)

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