Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Monitoring File Sizes in SQL Server


Monitoring File Sizes in SQL Server

Author
Message
rscarlson
rscarlson
SSC Journeyman
SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)

Group: General Forum Members
Points: 76 Visits: 6
Comments posted here are about the content posted at temp



laker_42
laker_42
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1639 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





SuperDBA-207096
SuperDBA-207096
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1751 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


DBADave
DBADave
Right there with Babe
Right there with Babe (795 reputation)Right there with Babe (795 reputation)Right there with Babe (795 reputation)Right there with Babe (795 reputation)Right there with Babe (795 reputation)Right there with Babe (795 reputation)Right there with Babe (795 reputation)Right there with Babe (795 reputation)

Group: General Forum Members
Points: 795 Visits: 1104

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





Hugh Thomas
Hugh Thomas
Mr or Mrs. 500
Mr or Mrs. 500 (544 reputation)Mr or Mrs. 500 (544 reputation)Mr or Mrs. 500 (544 reputation)Mr or Mrs. 500 (544 reputation)Mr or Mrs. 500 (544 reputation)Mr or Mrs. 500 (544 reputation)Mr or Mrs. 500 (544 reputation)Mr or Mrs. 500 (544 reputation)

Group: General Forum Members
Points: 544 Visits: 57
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.



P@
P@
Say Hey Kid
Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)

Group: General Forum Members
Points: 702 Visits: 296

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

Thanks


magarity kerns
magarity kerns
SSC-Addicted
SSC-Addicted (454 reputation)SSC-Addicted (454 reputation)SSC-Addicted (454 reputation)SSC-Addicted (454 reputation)SSC-Addicted (454 reputation)SSC-Addicted (454 reputation)SSC-Addicted (454 reputation)SSC-Addicted (454 reputation)

Group: General Forum Members
Points: 454 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?


James Rochez
James Rochez
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1539 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.



TroyG
TroyG
SSC-Addicted
SSC-Addicted (413 reputation)SSC-Addicted (413 reputation)SSC-Addicted (413 reputation)SSC-Addicted (413 reputation)SSC-Addicted (413 reputation)SSC-Addicted (413 reputation)SSC-Addicted (413 reputation)SSC-Addicted (413 reputation)

Group: General Forum Members
Points: 413 Visits: 504

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?


David le Quesne
David le Quesne
SSC Eights!
SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)

Group: General Forum Members
Points: 935 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...
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search