tags:

views:

39

answers:

2

I am running a script every day (only 2 days so far) to back up my database:

sqlcmd -E -S server-hl7\timeclockplus -i timeclockplus.sql
move "C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\*.*" w:\

Why is it that backups from two different dates have the SAME EXACT size in bytes?? I know for a fact that the database was definitely changed!

+4  A: 

The database files (*.mdf, *.ldf) are allocated in chunks - e.g. they're using a given number of megabytes, until that space is filled up, and then another chunk (several megabytes) is allocated.

It would be really bad for performance to allocate every single byte you ever add to the database.

Due to this chunk-based allocation, it's absolutely normal to have a given size for a certain period of time - even if your database is being used and data is being added and deleted.

marc_s
Thus if you compress the backup files (use zip/7zip) you should see that they do actually vary as there is a varying volume of 'data' within them.
Joel Mansford
yes, but the backup only writes the allocated pages. If the .bak file is identical in size it would indicate that the same number of pages is in use, which is possible, but unlikely in an active database. I would definitely double check the backup script, see if it actually replaces the old backup or the two backups obtained so far aren't two copies of the same file. And ultimately, do a restore of the backup on a different machine, see what it contains.
Remus Rusanu
joel thank you very much very helpful cmoment
I__
+1  A: 

A SQL Server backup only contains pages of data. A page is 8k. If your changes day to day do not add or remove pages (eg deleting, adding) then the number of pages to backup stays constant.

Try a CRC check on the backup files to see what changes...

gbn
how do i perform this?
I__
3rd party tool: http://www.mindworkshop.com/crc.html
gbn