开发者

SQL Server: why are sizes of different backups the same?

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:\Progra开发者_运维问答m 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!


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.


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜