简体   繁体   English

Windows Server 2012 R2和SQL Server 2012内存使用率低

[英]Windows Server 2012 R2 & SQL Server 2012 Memory low usage

I can't find solution for my problem... 我找不到解决我问题的方法...

We have a Windows Server 2012 R2 and SQL Server 2012 installed on it. 我们在其上安装了Windows Server 2012 R2和SQL Server 2012。 I have not installed this server so I can't say if there are some allocation of resources for each user made on start. 我尚未安装此服务器,所以我无法说启动时是否为每个用户分配了一些资源。

My issue is that if I connect to server via remote desk and run queries, they take really long to execute even if it's a short query, indexes / key are set but I found in task manager that I can't get over 200GB memory usage for SQL Server. 我的问题是,如果我通过远程桌面连接到服务器并运行查询,即使查询很短,它们也要花很长时间才能执行,但已设置了索引/键,但是在任务管理器中发现我无法获得超过200GB的内存使用量用于SQL Server。

The max memory setting in SQL Server is set to 2147483647 SQL Server中的最大内存设置设置为2147483647

Where can I find if I have only some amount of memory allocated to mine account? 在哪里可以找到我分配给我的帐户的内存量?

Thanks 谢谢

Memory usage may not be always an issue.You an check if queries are waiting for memory grants using below dmvs 内存使用可能并不总是一个问题。您可以使用以下dmvs检查查询是否正在等待内存授予

--below dmv gives me text of queries which are waiting for memory grants --below dmv给我一些正在等待内存授予的查询文本

select * from sys.dm_exec_query_memory_grants mg
 join
sys.dm_exec_requests ec
 on ec.session_id=mg.session_id
 --left join
 --sys.dm_exec_connections con
 --on con.session_id=ec.session_id
 outer apply
 sys.dm_exec_sql_text(ec.sql_handle) txt
 outer apply
 sys.dm_exec_query_plan(ec.plan_handle) qp

Further you can check which memory clerk is using most memory 此外,您可以检查哪个内存管理员使用的内存最多

select (sum(pages_kb)*128)/1024 as 'sizein_mb',type as 'clerkttype'
from sys.dm_os_memory_clerks
group by type
order by (sum(pages_kb)*128)/1024 desc

Prior to this,you may need to check if you are having locking,blockings 在此之前,您可能需要检查是否有锁定,阻塞

select 
 session_id,status,blocking_session_id,wait_type,txt.text from sys.dm_exec_requests ec
cross apply
sys.dm_exec_sql_text(ec.sql_handle) txt

Hope this helps in your troubleshooting.Checking memory from task manager wont get you accurate stats..below question and answer has reason and some good links to check further. 希望这有助于您进行故障排除。从任务管理器中检查内存不会使您获得准确的统计信息。.以下问答有原因,还有一些很好的链接可以进一步检查。

https://dba.stackexchange.com/questions/35418/why-is-sql-server-memory-showing-in-task-manager https://dba.stackexchange.com/questions/35418/why-is-sql-server-memory-showing-in-task-manager

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM