2

here is the error I get:

C:\WINDOWS\system32>"C:\Program Files\Microsoft SQL Server\120\LocalDB\Binn\sqlservr.exe" -m
2017-09-27 16:09:26.50 Server      Error: 17058, Severity: 16, State: 1.
2017-09-27 16:09:26.50 Server      initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log\ERRORLOG'. Operating system error = 32(The process cannot access the file because it is being used by another process.).
2017-09-27 16:09:26.80 Server      Error: 17058, Severity: 16, State: 1.
2017-09-27 16:09:26.80 Server      initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log\ERRORLOG'. Operating system error = 32(The process cannot access the file because it is being used by another process.).

Any hint to help me would be great. Thank you!

2 Answers 2

3

Analysis

You receive the above error message if the sqlservr.exe program is already running or if your privileges are not correct.

Solution

Try stopping the SQL Server () service first and the you should be able to start sqlservr.exe -m without any further issues.

IF the service is not running, check the Processes tab in the Windows Task Manager for a process sqlservr.exe.

IF the the service is not running and no other process can be seen in the Task Manager ensure you start the Command Prompt with Runas Administrator... and you should be able to start the process.

IF you are still unable to start the instance, then you might have to add additional parameters when manually starting your instance.

SQL Server Startup Parameters (2014)

The parameters for manually starting SQL Server are as follows:

C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Binn>sqlservr.exe /?
usage: sqlservr
        [-a,]                    (adding an L2 buffer pool file)
        [-c] (not as a service)
        [-d file] (alternative master data file)
        [-l file] (alternative master log file)
        [-e file] (alternate errorlog file)
        [-f] (minimal configuration mode)
        [-m] (single user admin mode)
        [-g number] (stack MB to reserve)
        [-k ] (checkpoint speed in MB/sec)
        [-n] (do not use event logging)
        [-s name] (alternate registry key name)
        [-T ] (trace flag turned on at startup)
        [-x] (no statistics tracking)
        [-y number] (stack dump on this error)
        [-B] (breakpoint on error (used with -y))
        [-K] (force regeneration of service master key (if exists))
        [-v] (list version information)

See documentation for details.
2017-09-27 10:21:14.23             SQL Server shutdown has been initiated
2

You have LocalDB 2014 and default instance of 2016 on your pc.

When executed sqlservr.exe -m you've started the default instance (2016) that was already in execution. It tried to access its error log but it's already in use by the default 2016 instance in execution.

To start/stop LocalDB instance use SqlLocalDB Utility

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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