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

Need script that totals free disk space AND free space in files Expand / Collapse
Author
Message
Posted Friday, December 28, 2012 6:06 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: Yesterday @ 12:14 PM
Points: 596, Visits: 1,688
We have a number of ways, including Quest Spotlight in our case, to get either free space on the drives holding the data files, or the free space within the files, but no easy way to get both output in one query. It always includes manual editing of a spreadsheet to add up the two, and I think you really want both in addressing the need for more disk space -- for example you've created a new data file at 100GB and it starts out empty on a drive with 20GB free space. Before asking for more space you need to look at both, not just the 20GB free on disk.


Post #1400884
Posted Friday, December 28, 2012 10:26 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 4:38 PM
Points: 31,018, Visits: 15,453
The problem is that you are asking for two fundamentally different things. I think you'd have to combine two scripts, perhaps though some union to get this.

Here's one: http://www.sqlservercentral.com/scripts/Maintenance+and+Management/30881/

This might be the other.: http://www.sqlservercentral.com/scripts/Database+Maintenance/94850/







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1400972
Posted Friday, December 28, 2012 10:36 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 5:20 PM
Points: 17,600, Visits: 15,462
I think a powershell script would be your best friend for this kind of requirement.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1400975
Posted Friday, December 28, 2012 3:06 PM
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: Yesterday @ 12:14 PM
Points: 596, Visits: 1,688
Tried a few things including the suggested scripts from Steve. Since our production environment uses mount points and because sp_databases returns null for larger databases, etc etc, I'll probably just use our Quest spotlight tool. It will provide both disk free and free inside files, just not in one view. We only have one data file, which needs work, that has a substantial amount of free space in the file -- substantial meaning over 100GB, so free space on disk is probably good enough as something to watch, set up alerts, and request more disk space as needed.

Tried this powershell on our prod environment but it isn't reporting "inside" the mount points, just free space on the folder hosting the mount points.

Get-WmiObject -ComputerName Remoteserver -Class Win32_LogicalDisk | Select -Property DeviceID, @{Name=’FreeSpaceMB’;Expression={$_.FreeSpace/1MB} } | Format-Table -AutoSize



Post #1401077
Posted Friday, December 28, 2012 8:24 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 5:20 PM
Points: 17,600, Visits: 15,462
Here's one that is supposed to gather the mount point free space
http://www.powershellneedfulthings.com/?p=36




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1401111
Posted Tuesday, January 22, 2013 5:18 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, February 4, 2013 12:43 AM
Points: 10, Visits: 45
For free space monitoring and alert lepide's & redgate having excellent tool
in case you can check them

http://www.sqlservermanagement.net/

http://www.red-gate.com/products/dba/sql-monitor/
Post #1409963
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse