use master exec sp_configure 'show advanced options', 1 reconfigure with OVERRIDE -- 先设置物理内存上限到一个比较低的值,但也不要太低 exec sp_configure 'max server memory (MB)', 10240 reconfigure with OVERRIDE -- 等待Sql server释放 waitfor Delay '00:02:00' -- 还原原先的内存上限 exec sp_configure 'max server memory (MB)', 40496 reconfigure with OVERRIDE exec sp_configure 'show advanced options', 0 reconfigure with OVERRIDE
思路很简单就是动态的设置sql server的最多可用内存.