Вы находитесь на странице: 1из 4

Note:

Caution:

How to: Start an Instance of SQL Server
(sqlservr.exe)
SQL Server 2005
Updated: 15 September 2007
If the SQL Server Database Engine does not start, one troubleshooting step is to attempt to start
the Database Engine from the command prompt. This topic describes how to start an instance of
the Database Engine.
SQL Server should only be started from the command prompt for troubleshooting purposes. To
start the SQL Server Database Engine for routine use, see How to: Start an Instance of SQL
Server (SQL Server Configuration Manager)
1
.
Normal SQL Server startup is a complex activity, requiring correctly located SQL Server files,
registry settings configured for SQL Server and Microsoft Windows services, and correct file and
registry permissions for the domain account used by the SQL Server service. Therefore, a common
troubleshooting step is to determine if SQL Server can start under ideal conditions by simplifying its
environment. Usually the troubleshooting process starts with the question, "Can SQL Server start,
using an account that is in the local Administrators group, and without using the Windows Service
Control Manager?" A "yes" answer indicates that the problem may relate to the Service Control
Manager, or to the permissions assigned to the account that the SQL Server service is attempting
to use. A "no" answer may reveal an error message that was previously not displayed through the
Service Control Manager, and may indicate problems with the SQL Server files or registry settings.
Do not run SQL Server from the command line for any purpose other than to test whether SQL
Server can be started. Maintenance actions performed after SQL Server has been started from
the command line could cause failures later. For example, if you are logged in as an
administrator, and create a new database or change the location of a data file, SQL Server may
be unable to access it when running later under the normal account for the SQL Server service.
Consider the following limitations when running SQL Server from the command line:
Minimizing the command prompt window will cause Windows to remove nearly all resources
from SQL Server. This is normal, because SQL Server is not designed to operate in this
manner.
SQL Server runs in the security context of the user, not the security context of the account
assigned to run SQL Server during setup.
All system messages appear in the window used to start an instance of SQL Server.
You cannot pause, stop, or resume an instance of SQL Server as a Microsoft Windows service
using SQL Server Management Studio, SQL Server Configuration Manager, the Services
application in Control Panel, or any net commands (for example, net start, net pause, net
continue, and net stop).
You must shut down the instance of SQL Server before logging off Windows.
Page 1 of 4 How to: Start an Instance of SQL Server (sqlservr.exe)
11/5/2011 http://msdn.microsoft.com/en-US/library/ms180965(d=printer,v=SQL.90).aspx
Starting the Correct Instance of SQL Server
To start the default instance of SQL Server from a command prompt
To start a named instance of SQL Server from a command prompt
To start the default instance of SQL Server in single-user mode from
a command prompt
Any command prompt options that you type take precedence over the default command-
prompt options written to the Windows registry by SQL Server Setup.
SQL Server Configuration Manager and SQL Server Management Studio show the service as
stopped.
By default, sqlservr.exe is located at C:\Program Files\Microsoft SQL Server\MSSQL.1
\MSSQL\Binn. If a second instance of SQL Server is installed, a second copy of sqlservr.exe is
located in a directory such as C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\binn. You
can start one instance of SQL Server 2005 by using sqlservr.exe from a different instance, but
SQL Server will start the version of the incorrect instance as well, including service packs, which
may lead to unexpected results. To avoid this, use the MS-DOS change directory (cd) command
to move to the correct directory before starting sqlservr.exe, as shown in the following example.
cd \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn
From a command prompt, enter the following command: 1.
From a command prompt, enter the following command and replace <instancename>
with the name of the instance you want to start:
1.
From a command prompt, enter the following command: 1.
Single-user mode can be useful for performing emergency maintenance when you do not
want other users to connect to SQL Server, but any user can become the single user,
including the SQL Server Agent service.
sqlservr.exe
sqlservr.exe -s <instancename>
sqlservr.exe -m
Page 2 of 4 How to: Start an Instance of SQL Server (sqlservr.exe)
11/5/2011 http://msdn.microsoft.com/en-US/library/ms180965(d=printer,v=SQL.90).aspx
To start a named instance of SQL Server in single-user mode from a
command prompt
To start the default instance of SQL Server with minimal
configuration
To start a named instance of SQL Server with minimal configuration
See Also
From a command prompt, enter the following command: 1.
From a command prompt, enter the following command: 1.
From a command prompt, enter the following command: 1.
Tasks
How to: Stop an Instance of SQL Server (sqlservr.exe)
2

How to: Start an Instance of SQL Server (SQL Server Management Studio)
3

How to: Start an Instance of SQL Server (net Commands)
4

Concepts
Starting SQL Server Manually
5

Using the SQL Server Service Startup Options
6

Stopping Services
7

Using a Dedicated Administrator Connection
8


Help and Information
Getting SQL Server 2005 Assistance
9
Links Table
1
http://msdn.microsoft.com/en-US/library/ms190699(v=SQL.90).aspx
sqlservr.exe -m -s <instancename>
sqlservr.exe -f
sqlservr.exe -f -s <instancename>
Page 3 of 4 How to: Start an Instance of SQL Server (sqlservr.exe)
11/5/2011 http://msdn.microsoft.com/en-US/library/ms180965(d=printer,v=SQL.90).aspx
2011 Microsoft. All rights reserved.
2
http://msdn.microsoft.com/en-US/library/ms189618(v=SQL.90).aspx
3
http://msdn.microsoft.com/en-US/library/ms189576(v=SQL.90).aspx
4
http://msdn.microsoft.com/en-US/library/ms187598(v=SQL.90).aspx
5
http://msdn.microsoft.com/en-US/library/ms191193(v=SQL.90).aspx
6
http://msdn.microsoft.com/en-US/library/ms190737(v=SQL.90).aspx
7
http://msdn.microsoft.com/en-US/library/ms189095(v=SQL.90).aspx
8
http://msdn.microsoft.com/en-US/library/ms189595(v=SQL.90).aspx
9
http://msdn.microsoft.com/en-US/library/ms166016(v=SQL.90).aspx
Community Content

Page 4 of 4 How to: Start an Instance of SQL Server (sqlservr.exe)
11/5/2011 http://msdn.microsoft.com/en-US/library/ms180965(d=printer,v=SQL.90).aspx

Вам также может понравиться