title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | helpviewer_keywords | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sqlservr Application |
The sqlservr application starts, stops, pauses, and continues an instance of SQL Server from a command prompt. |
markingmyname |
maghan |
10/07/2021 |
sql |
tools-other |
conceptual |
|
[!INCLUDEsqlserver]
The sqlservr application starts, stops, pauses, and continues an instance of [!INCLUDEmsCoName] [!INCLUDEssNoVersion] from a command prompt. Use this procedure to start [!INCLUDEmsCoName] [!INCLUDEssNoVersion] only for troubleshooting purposes.
sqlservr [-s instance_name] [-c] [-d master_path] [-f]
[-e error_log_path] [-l master_log_path] [-m]
[-n] [-T trace#] [-v] [-x]
-s instance_name Specifies the instance of [!INCLUDEssNoVersion] to connect to. If no named instance is specified, sqlservr starts the default instance of [!INCLUDEssNoVersion].
Important
When starting an instance of [!INCLUDEssNoVersion], you must use the sqlservr application in the appropriate directory for that instance. For the default instance, run sqlservr from the \MSSQL\Binn directory. For a named instance, run sqlservr from the \MSSQL$instance_name\Binn directory.
-c Indicates that an instance of [!INCLUDEssNoVersion] is started independently of the Windows Service Control Manager. This option is used when starting [!INCLUDEssNoVersion] from a command prompt, to shorten the amount of time it takes for [!INCLUDEssNoVersion] to start.
Note
When you use this option, you cannot stop [!INCLUDEssNoVersion] by using [!INCLUDEssNoVersion] Service Manager or the net stop command, and if you log off the computer, [!INCLUDEssNoVersion] is stopped.)
-d master_path Indicates the fully qualified path for the master database file. There are no spaces between -d and master_path. If you do not provide this option, the existing registry parameters are used.
-f Starts an instance of [!INCLUDEssNoVersion] with minimal configuration. This is useful if the setting of a configuration value (for example, over-committing memory) has prevented the server from starting.
-e error_log_path
Indicates the fully qualified path for the error log file. If not specified, the default location is *\<Drive>*:\Program Files\Microsoft SQL Server\MSSQL\Log\Errorlog
for the default instance and *\<Drive>*:\Program Files\Microsoft SQL Server\MSSQL$*instance_name*\Log\Errorlog
for a named instance. There are no spaces between -e and error_log_path.
-l master_log_path Indicates the fully qualified path for the master database transaction log file. There are no spaces between -l and master_log_path.
-m Indicates to start an instance of [!INCLUDEssNoVersion] in single-user mode. Only a single user can connect when [!INCLUDEssNoVersion] is started in single-user mode. The CHECKPOINT mechanism, which guarantees that completed transactions are regularly written from the disk cache to the database device, is not started. (Typically, this option is used if you experience problems with system databases that require repair.) Enables the sp_configure allow updates option. By default, allow updates is disabled.
-n Allows you to start a named instance of [!INCLUDEssNoVersion]. Without the -s parameter set, the default instance attempts to start. You must switch to the appropriate BINN directory for the instance at a command prompt before starting sqlservr.exe. For example, if Instance1 were to use \mssql$Instance1 for its binaries, the user must be in the \mssql$Instance1\binn directory to start sqlservr.exe -s instance1. If you start an instance of [!INCLUDEssNoVersion] with the -n option, it is advisable to use the -e option too, or [!INCLUDEssNoVersion] events are not logged.
-T trace# Indicates that an instance of [!INCLUDEssNoVersion] should be started with a specified trace flag (trace#) in effect. Trace flags are used to start the server with nonstandard behavior. For more information, see Trace Flags (Transact-SQL).
Important
When specifying a trace flag, use -T to pass the trace flag number. A lowercase t (-t) is accepted by [!INCLUDEssNoVersion]; however, -t sets other internal trace flags required by [!INCLUDEssNoVersion] support engineers.
-v Displays the server version number.
-x Disables the keeping of CPU time and cache-hit ratio statistics. Allows maximum performance.
It is recommended to use the methods described in Database Engine Service Startup Options instead of using the sqlservr.exe program to start [!INCLUDEmsCoName] [!INCLUDEssNoVersion]. In most cases, the sqlservr.exe program is only used for advanced troubleshooting or major maintenance. When [!INCLUDEssNoVersion] is started from the command prompt with sqlservr.exe, [!INCLUDEssNoVersion] does not start as a service, so you cannot stop [!INCLUDEssNoVersion] using net commands. Users can connect to [!INCLUDEssNoVersion], but [!INCLUDEssNoVersion] tools show the status of the service, so [!INCLUDEssNoVersion] Configuration Manager correctly indicates that the service is stopped. [!INCLUDEssManStudioFull] can connect to the server, but it also indicates that the service is stopped.
The following parameters are obsolete and not supported in [!INCLUDEsssql19-md].
Parameter | More information |
---|---|
-h | In earlier versions of 32-bit instances of [!INCLUDEssNoVersion] to reserve virtual memory address space for Hot Add memory metadata when AWE is enabled. Supported through [!INCLUDEsssql14]. For more information, see Discontinued SQL Server Features in SQL Server 2016. |
-g | memory_to_reserve Applies to earlier versions of 32-bit instances of [!INCLUDEssNoVersion]. Supported through [!INCLUDEsssql14]. Specifies an integer number of megabytes (MB) of memory that [!INCLUDEssNoVersion] leaves available for memory allocations within the [!INCLUDEssNoVersion] process, but outside the [!INCLUDEssNoVersion] memory pool. For more information, see the SQL Server 2014 documentation on Server Memory Configuration Options. |