Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Monitoring File Sizes in SQL Server Expand / Collapse
Author
Message
Posted Thursday, October 26, 2006 11:27 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, June 22, 2011 8:36 AM
Points: 28, Visits: 6
Comments posted here are about the content posted at temp


Post #318451
Posted Monday, November 6, 2006 5:05 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, August 20, 2013 10:02 AM
Points: 1,547, Visits: 275

Roy,

Excellent article. 

Can this script be run for multiple servers?  Can I set the strComputer variable multiple times similar to the multiple databases?

Thanks,
John




Post #320588
Posted Monday, November 6, 2006 5:31 AM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Wednesday, January 2, 2013 12:15 PM
Points: 1,443, Visits: 711

Roy,

Pretty good article.

I have a little script I use to determine if I'm running out of space on each of the server drives and send me an email when the freespace gets below a threshold, rather than look at the space of each of the individual files.  This might be useful as well....

Mark

Post #320594
Posted Monday, November 6, 2006 7:28 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, September 15, 2014 9:17 AM
Points: 454, Visits: 879

I have no VB skills.  When you say "Type cscript //H:Cscript. This will make cscript the default so that to run a vbscript all you need to type is the yourScript.vbs at the prompt without the cscript preface.".  Default of what?  Since I have no VB background I want to make sure setting this as a default does not break any existing processes.

Thanks,    Dave

 




Post #320619
Posted Monday, November 6, 2006 7:35 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, September 13, 2013 8:20 AM
Points: 514, Visits: 55
Good article!  You can extend this concept to store the extracted data in a Dba database and then use scheduled report server reports.  I have used this concept to email weekly report server reports on overall hard drive space and individual database stats as described in this article.


Post #320622
Posted Monday, November 6, 2006 7:51 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Thursday, May 1, 2014 8:39 AM
Points: 692, Visits: 294

I moved that script into Excel, It Work like a charm!!

Thanks

Post #320631
Posted Monday, November 6, 2006 8:37 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, May 8, 2014 10:08 PM
Points: 358, Visits: 397

Works perfectly for smaller databases but the variables don't seem to hold GB sized files.  What is the syntax for defining a larger variable type instead of just the default?  The culprit is this line:

strFileMB = objFile.FileSize / CONVERSION_FACTOR

When objFile.FileSize is too big this displays blank for sime reason.  Commenting out the division part and just trying to print objFile.FileSize is also a blank so I suspect the problem is there.  How is that built in var defined and how can it be made to handle a large file size?

Post #320669
Posted Monday, November 6, 2006 11:06 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 30, 2013 9:07 PM
Points: 1,529, Visits: 824
Dave,

cscript //H:Cscript will make cscript the default script engine. Windows Script Host (WSH) is the program that runs scripts (VB scripts or javascripts) on Windows operating systems. WSH has two script engines. The default is the wscript engine and the alternate is the cscript engine. The main difference is that the wscript engine will send all of the text from a VB script WScript.Echo command to a dialog box that must be acknowledged by pressing an "OK" button while the cscript engine sends this text to the standard command line output in a cmd window (a.k.a DOS window). Setting the default engine to cscript will allow this VBScript to run without any user input.



Post #320737
Posted Monday, November 6, 2006 8:07 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, September 14, 2014 8:15 PM
Points: 347, Visits: 418

Nice easy to follow article.

I wonder if it would be possible (as I have no vb/coding experience either so going a little blind here), to monitor different instances and servers through the same page?

Post #320832
Posted Wednesday, November 8, 2006 1:18 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, August 10, 2010 4:54 AM
Points: 815, Visits: 32

Great article. I look forward to the next in the series.

I did have one problem. I tried the post-script code for adding the date and time to the filename, and got a Windows Script Host error.

Line: 10

Char: 1

Error: 'Invalid procedure call or argument: 'DatePart'

Code: 800A0005

Source Microsoft VBScript runtime error

 

I am running WSH v 5.6, so i am not sure what is causing the error.

 

David



If it ain't broke, don't fix it...
Post #321189
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse