Actual Size of my database?

  • Guys

    I am not a DBA but a developer so please bear with me.

    The size of my db is 10929.50 MB (10GB), but when I took the backup and compressed it, the size of file was reduced to about 3.5GB.

    I detached the db and zipped (.mdf + .ldf) using 7zip and the size of zip file was also around 3.5 GB.

    I am wondering why is that and why my db size is showing 10GB. Is my db inflated?

    By the way Recovery model is set to Simple.

    I would really appreciate if someone can shed some light on this.

    Regards

    Mitesh

  • When you compress the database, the compressed files should be smaller then the original files. It has nothing to do with how full the database is. This is what compression does. If you want to check how much space is used in the database, you can use sp_spaceused procedure.

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • The database size is allocated size, not data size. SQL Server, by design, maintains empty space within the data and log files in order to allow for growth of your database without having to go to the disk to allocate more space. It's normal. You'll regularly see the backup size different than the storage size. You can get a quick idea about the allocated size, used size and unallocated amounts by querying sys.dm_db_file_space_usage.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply