Thursday, February 9, 2012

Actual size of database

My database size is of 1500 mb and actual data is not of 1500 mb the data
space available is showing 100 mb , i have done dbcc checkbd on the database
but still the it isnot showing actual size there is one more commond to
resize the database can anbody tell me
--
Yousuf Khan
ProgrammerYousuf wrote:
> My database size is of 1500 mb and actual data is not of 1500 mb the
> data space available is showing 100 mb , i have done dbcc checkbd on
> the database but still the it isnot showing actual size there is one
> more commond to resize the database can anbody tell me
If you need to shrink the data of log files because they have grown much
too large for what your database requires, you can use DBCC SHRINKFILE.
Having extra space in the data and log files is a good idea as auto-grow
operations are very expesinsive.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Hi,
Use the below command to get the actual free space:-
For Data and Index
use dbname
go
sp_spaceused @.updateusage='true'
For Transaction log
DBCC SQLPERF(LOGSPACE)
Based on the outcome you can shrink the MDF and LDF file seperately.
Steps:-
1. Backup the transaction log (Backup Log in books online)
2. Now shrink the files
dbcc shrinkfile('logical_mdf_name',_size)
3. Shrink the LDF file
dbcc shrinkfile('logical_ldf_name',_size)
4. After this check the size again
use dbname
go
sp_spaceused @.updateusage='true'
For Transaction log
DBCC SQLPERF(LOGSPACE)
Thanks
Hari
SQL Server MVP
"Yousuf" <yousuf.yk@.gmail.com> wrote in message
news:B062771E-F552-4EBE-8F6E-2E2F0BD359EA@.microsoft.com...
> My database size is of 1500 mb and actual data is not of 1500 mb the data
> space available is showing 100 mb , i have done dbcc checkbd on the
> database
> but still the it isnot showing actual size there is one more commond to
> resize the database can anbody tell me
> --
> Yousuf Khan
> Programmer|||thanks hari
being in the current database
if use DBCC UPDATEUSAGE will it be ok
or shall i go as per your advise
Yousuf Khan
Programmer
"Hari Prasad" wrote:

> Hi,
> Use the below command to get the actual free space:-
> For Data and Index
> use dbname
> go
> sp_spaceused @.updateusage='true'
> For Transaction log
> DBCC SQLPERF(LOGSPACE)
> Based on the outcome you can shrink the MDF and LDF file seperately.
>
> Steps:-
> 1. Backup the transaction log (Backup Log in books online)
> 2. Now shrink the files
> dbcc shrinkfile('logical_mdf_name',_size)
> 3. Shrink the LDF file
> dbcc shrinkfile('logical_ldf_name',_size)
> 4. After this check the size again
> use dbname
> go
> sp_spaceused @.updateusage='true'
>
> For Transaction log
> DBCC SQLPERF(LOGSPACE)
> --
> Thanks
> Hari
> SQL Server MVP
> "Yousuf" <yousuf.yk@.gmail.com> wrote in message
> news:B062771E-F552-4EBE-8F6E-2E2F0BD359EA@.microsoft.com...
>
>

No comments:

Post a Comment