[Timed] auto-timed restart of SQL Server to reclaim memory

Source: Internet
Author: User
Tags mssqlserver

Auto: http://www.dabaoku.com/jiaocheng/biancheng/mssql/200910111334.shtml

Recently, the database server has increased its memory to a maximum of 8 GB, and the database uses MSSQL 2005. Previously, the memory was 4 GB, there is no conflict between memory size and 32-bit operating systems. A 32-bit operating system supports a maximum of 2 GB memory for a single process. In this case, the memory is added to the white space. What should I do?

I searched for a lot of information on the Internet and found that Microsoft provided a temporary solution. I used awe to allocate memory. In this way, the memory occupied by sqlserver can basically reach the total system memory. However, after a period of operation, we found a problem, that is, when the memory usage increases to a certain amount (for example, 6 GB), the memory will continue to increase, in this case, the memory will be used up after a long period of time, and even the server may become a machine. The database server for the courseware download forum may crash at night, resulting in access interruption. The reason is that awe cannot automatically recycle memory.

Since the memory will be automatically recycled during the restart of sqlserver, the problem becomes the timed restart of sqlserver. We all know that sqlserver has automatic backup and other functions, however, it does not have the function of automatic restart. At this time, I suddenly thought of the Windows built-in scheduled task. Can we use the scheduled task to regularly restart sqlserver?

Now the context is quite clear. When I restart sqlserver at ordinary times, I often prompt to disable the automatic backup function (that is, the sqlserver proxy). So I created a new notepad and renamed it SQL. bat, right-click to edit and enter the following content

Reference content is as follows:

Net stop SQLServerAgent

Net stop MSSQLServer

Net start MSSQLServer

Net start SQLServerAgent
 

Based on this content, there will be no prompt during the automatic operation. If you don't believe it, try to replace or delete the above four statements. After the operation, there should be a prompt, which requires manual operation.

The following is a new scheduled task in the control panel, which is saved here.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.