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

Disk Capacities Expand / Collapse
Author
Message
Posted Saturday, February 5, 2011 6:45 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: 2 days ago @ 8:41 AM
Points: 39, Visits: 275
Comments posted to this topic are about the item Disk Capacities
Post #1059188
Posted Friday, October 12, 2012 12:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 1:41 AM
Points: 2, Visits: 210
Hi,
when ever i executed this script i am getting errors.
i am not getting o/p.
can you help me on this??

please check the errors below.

Msg 102, Level 15, State 1, Line 6
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 27
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 51
Incorrect syntax near ' '.
Post #1371911
Posted Friday, December 6, 2013 1:19 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:23 AM
Points: 6,365, Visits: 13,693
Drop the cursors and the calls to xp_fixeddrives and fsutil and use the following

wmic volume get capacity, "free space", name



-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs"
Post #1520444
Posted Friday, December 6, 2013 8:53 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Yesterday @ 2:20 PM
Points: 48, Visits: 215
A nice script.

Thanks



Post #1520627
Posted Friday, December 6, 2013 10:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, May 27, 2014 3:51 PM
Points: 4, Visits: 22
Hi, will this give results for all storage volumes and virtual drives associated with a NAS and VMs respectively, or is this for the drives on the machine (virtual or otherwise) which runs the SQL Server Db engine? Thanks!
Post #1520679
Posted Friday, December 6, 2013 2:37 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 2:53 PM
Points: 20, Visits: 75
I also got the line errors

when you copy and paste the script from the webbrowser (firefox in my case) into SSMS it does not seem to work.

I have now copied and pasted the text into notepad++ which revealed many of the spaces are defined as square boxes which normally refer to unrecognised text.

By doing a search and replace on all these square boxes and replacing them with a spacebar character, then copying and pasting this from notepad ++ into SSMS worked just fine.

This is a useful script for SQL Admins that if implemented correctly could help them check or even warn them when their SQL servers run out of disk space. However I normally find most organisations that run sql servers, also run other non sql servers and will have some means of monitoring disk space on all the servers.

Writing your own to monitor disk space, whilst fun, might suggest you have already been at the short end of the stick because they have not warned you about disk space shortage and you had a server stop responding because of lack of disk space.

As other servers on the network are quite often also bussiness critical, I would think it makes more sense ensuring the tool used for monitoring disk space accross the board (not just sql servers) is used instead.

Alternatively, since you are using cmdshell, why not setup scheduled tasks on all servers (not just SQL) that run at regular intervals, running batch files to collect the same information and placing it into one SQL server where reporting services can be used to send you a regular email of all servers (not just SQL) where disk space is below either 1GB or 1% of capacity.

T
Post #1520753
Posted Friday, December 6, 2013 11:04 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: 2 days ago @ 8:41 AM
Points: 39, Visits: 275
Hi Guys

This is very weird...

I believe I wrote this about 4/5 years ago and submitted it back then to SQLServerCentral... I have no idea why it is popping up now as a script of the day.

It is a little dated and a lot less relevant now days.

Heck, this info is now available in a quick query to to SQL's dmv's.

Strange?

Anyway, Happy SQL Adventuring!
Post #1520787
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse