Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to interprete the unused space ?


How to interprete the unused space ?

Author
Message
SQL ORACLE
SQL ORACLE
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1679 Visits: 1314
In the properties of a user database, we can obtain the database size and the available space. We can shrink the database such that the available space is zero.

However, if we execute sp_spaceused against this database, we can see the unused space is not zero.

How to interprete the unused space in executing the stored procedure?
Is there any way in removing the unused space?

Many thanks in advance for any input.
John Mitchell-245523
John Mitchell-245523
SSCrazy Eights
SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)

Group: General Forum Members
Points: 9156 Visits: 15541
There's a limit to how small you can shrink a database. I can't remember off the top of my head what it its - I think it's either the size of the model database or the size of the database when it was created?

Why do you want to do this, anyway? If you shrink the database, it will only grow again, unless you're going to set it as read only.

John
Bobby Glover
Bobby Glover
SSC Veteran
SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)

Group: General Forum Members
Points: 225 Visits: 751
Are you talking about a production db. I would not shrink a production db POINT BLANK.
Bobby Glover
Bobby Glover
SSC Veteran
SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)SSC Veteran (225 reputation)

Group: General Forum Members
Points: 225 Visits: 751
The auto grow setting on the db has been triggered at some point and the file/s have been extended. Allowing data to be written into the free space. If you shrink it the db will grow again anyway. If you lower the setting it will extend the file more frequently at a cost of performance each time.

Make sure the auto grow is set to an appropriate amount of MB and not %. All dbs should have a decent amount of free space to grow into.

See it like this: Its the same as buying clothes for small children. You never buy clothes that just fits today always buy the size up so they can grow into it.
SQL ORACLE
SQL ORACLE
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1679 Visits: 1314
John Mitchell-245523 (3/20/2013)
There's a limit to how small you can shrink a database. I can't remember off the top of my head what it its - I think it's either the size of the model database or the size of the database when it was created?

Why do you want to do this, anyway? If you shrink the database, it will only grow again, unless you're going to set it as read only.

John

Thank you so much for your input promptly.

If your statement is true, then the info on the properties of a database is confusing. The info on the properties of a database confuses people when they refer to the results when executing the sp_spaceused.

The setting in the model system database is used to set the default values. We may change any setting when creating any database, and also, we can change these settings after creating the database.

Shrinking the database such that it has zero available space is requested by our users. They use ithe database for creating reports.

Once again, tons of thanks to you.
SQL ORACLE
SQL ORACLE
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1679 Visits: 1314
Bobby Glover (3/20/2013)
Are you talking about a production db. I would not shrink a production db POINT BLANK.

Thank you for your input. Unfortunately, I am asking a solution not asking why I want to do so.
SQL ORACLE
SQL ORACLE
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1679 Visits: 1314
Bobby Glover (3/20/2013)
The auto grow setting on the db has been triggered at some point and the file/s have been extended. Allowing data to be written into the free space. If you shrink it the db will grow again anyway. If you lower the setting it will extend the file more frequently at a cost of performance each time.

Make sure the auto grow is set to an appropriate amount of MB and not %. All dbs should have a decent amount of free space to grow into.

See it like this: Its the same as buying clothes for small children. You never buy clothes that just fits today always buy the size up so they can grow into it.

Thank you for your input.
After executing the sp_spaceused stored procedure, I checked the properties of the database, the available space is still zero.
The database is used for creating reports, no data modification occurs.
John Mitchell-245523
John Mitchell-245523
SSCrazy Eights
SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)

Group: General Forum Members
Points: 9156 Visits: 15541
SQL ORACLE (3/20/2013)Shrinking the database such that it has zero available space is requested by our users. They use ithe database for creating reports.

You're the database professional - it's OK, indeed expected, for you to tell users that they are making an inappropriate request. Users should only be concerned what data is in the database; management of free space is your job.

Unfortunately, I am asking a solution not asking why I want to do so.

Finding out why you want to do something helps us to understand your problem, and perhaps even propose a solution that you hadn't considered.

John
Lynn Pettis
Lynn Pettis
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27039 Visits: 38151
You do realize that shrinking a database will fragment the indexes used by the queries run to generate the reports and that this will impact the performance of the reporting database.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
arnipetursson
arnipetursson
SSC-Addicted
SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)SSC-Addicted (403 reputation)

Group: General Forum Members
Points: 403 Visits: 1019
Unused space returned by sps_spaceused will almost never be zero.
BOL says: Total amount of space reserved for objects in the database, but not yet used.

This is extents or pages that have been allocated to an objects but are not completely full.
This is particularly true of extents (8 pages). An extent may be reserved for a given object but may have as many as 7 pages free.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search