Stop SQL Server from running until needed [closed]

守給你的承諾、 提交于 2020-01-02 02:14:45

问题


I have SQL Server 2012 installed on my PC, and usually don't need it. It's only for debugging purposes.

I've seen it takes up quite some RAM so I'd like to prevent it from starting until I need it, start it, and then stop it when not needed again.

How do I do that? (I have SSMS installed as well so I can use that if that's the way to do it.)


回答1:


To start, stop, pause, resume, or restart the an instance of the SQL Server Database Engine:

  1. On the Start menu, point to All Programs, point to Microsoft SQL Server 2012 , point to Configuration Tools, and then click SQL Server Configuration Manager. If the User Account Control dialog box appears, click Yes.
  2. In SQL Server Configuration Manager, in the left pane, click SQL Server Services.
  3. In the results pane, right-click SQL Server (MSSQLServer) or a named instance, and then click Start, Stop, Pause, Resume, or Restart.
  4. Click OK to close SQL Server Configuration Manager.

From: Microsoft - Start,Stop,etc. SQL Server

You can also do this from within SSMS:

In Object Explorer, connect to the instance of the Database Engine, right-click the instance of the Database Engine you want to start, and then click Start, Stop, Pause, Resume, or Restart.

Edit: As Lamak mentioned, within the SQL Server Configuration Manager you can change all the services StartMode to "Manual" so they do not start on boot.




回答2:


The best way is to setup se SQL service to manual, from run type “services.msc” to access windows services and change startup type to “manual” you can change all services started by SQL*.

Doing so your computer starts faster because will not start SQL Server on boot.

If you need just go again to services.msc and start the service, there's no need to change again the type they just stay "manual"




回答3:


To stop it.

Copy:

%windir%\system32\net.exe stop mssqlserver

Windows-R

Paste

Run

To restart it, the same with:

%windir%\system32\net.exe start mssqlserver



来源:https://stackoverflow.com/questions/17284228/stop-sql-server-from-running-until-needed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!