|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, October 30, 2012 2:37 PM
Points: 8,
Visits: 247
|
|
I am confused about the part "SQLCMD that uses the raiserror command to send messages to the Windows Event Application Log". Is this a job step executed as Operating System (CmdExec) or is this something else?
Thanks!
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 7:10 AM
Points: 485,
Visits: 1,568
|
|
DBA_Oshvegas (1/26/2011) I am confused about the part "SQLCMD that uses the raiserror command to send messages to the Windows Event Application Log". Is this a job step executed as Operating System (CmdExec) or is this something else?
Thanks!
its executed from within the VB Script. same way it would work from a DOS prompt.
you could open a cmd prompt where SQL had been installed and run SQLCMD.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, October 30, 2012 2:37 PM
Points: 8,
Visits: 247
|
|
Ahhhhhhhhhhhhhh. Sorry, not a VBScript guy and had a bit of a brain freeze this afternoon while stepping through your process.
Thanks!!
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, February 20, 2013 9:10 AM
Points: 2,
Visits: 154
|
|
| Nice and very helpful article
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Saturday, May 11, 2013 8:40 PM
Points: 33,
Visits: 145
|
|
DECLARE @CPU_BUSY int, @IDLE int, @seconds int, @secondsString varchar(50) SELECT @CPU_BUSY = @@CPU_BUSY, @IDLE = @@IDLE WAITFOR DELAY ''000:00:01''
set @seconds = 0
WHILE (SELECT (@@CPU_BUSY - @CPU_BUSY)/((@@IDLE - @IDLE + @@CPU_BUSY - @CPU_BUSY) * 1.00) *100 AS CPUBusyPct) > 80 AND @seconds < 55 BEGIN set @seconds = @seconds + 1 SELECT @CPU_BUSY = @@CPU_BUSY, @IDLE = @@IDLE WAITFOR DELAY ''000:00:01'' if @seconds % 10 = 0 BEGIN -- DO Something like send an email END END
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 7:10 AM
Points: 485,
Visits: 1,568
|
|
Hey Vadim,
thanks for the script. however, it presents a bit of a problem when you have multiple instances on a server. it also does not account for 'other' CPU hogs. i have had to deal with things like anti-virus engines eating up 90% of the CPU. now even though as a DBA, it might not be my job to worry about anti-virus software, i do need to be aware when the SQL server is struggling to process requests because of it.
thanks.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Saturday, May 11, 2013 8:40 PM
Points: 33,
Visits: 145
|
|
Geoff,
I've been using it more as a generic CPU indicator. It let's me know when things are crossing the threshold and for how long. If you want to go beyond that you should probably get a more robust monitoring tool.
Vadim
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 9:16 AM
Points: 89,
Visits: 341
|
|
I think
i = 0 Do While i < 1
Should be
i = 0 Do While i < 10
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Monday, April 15, 2013 11:42 PM
Points: 424,
Visits: 55
|
|
|
|
|