How to identify the Total/Available/Used Physical Memory in database server using script ?

 Posted by PandianS on 10/27/2010 | Category: Sql Server Interview questions | Views: 3293 | Points: 40
Answer:

SELECT (total_physical_memory_kb/1024.)/1024. 'Total Physical Memory(GB)', 

(available_physical_memory_kb/1024.)/1024. 'Available Physical Memory(GB)',
(100 / ((total_physical_memory_kb/1024.)/1024.)) * (((total_physical_memory_kb/1024.)/1024.) - ((available_physical_memory_kb/1024.)/1024.)) 'Used Physical Memory(%)' ,
(100 / ((total_physical_memory_kb/1024.)/1024.)) * ((available_physical_memory_kb/1024.)/1024.) 'Available Physical Memory(%)',
system_memory_state_desc 'Memory Status'
FROM sys.dm_os_sys_memory


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response