Monday, October 10, 2011

How Big is my DB?

I get this question alot.

The most simple way is to access your SQL manangement studio and look at the properties of the DB or using powershell just copy and paste the code.

 SQL manangement Studio



More fun way is to learn more about powershell

First we list the DB, then sort and calculate size in MB, add better label and finally sort my name.  Enjoy

Get-spdatabase
Get-spdatabase | sort-object disksizerequired | Format-Table name,disksizerequired
 Get-spdatabase | sort-object disksizerequired | Format-Table name,{$_.disksizerequired/1024/1024}
 Get-spdatabase | sort-object disksizerequired  |  Format-Table name, @{label = "Size in MB"; Expression = {$_.disksizerequired/1024/1024}}
 Get-spdatabase | sort-object name  |  Format-Table name, @{label = "Size in MB"; Expression = {$_.disksizerequired/1024/1024}}
References

http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=193

No comments:

Post a Comment