Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Actual Size of my database? Expand / Collapse
Posted Wednesday, October 24, 2012 4:40 AM


Group: General Forum Members
Last Login: Monday, March 23, 2015 5:21 AM
Points: 11, Visits: 95
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.



Post #1376404
Posted Wednesday, October 24, 2012 4:55 AM


Group: General Forum Members
Last Login: 2 days ago @ 7:13 AM
Points: 2,199, Visits: 6,042
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.


To know how to ask questions and increase the chances of getting asnwers:

For better answers on performance questions, click on the following...
Post #1376407
Posted Wednesday, October 24, 2012 6:31 AM



Group: General Forum Members
Last Login: Yesterday @ 12:29 PM
Points: 17,173, Visits: 32,140
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
The Scary DBA
Author of:
SQL Server Query Performance Tuning
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1376436
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse