SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Need script that totals free disk space AND free space in files


Need script that totals free disk space AND free space in files

Author
Message
Indianrock
Indianrock
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

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



Steve Jones
Steve Jones
SSC Guru
SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)

Group: Administrators
Points: 328578 Visits: 20109
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
My Blog: www.voiceofthedba.com
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)

Group: General Forum Members
Points: 144021 Visits: 18651
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, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Learn Extended Events

Indianrock
Indianrock
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11489 Visits: 2460
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



SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)

Group: General Forum Members
Points: 144021 Visits: 18651
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, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Learn Extended Events

itsmemegamind
itsmemegamind
SSC-Enthusiastic
SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)

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