James Murrell
asked on
What does Reserved space mean
What does Reserved space mean when running sp_spaceused ?
reason for asking a 4 year old db has grown 6gb in 30 days... normally only grows 100mb per month max
this is in sql 2000 sp4
reason for asking a 4 year old db has grown 6gb in 30 days... normally only grows 100mb per month max
this is in sql 2000 sp4
reserved space mean actual space hold by the sql engine, suppose 1GB is reserved space and used & indexed space is 500MB than you can truncate the file and can reclaim remaining space.
what is the sp_spaceused return, exactly?
do you have tables without clustered indexes?
what is the fragmentation of the tables?
and the "guess into the blue":
you are not eventually hit by sql injection, which appends some <script> into all the text/varchar fields, blowing up the size ?
do you have tables without clustered indexes?
what is the fragmentation of the tables?
and the "guess into the blue":
you are not eventually hit by sql injection, which appends some <script> into all the text/varchar fields, blowing up the size ?
ASKER
ok run script below
results
name rows reserved data index_size unused
Audit_Booking_Plan 8365403 6574168 KB 1222632 KB 24 KB 5351512 KB
Have another 200 db same none ever had this
results
name rows reserved data index_size unused
Audit_Booking_Plan 8365403 6574168 KB 1222632 KB 24 KB 5351512 KB
Have another 200 db same none ever had this
create table #t
(
name nvarchar(128),
rows varchar(50),
reserved varchar(50),
data varchar(50),
index_size varchar(50),
unused varchar(50)
)
declare @id nvarchar(128)
declare c cursor for
select name from sysobjects where xtype='U'
open c
fetch c into @id
while @@fetch_status = 0 begin
insert into #t
exec sp_spaceused @id
fetch c into @id
end
close c
deallocate c
select * from #t
order by convert(int, substring(data, 1, len(data)-3)) desc
drop table #t
please answer all my questions :)
ASKER
sorry Angeleyes, was not able to remote access machine last night..
unsure about Clustered indexes
DBCC SHOWCONTIG scanning 'Audit_Booking_Plan' table...
Table: 'Audit_Booking_Plan' (209435820); index ID: 0, database ID: 9
TABLE level scan performed.
- Pages Scanned................... .......... ...: 161283
- Extents Scanned................... .......... .: 110618
- Extent Switches.................. .......... ..: 110617
- Avg. Pages per Extent.................... ....: 1.5
- Scan Density [Best Count:Actual Count].......: 18.23% [20161:110618]
- Extent Scan Fragmentation ...................: 12.60%
- Avg. Bytes Free per Page.....................: 4917.9
- Avg. Page Density (full).................... .: 39.24%
unsure about Clustered indexes
DBCC SHOWCONTIG scanning 'Audit_Booking_Plan' table...
Table: 'Audit_Booking_Plan' (209435820); index ID: 0, database ID: 9
TABLE level scan performed.
- Pages Scanned...................
- Extents Scanned...................
- Extent Switches..................
- Avg. Pages per Extent....................
- Scan Density [Best Count:Actual Count].......: 18.23% [20161:110618]
- Extent Scan Fragmentation ...................: 12.60%
- Avg. Bytes Free per Page.....................:
- Avg. Page Density (full)....................
ASKER
apologies major problems kept me away
do you have tables without clustered indexes? only one one that table no other clustered on any table
do you have tables without clustered indexes? only one one that table no other clustered on any table
confused.... do your tables have clustered indexes or not?
all?
all?
ASKER
only table called Audit_Booking_Plan has clustered index
I see.
please get a clustered index on all the tables.
please get a clustered index on all the tables.
ASKER
how would that help? sorry to ask something i should already know
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks once again angeleyes.......
ASKER
where would we be without you angeleyes