Geeks With Blogs

News For most companies, development and operation teams play a game of volleyball passing blame on each other when service/product has issues. Lack of communication and understanding between the two, causes costly and timely problems for every company. DevOps is not a title, nor is a position. DevOps is culture represented by a white flag waved from both directions. Cooperation and Communication are at the heart of DevOps. It tears down the wall and pride of these two very valuable entities inside a company and unleashes the power of teamwork towards a common goal!
Erald Gjoni
Here is a quick query to identify your db status when it comes to disk space:

SELECT as filegroupname, AS 'FileName' , 
physical_name AS 'PhysicalDBName', 
size/128 AS 'SizeInMB', 
size/128.0 - CAST(FILEPROPERTY(, 'SpaceUsed') AS int)/128.0 AS 'RemainingSpaceInMB' , 
CAST(FILEPROPERTY(, 'SpaceUsed') AS int)/128.0 AS 'SpaceUsedInMB', 
(CAST(FILEPROPERTY(, 'SpaceUsed') AS int)/128.0)/(size/128)*100. as 'SpaceUsed'
FROM sys.database_files df 
LEFT OUTER JOIN sys.data_spaces ds  
ON df.data_space_id = ds.data_space_id;
Posted on Sunday, May 25, 2014 8:22 PM sql , t-sql , database size | Back to top

Comments on this post: DB space check

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Erald Gjoni | Powered by: