AS
Size: a a a
AS
T
AS
TS
TS
VA
TS
AS
ИП
TS
T
AS
TS
AS
SP
TS
К
declare @x64 bit, @ramGB real, @cache real, @dbid int, @cnt int;
select @dbid = db_id('cpcr_work');
SELECT @cnt = 4,
@x64 = cast(isnull(PATINDEX('%X64%', [version]),0) as bit) ,
@ramGB = ([ramKB]/1024./1024.)
FROM [dbms].[dbo].[sys_info];
print 'x64='+cast(@x64 as varchar)+',ramGB='+cast(cast(@ramGB as decimal(10,2)) as varchar);
while (@cnt > 0) begin
SELECT @cache = (SUM(single_pages_kb) + SUM(multi_pages_kb) ) / 1024.
FROM sys.dm_os_memory_cache_counters
WHERE type = 'CACHESTORE_SQLCP' OR type = 'CACHESTORE_OBJCP';
if (@cache > 10000.) begin
-- The following operations flush the plan cache entries that refer to a particular database, and cause fresh compilations afterwards.
DBCC FREEPROCCACHE;
end
waitfor delay '00:00:15'; -- 14 sec
set @cnt = @cnt - 1;
end