August 20, 2012 at 12:59 pm
Hello,
Before I run backup,can I check how big it will be?
Thank you
August 20, 2012 at 1:11 pm
Not really. You can get a general idea, in that it's usually smaller than the database (assuming free space in the data and log files).
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
August 20, 2012 at 4:03 pm
This will tell you the minimum size (the size of your MDF and NDF files). The backup, unless compressed, will never be less than this.
USE {myDB};
SELECT SUM(size/128) AS mb FROM sys.database_files WHERE type = 0
-- Itzik Ben-Gan 2001
August 20, 2012 at 4:23 pm
Actually it probably will be.
That query returns the total size of the DB files. A backup does not back up the entire file, just the used portion of it. So if you have a 10GB database that's only 50% allocated, the backup will (ignoring contribution from the log) be around 5GB in size.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 20, 2012 at 6:00 pm
GilaMonster (8/20/2012)
Actually it probably will be.That query returns the total size of the DB files. A backup does not back up the entire file, just the used portion of it. So....
Good catch. Did not think about unused space. :blush:
-- Itzik Ben-Gan 2001
August 20, 2012 at 10:16 pm
Use dbname
Go
Select count(Total_pages), count(used_pages) , sum( total_pages* 8) TotalPagesKb, sum(used_pages * 8 ) Usedpageskb from sys.allocation_units
I am not sure above query will help you 100%, but you may get an idea about of your backup size will be.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply