Thursday, August 26, 2010

Virtual Memory Of SQL Server

Hi Friends,

I got a request from one of my friend stating that he needs a alert that once Vitual Memory of SQL Server Process goes less than 256 MB he can get an alert.

He wished and I did it.

VirtualMemoryLess256MB.vbs
******************************

set events = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecNotificationQuery ("select * from __instancemodificationevent within 5 where targetinstance isa 'Win32_Process' and targetinstance.Name='SQLSERVR.exe' and targetinstance.VirtualSize<268435456")
' Note this next call will wait indefinitely - a timeout can be specified
'WScript.Echo "Waiting for Virtual Memory to be less than 256 MB event..."
'WScript.Echo ""
do
set NTEvent = events.nextevent
if err <> 0 then
WScript.Echo Err.ProcessID, Err.Name, Err.VirtualSize
Exit Do
else
WScript.Echo NTEvent.TargetInstance.ProcessID
WScript.Echo NTEvent.TargetInstance.Name
WScript.Echo NTEvent.TargetInstance.VirtualSize
end if
loop
WScript.Echo "finished"

7 comments:

  1. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    machine learning Training in Chennai | machine learning Training institute in chennai | Best machine learning Training in chennai

    ReplyDelete
  2. Very Informative blog thank you for sharing. Keep sharing.

    Best software training institute in Chennai. Make your career development the best by learning software courses.

    rpa uipath training in chennai
    devops training in chennai
    cloud computing training in chennai

    ReplyDelete
  3. Your good knowledge and kindness in playing with all the pieces were
    very useful. I don’t know what I would have done if I had not
    encountered such a step like this.
    IT training institute in Chennai

    ReplyDelete
  4. Thanks for good blog Training for Machine Learning Certification in Coimbatore With our Machine Learning Certification Training in Coimbatore, you can acquire practical experience in one of the most sought-after fields. Through hands-on, real-world projects, this industry-focused curriculum aims to assist aspiring data professionals and engineers in mastering fundamental machine learning ideas, tools, and methodologies.

    ReplyDelete