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.