none
Launch SQL Instance only when is required RRS feed

  • Question

  • Dear Expert,

    I've SQL instance used for Telecom Software, that SQL instance kept to run automatically consume 2 GB RAM and slow my machine

    How could I configure it to lunch only when I open my Telecom Software and to close when I exit it

    Thanks
    Friday, August 7, 2015 2:26 PM

Answers

  • Hi RFengineer,

    You could open up SQL Server Configuration Monitor and tell the database engine to be disabled on startup.  Then you could build a batch or PowerShell script to start and stop the service as needed.

    https://msdn.microsoft.com/en-us/library/hh403394.aspx

    With that said, by default SQL Server will try to consume as much memory as possible for the buffer pool.  I would bet your MAX Memory value isn't set to an optimal value for your machine. I check this first because setting this correctly could completely resolve your issue.

    https://technet.microsoft.com/en-US/library/ms191144%28v=SQL.105%29.aspx?f=255&MSPPError=-2147217396

    If this answered your question please mark this as answered. If it was also helpful please mark it as helpful.

    Friday, August 7, 2015 2:39 PM
  • Please first make sure you write correct spelling when asking question.

    You can go to sql server configuration manager then click on sql server services on left side. This would make all sql server services appear on right side . Right click on SQL Server service and select properties and make startup mode as manual. In figure below its automatic.

    Now this will not start sql service when windows server start. So when you launch telecom software then you have to go and start service from SSCM. You cannot force it to start when your app start


    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Technet Wiki Article

    MVP

    Friday, August 7, 2015 4:44 PM
    Moderator

All replies

  • Hi RFengineer,

    You could open up SQL Server Configuration Monitor and tell the database engine to be disabled on startup.  Then you could build a batch or PowerShell script to start and stop the service as needed.

    https://msdn.microsoft.com/en-us/library/hh403394.aspx

    With that said, by default SQL Server will try to consume as much memory as possible for the buffer pool.  I would bet your MAX Memory value isn't set to an optimal value for your machine. I check this first because setting this correctly could completely resolve your issue.

    https://technet.microsoft.com/en-US/library/ms191144%28v=SQL.105%29.aspx?f=255&MSPPError=-2147217396

    If this answered your question please mark this as answered. If it was also helpful please mark it as helpful.

    Friday, August 7, 2015 2:39 PM
  • My SQL server never takes lunch.


    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question. Enjoyed my post? Hit the up arrow (left)
    Really enjoyed it? See my profile!

    Friday, August 7, 2015 2:42 PM
  • Dear Expert,

    I've SQL instance used for Telecom Software, that SQL instance kept to run automatically consume 2 GB RAM and slow my machine

    How could I configure it to lunch only when I open my Telecom Software and to close when I exit it

    Thanks

    You can stop and start SQL Server with the configuration tool:

    You could also start and stop the service with a powershell script and call both from a batch file:

    # PowerShell cmdlet to start a named service
    Clear-Host
    $srvName = "PLA"
    $servicePrior = Get-Service $srvName
    "$srvName is now " + $servicePrior.status
     Set-Service $srvName -startuptype manual
    Start-Service $srvName
    $serviceAfter = Get-Service $srvName
    "$srvName is now " + $serviceAfter.status
    # PowerShell cmdlet to stop the Perf log and alert service
    $srvName = "PLA"
    $servicePrior = Get-Service $srvName
    "$srvName is now " + $servicePrior.status
    Stop-Service $srvName
    $serviceAfter = Get-Service $srvName
     Set-Service $srvName -startuptype disabled
    "$srvName is now " + $serviceAfter.status


    The first thing I would consider is why the vendor chose SQL Server as a tool for the telecom software. What is it doing that is needed in the background? Does it track calls, contacts, and everything else? Why other than performance would we want it shutdown? Why not just add RAM to your machine?

    *scripts from: http://www.computerperformance.co.uk/powershell/powershell_service_start.htm


    I hope you found this helpful! If you did, please vote it as helpful on the left. If it answered your question, please mark it as the answer below. :)


    Friday, August 7, 2015 2:45 PM
  • Also evaluate whether AutoClose is an option. It will help to get your memory back, but it will seriously hurt the performance of your application.

    Maybe you should consider throwing hardware at that problem.

    Friday, August 7, 2015 2:45 PM
  • Please first make sure you write correct spelling when asking question.

    You can go to sql server configuration manager then click on sql server services on left side. This would make all sql server services appear on right side . Right click on SQL Server service and select properties and make startup mode as manual. In figure below its automatic.

    Now this will not start sql service when windows server start. So when you launch telecom software then you have to go and start service from SSCM. You cannot force it to start when your app start


    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Technet Wiki Article

    MVP

    Friday, August 7, 2015 4:44 PM
    Moderator
  • Dear Expert,

    I've SQL instance used for Telecom Software, that SQL instance kept to run automatically consume 2 GB RAM and slow my machine

    How could I configure it to lunch only when I open my Telecom Software and to close when I exit it

    Thanks

    It is not recommended to do this, because it takes a while to start the service and the application software will not correctly benefit from buffer pool. Increasing 2GB RAM is a very cheap solution these days. Then you can limit max memory to 2GB. 


    Saeid Hasani (My Writings on TechNet Wiki ,T-SQL Blog)


    Sunday, August 9, 2015 2:06 PM
    Moderator
  • Dear JohnSterrett,

    I checked your link:
    https://technet.microsoft.com/en-US/library/ms191144%28v=SQL.105%29.aspx?f=255&MSPPError=-2147217396

    but couldn't find "Object Explorer/ Memory Node"

    To set a fixed amount of memory

    1. In Object Explorer, right-click a server and select Properties.

    2. Click the Memory node.

    Could you kindly share snapshot!


    • Edited by RFengineer Saturday, August 15, 2015 11:54 AM
    Saturday, August 15, 2015 11:53 AM
  • I checked your link:
    https://technet.microsoft.com/en-US/library/ms191144%28v=SQL.105%29.aspx?f=255&MSPPError=-2147217396

    but couldn't find "Object Explorer/ Memory Node"

    To set a fixed amount of memory

    1. In Object Explorer, right-click a server and select Properties.

    2. Click the Memory node.

    Could you kindly share snapshot!


    Hi RFengineer,

    Firstly, you need to log in SQL Server via SQL Server Management Studio, then you will find “Object Explorer” in the left panel as shown in the following screenshot. Next configure memory by performing the steps from above article.



    Thanks,
    Lydia Zhang



    Lydia Zhang
    TechNet Community Support



    Monday, August 17, 2015 9:25 AM
    Moderator