May 26, 2007 at 12:24 pm
hi all,
Server name.......Database Name.....Datafile Size(MB).....Log File Size(MB)......DatabaseSize(MB)
Database Size(GB)
Disk Space Total (GB) Available (MB) Available (GB)
C
D
E
i am trying generate script which helps me get an out put in the above manner.
i guess dbcc sqlperf(logspace),exec xp_fixeddrives can be used please guid me in right way.
Thanks in advance.
May 26, 2007 at 6:45 pm
What do you want to do with partioned files and NDF files? And, what do you need this for?
--Jeff Moden
Change is inevitable... Change for the better is not.
May 26, 2007 at 6:55 pm
well i need to monitor growth of both log and data files.i need to maintain record
May 26, 2007 at 7:49 pm
This will do for each server... all I did was search for "database size" and about a zillion of these showed up...
http://www.sqlservercentral.com/columnists/mnash/monitoringdriveanddatabasefreespace.asp
--Jeff Moden
Change is inevitable... Change for the better is not.
May 29, 2007 at 7:05 am
I apologize in advance for pointing to another site, but:
http://education.sqlfarms.com/education/ShowPost.aspx?PostID=47
May 29, 2007 at 7:12 am
Very cool... thanks Omri.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 29, 2007 at 3:43 pm
I would suggest to add "DBCC UPDATEUSAGE" into that script.
I saw several times negative values returned by sp_helpfiles.
_____________
Code for TallyGenerator
May 29, 2007 at 10:32 pm
Yep... I agree... sorry I missed that...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 30, 2007 at 9:28 am
Sergiy,
You are correct, but this brings up the never-ending tradeoff of getting more up-to-the-point data vs. potentially causing performance implications on the target server- I worked in some environments where DBCC UPDATEUSAGE significantly impacted performance on high-transaction servers, and it took a very long time to find the reason for the issue.
From a functionality and accuracy standpoint- you are 100% correct. Great input!
May 30, 2007 at 2:27 pm
You know, I would not probably mention this "minor improvement" if I would not see (with my own eyes) Reserved Space = -400MB.
Quite useful information, right?
And I suspect this thing is required for monitoring purposes. If that UPDATEUSAGE is absolutely required.
Otherwise it will indicate no changed usage for sometime, and one day it will indicate dramatical change. May lead people to wrong conclusions.
Performance hit? Yes, you're right. Applying any monitoring tool always involves some trade-off. That's something for them to consider.
_____________
Code for TallyGenerator
May 30, 2007 at 7:49 pm
Heh... wise old fellow once said "To measure something is to change its state." No exception with SQL... sometimes, ya just gotta bite the bullet to find out what's going on.
I ran UPDATEUSAGE on a pretty big db at work... yeah, there was a bit of a slow down, but no major impact and it didn't last long.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 8, 2007 at 5:32 am
Hi
Following script will give you file name, database name and its sizes.
SELECT
alt.filename [File Name]
,alt.name [Database Name]
,alt.size * 8.0 / 1024.0 AS [Originalsize (MB)]
,files.size * 8.0 / 1024.0 AS [Currentsize (MB)]
FROM master.dbo.sysaltfiles alt
INNER JOIN dbo.sysfiles files
ON alt.fileid = files.fileid
WHERE alt.size <> files.size
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply