Link to home
Start Free TrialLog in
Avatar of QPR
QPRFlag for New Zealand

asked on

Querying log size

I'm about to write a script to tell me the log size before/after some events.
So I was looking into the sys.xxx to see where I could find the one for log size and came up with
select * from sys.database_files
This tells me the log is 3163192 (31GB) yet when I double check this with windows explorer the log (file size) is 25GB.
I have right clicked and ensured the size on disk is also 25GB.
When I look at the disk space usage reports it says the log is 24.7GB and 99.3% unused.

Why the huge size difference between what windows explorer tells me and what database_files says.
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

which column of sys.database_files did you check in order to determine the size?
ASKER CERTIFIED SOLUTION
Avatar of Rimvis
Rimvis
Flag of Lithuania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of QPR

ASKER

ahhh I see I was using select size/1000 and assumed I was dealing with actual file size.
Points split:
Rimvis for pointing out my problem and vinurarj for reminding me about sp_helpdb which I will now use