日期:2014-05-16  浏览次数:20820 次

没有足够的内存来运行此查询
服务器:三台服务器做的数据库镜像,带自动故障转移,见证服务器的配置就不贴了。


数据库:数据库都是 SQL Server 2008,版本号 10.0.4000.0。

现在的问题是:最近一段时间不定期出现数据库无法访问的情况,平均一个月出现1-2次,以前稳定运行1年都没什么问题。

出现问题后具体表现:




错误日志:
EXEC xp_readerrorlog 1,1,Null,Null,'20131231 10:20','20131231 10:25','Asc'
--------------------------------------------------------
2013-12-31 10:20:00.190 服务器 Error: 17312, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2013-12-31 10:20:00.190 服务器 Error: 17053, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2013-12-31 10:20:00.200 spid42s Error: 701, Severity: 17, State: 123.
2013-12-31 10:20:00.200 spid42s There is insufficient system memory in resource pool 'internal' to run this query.
2013-12-31 10:20:00.200 spid42s Error: 9642, Severity: 16, State: 4. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2013-12-31 10:20:00.230 服务器 Error: 17300, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2013-12-31 10:20:00.230 服务器 Error: 17312, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2013-12-31 10:20:00.230 服务器 Error: 17053, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
--未完:日志内容比较多,回复里面再继续贴


在网上找到了这样一段话,我想可能和这个有关:
SQL Server尤其是32位的SQL Server对不同种类的内存的申请大小是不一样的,对Commit、Stolen和MemTOLeave等类型的内存是有限制的。因此会出现系统中还有空闲内存,但是SQL Server不会申请使用的现象。

头疼了比较久,一直也没能解决,网上也找到了一些解决办法,但还没有尝试:
1、升级新版本或者补丁;
2、使用现有服务器并开启AWE;
3、设置SQL Server Max Server Memory;
4、给SQL Server 启动账号赋予Lock Pages in memory权限;
5、禁用“set working set size”;
6、升级硬件驱动;
7、使用64位服务器和数据库。

数据库还有许多客户正在用,没找到问题根源,也不敢有大的改动。
而且问题不易重现,改动之后效果如何验证也是个问题。

跪求指点迷津。
------解决方案--------------------
引用:

求指点,指指点点也行。


你的系统是32位的,那么整个系统最多只能用4G的内存,而分配到sql server的就更少了,那么就很有可能导致没有足够的内存来运行此查询的错误。