日期:2014-05-18 浏览次数:21153 次
SELECT count(*)*8 AS cached_pages_kb
,obj.name ,obj.index_id,b.type_desc,b.name
FROM sys.dm_os_buffer_descriptors AS bd
INNER JOIN
(
SELECT object_name(object_id) AS name
,index_id ,allocation_unit_id,object_id
FROM sys.allocation_units AS au
INNER JOIN sys.partitions AS p
ON au.container_id = p.hobt_id
AND (au.type = 1 OR au.type = 3)
UNION ALL
SELECT object_name(object_id) AS name
,index_id, allocation_unit_id,object_id
FROM sys.allocation_units AS au
INNER JOIN sys.partitions AS p
ON au.container_id = p.partition_id
AND au.type = 2
) AS obj
ON bd.allocation_unit_id = obj.allocation_unit_id
LEFT JOIN sys.indexes b on b.object_id = obj.object_id AND b.index_id = obj.index_id
WHERE database_id = db_id()
GROUP BY obj.name, obj.index_id ,b.name,b.type_desc
ORDER BY cached_pages_kb DESC;
------解决方案--------------------
连接没有问题。 连接超时你看下是不是网络问题。
------解决方案--------------------
sp_readerrorlog 不是 xp_readerrorlog 他是记录从上次数据库引擎开启后到现在...的所有信息..包裹你打开查询分析器的时候他先调用那个数据,在根据model建立那些库! 什么时候出现过错误!