Sp_spaceused Shows Negative Unallocated Space

Mar 1, 2005

Hi All,

When i run sp_spaceused on one of my database, PROD, it gives the following output

database_name: PROD
database_size: 4268.00 MB
unallocated space: -789.82 MB


reserved: 4654920 KB
data: 2929008 KB
index_size: 327272 KB
unused: 1398640 KB

Why is that the unallocated space is negative ?

On the drive where the datafiles resides there is enough free space . Also, the datafile and transaction are set to auto grow with unlimited file growth

FYI - the OS is Windows 2000 and the DB is SQL Server 2000 with SP3

Appreciate your time and help on this.

View 1 Replies


ADVERTISEMENT

Sp_spaceused With Negative Numbers?

Mar 1, 1999

Hello:

I have gotten the following information from sp_spaceused:

----------------------------------------------------------------------
database_name database_size unallocated space
------------------------------ ------------------ ------------------
EP_tran2 700.00 MB 273.21 MB

reserved data index_size unused
------------------ ------------------ ------------------ ------------------
437034 KB 295106 KB 1447796 KB -1305868 KB
--------------------------------------------------------------------

I unfortunately since this is for a test database that I have put the data and log on the same device.

My questions are:

1) Why do I have negative numbers?

2) Should I be concerned about this?

3) for a live database can I drop the log and put the log on another device? What do I need to do?

4) has anybody seen this before?

5)what can I use to get accurate numbers?

THanks. Any information will be greatly appreciated.

DAvid Spaisman

View 1 Replies View Related

Sp_spaceused Report Negative Number For Unused

May 20, 2000

Could some one help me to explain what does it means when I ran sp_spaceused on the database it reported ex. -15430kb for unused. Does this mean that the index ran out off space. Do I need to increase space for the database. I will try to run the dbcc check hope it will fix the problem.

Thanks.

View 1 Replies View Related

SQL 2K Unallocated Space Won't Free Up - HELP!

Nov 5, 2004

I've gone through the forum and have seen several others with a similar situation. I recently noticed my .mdf file grew to 200GB yet the data in the file is only about 40GB. I run sp_spaceused and get the following: database_size = 176GB, unallocated space = 134GB, reserved = 43GB, data = 17GB, index_size = 19GB, unused = 6GB.

I've tried "dbcc shrinkdatabase (mydb, truncateonly)", tried restarting server, tried running a maintenance plan including a reindex of the database, and I don't know what to do next.

Does anyone know how to free up this space?

View 2 Replies View Related

Unallocated Space In SQLSERVER

Aug 17, 2006

HI,

I am short of space on one of our sqlservers and I want to claim unallocated space for one of my databases and give it back to OS.

I guess it is relatively simple task to do but unfortunately I am unable to find such a command. Can somebody help me and provide me that command.

Rgds
Wilson

View 1 Replies View Related

Unallocated Space Anomaly

Jul 20, 2005

At my current workplace, whenever I check table sizes using the'reserved' column from sysindexes, or sp_spaceused, I get a total forall user tables which exceeds the physical size of the database.Running sp_spaceused with no parameteres, I get a NEGATIVE value forunallocated space in the database, but only see this if I return theresults in GRID format in QA (text format gives less output):DatabaseName DatabaseSize Unallocated Spacexxxxx_xxxxx11502.38 MB-4874.80 MBReserved Data index_size unused16602800 KB7013752 KB2381904 KB7207144 KBIf I re-run sp_spaceused with the @updateusage='TRUE' option, thisoutput gets corrected to:DatabaseName DatabaseSize Unallocated Spacexxxxx_xxxxx11502.38 MB2773.76 MBReserved Data index_size unused8770680 KB6928168 KB1808096 KB34416 KBwhich shows a substantial difference in the Reserved/Data/Index/Unusedsizes.This happens every day - any ideas about:1) Why this might be happening on such a large scale, and2) Is it conceivable that these discrepancies in space allocationinformation could be causing performance problems? I can imagine thatif the database is trying to locate free pages on extents yet itsinternal view of these doesn't match reality then this could impededata insertion.Offers anybody?

View 2 Replies View Related

Unallocated Space Due To Rebuilding Indexes

Sep 26, 2007


Hi all,
When I am rebuilding the indexes on the tables, I am getting lot of free space( unallocated) on the database.

Before rebuilding the indexes , the size of the database = 385 Gb
After rebuilding the indexes, the size jumps to = 572 Gb (i.e.) This means 187 Gb of unallocated space .

The Command use to rebuild indexes is:
USE [databasename]
GO
ALTER INDEX [PK_index] ON [dbo].[tablename] REBUILD WITH
( PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, SORT_IN_TEMPDB = ON, ONLINE = OFF )
GO

So, every time we rebuild indexes, we have to shrink the database
(or)
Is there anything else ,I should be doing.
Thanks.

View 4 Replies View Related

SQL Server 2008 :: Track Unallocated Space On Database?

Apr 1, 2015

I am trying to track unallocated space (because on my database growth is not kicking in) So using below query but not working!!! Is there any way I can track 'database size' and 'unallocated space' on a single database?

create table A(
Rundate DATETIME NOT NULL DEFAULT(GETDATE())
,DatabaseName varchar(100)
,Database_size varchar (100)
,unallocatedSpace varchar (100)
,reserved varchar(100)

[code].....

exec AdventureWork..sp_spaceused ------not working------

View 2 Replies View Related

Finding Database Sizes And Unallocated Space On A Server Wide Scale

Apr 22, 2008



Morning forum,

I'm having a problem to which I'm sure the answer is simple...

All I want is a list of databases on my server with their allocated size and the free space within. Something similar to the first table that sp_spaceused gives you but on a server wide scale.

As I say, I'm sure there's a simple solution out there, but alas Google has failed me.

Thanks in advance,

Dan.

View 4 Replies View Related

Sp_spaceused - Too Much Unused Space

Jul 20, 2005

On a production database, there is a 2GB database, when I runsp_spaceused it indicates a very high quanity of unused space. Thedatabase has been shrunk & free space sent to the OS. Why is thisvalue so high, what can I do to reclaim the space?database_name database_size unallocated space------------------------------------------------------------------------------DB_00001 2004.13 MB 49.64 MBreserved data index_size unused------------------ ------------------ --------------------------------1531248 KB 412720 KB 165168 KB 953360 KB

View 5 Replies View Related

Negative Unused Space

Mar 12, 2004

I wrote simple script to check space used by tables:

CREATE TABLE #SpaceUsed(
TableName NVARCHAR(128),
NoOfRows INT,
Reserved NVARCHAR(18),
Data NVARCHAR(18),
Index_Size NVARCHAR(18),
Unused NVARCHAR(18)
)
GO
sp_msforeachtable "INSERT INTO #SpaceUsed EXEC sp_spaceused '?'"

SELECT * FROM #SpaceUsed

SELECT
CAST(Sum(CAST(Replace(Reserved,' KB','') AS INT)) AS NVARCHAR) + ' KB' AS TotalReserved,
CAST(Sum(CAST(Replace(Data,' KB','') AS INT)) AS NVARCHAR) + ' KB' AS TotalData,
CAST(Sum(CAST(Replace(Index_Size,' KB','') AS INT)) AS NVARCHAR) + ' KB' AS TotalIndex_Size,
CAST(Sum(CAST(Replace(Unused,' KB','') AS INT)) AS NVARCHAR) + ' KB' AS TotalUnused
FROM #SpaceUsed

DROP TABLE #SpaceUsed


and one of results looks strange to me:

TableName NoOfRows Reserved Data Index_Size Unused
-------------------------------------------------------------------------------------------------------------------------------- ----------- ------------------ ------------------ ------------------ ------------------
T_TableXX 50081 38024 KB 37432 KB 640 KB -48 KB



Anyone know reason of such result (negative value of unused space)?

View 3 Replies View Related

Log Space Shows 0.0 Always...

Dec 8, 1998

Hello,

I have a typical problem in SQL Server 6.5.

We installed a database on Dell6100. Created a database of 300 MB device and 200 Mb of Log device.

After doing Data insertion and deletion operation on the database. It gave sys log full error.

When i check the Device size and Log size availabe both were showing 0.00 MB. But the actual data inserted was less than 2 MB. Then i did a Dump transaction with Truncate_Only and with No_Log also but the output is same.

Then i Ran the DBCC SQLPERF(LOGSPACE)...the output is

Database Name Log Size (MB) Log Space Used (%) Status
-------------------------------------------------------
DB1 200.0 100.0 8

Which means 100 % of Log space is used.

This result is same after restart of the SQl Server.


Can any body help me regarding this

ThanX
__Vijay VM

View 2 Replies View Related

Query Analyzer Shows Negative Numbers As Positive Numbers

Jul 20, 2005

Why does M$ Query Analyzer display all numbers as positive, no matterwhether they are truly positive or negative ?I am having to cast each column to varchar to find out if there areany negative numbers being hidden from me :(I tried checking Tools/Options/Connections/Use Regional Settings bothon and off, stopping and restarting M$ Query Analyer in betwixt, butno improvement.Am I missing some other option somewhere ?

View 7 Replies View Related

Log File Alert And Negative Free Space!?

Sep 24, 2007

We've got an alert setup on our production database to warn us when the log file(s) exceeds 7 gigs. The Alert is triggering:

"The SQL Server performance counter 'Log File(s) Size (KB)' (instance 'Lexus') of object 'SQLServer:Databases' is now above the threshold of 7000000.00 (the current value is 7057656.00)."

However, according to the file system, the database properties screen files, and properties tabs, the log files combined are at under 5 gigs so this alert should not be going off.

The scary part is, when going to right-click on the database, choosing "tasks" and going to "Shrink > Files", the "Free Space" shows negative numbers for the first log file:

Log 1
Currently Allocated space: 118.69 MB
Available Free Space: -5323.24 MB (-4485%)

Log 2
Currently Allocated space: 4853.13 MB
Available Free Space: 411.20 MB (7%)

Has anybody ever run into this? Should I be worried that there is a bigger issue at hand?

Thanks!

View 20 Replies View Related

Giant White Space Shows Up When Viewing In Report Manager Only

May 16, 2006

Hello

I have created a report that works how I want it in the visual studio 2003 designer. I have deployed it to our test box (sql server 2k, reporting services with sp2) and when we preview the report, there is a giant white space between the graph in the report and the matrix object below it. This white space was not in the designer. It only shows when previewing the report. If you print from the report manager, it does not print the white space.

Is there a way to remove it from the report manager when the report is previewed? I am sure users will complain when they see this.

Thanks.

Ben

View 2 Replies View Related

Reporting Services :: Horizontal Axis Show Last Value In First And Last Space When Sorting A-z But Shows Correctly When Sorting Z-a

Jul 10, 2015

SSRS 2012 - VS2010...The report compares two years with a sort order on a value that has been engineered based on text switched to int.  When sorting A-Z this is the result in the horizontal axis is: 5th, K, 1st, 2nd, 3rd, 4th, 5th..When sorting Z-A the result in the horizontal axis is:5th, 4th, 3rd, 2nd, 1st, PreK..Z-A is correct but A-Z sorting shows 5th as the start and end.  The magnitude of the PreK location is correct but the label is wrong on the A-Z sort order.  The sorting is implemented using the Category Group sorting option.

View 6 Replies View Related

SQL 2012 :: Agent Job History Shows Step Still Running But Shows Start And End Times?

Jul 1, 2015

I have a SQL Agent job that runs at 4:15 in the morning. The job has 5 steps, each step only runs if the preceding step succeeds. The second step, which calls an SSIS package that does the main processing, appears to finish as it goes on to the next step; however, when looking in 'View History' there are 2 entries for this step - the first one shows it as still running (Circled Green Arrow) but with a start and end time. The second entry says the job succeeded.

I have been seeing conflicts, such as deadlocks, with later jobs. I suspect this job is causing the conflicts - maybe the package is still running in the background instead of having actually completed?

what conditions a job step my be showing in the job history as both running AND completed successfully?

View 6 Replies View Related

Sp_spaceused

May 28, 2004

When I run sp_spaceused I will get something like:

database_name . database_size . unallocated space
------------------ ----------------- ------------------
. . . DBA . . . . . . . 2.50 MB . . . . . 0.07 MB


reserved . . . . . . data . . . . . . . index_size . . . . unused
------------------ ------------------ ------------------ ------------------
1720 KB . . . . . . . 888 KB . . . . . . 648 KB . . . . . .184 KB

Is there any way to load this info into a Table?
I'm having trouble because there are (2) result sets returned.

View 1 Replies View Related

Sp_spaceused

Oct 18, 2000

I am using the sp_spaceused system stored procedure to identify tables in my database that are large. I have two questions. Can anyone help me sort this list. I assume this is returned in clustered order, but I want to order the list by rows. Also, when I run this sp_spaceused stored proc, on some of my tables I get a negative value returned under the 'index_size' and 'unused' columns in my result set. How can this be.

View 1 Replies View Related

Sp_spaceused

Jan 12, 2000

I am looking for an accurate way to calculate database size and
unused space.

I do NOT want the log size calculated into the database size or
the space unused.

Thank you

View 2 Replies View Related

Sp_spaceused

Sep 16, 2002

on some of our sql 6.5 databases the space available is shown as 0MB. I realise that I must run sp_spaceused to get an accurate result, but the results I then get are slightly confusing. All I want to know is the space left in both the database and the log - can I get a reading for both?. Sometimes the unused space is shown as a negative number. Can anyone advise since books online is fairly unspecific.

(the total script that i run incidentaly is:

exec sp_spaceused
go
DBCC checktable (sysindexes)
go
DBCC checktable (syslogs)
go
exec sp_spaceused @updateusage=true
go)

Thanks

View 3 Replies View Related

Sp_spaceused

Jul 27, 1999

Can someone please explain the outputs below of the sp_spaceused stored procedure.

database_name database_size unallocated space
------------------------------ ------------------ ------------------
Employees 5054.00 MB 1441.93 MB

reserved data index_size unused
------------------ ------------------ ------------------ ------------------
3698758 KB 2770552 KB 917274 KB 10932 KB

View 1 Replies View Related

Sp_spaceused

Jun 29, 2001

hi,
I used sp_spaceused 'owner.tablename' and it shows index size as 24kb whereas there is no index on this table.
I thought may be it's not showing the right statistics so I update the statistics but it is still showing the same .
what is happening?
I am using SQl 2k/Win2k.
TIA.

View 2 Replies View Related

Sp_spaceused

Sep 7, 2004

can someone please explain what reserved, data and unused represent?

View 4 Replies View Related

Sp_spaceused

Jul 20, 2005

Hi,In our environment sp-spaceused returns:Allocated: 500Unallocated: -100Enterprise Database Taskpad shows that our total database size = 400 MB(320 used; 80 unused)Windows Explorer shows also that MDF file is more or less 400 MB.What does sp_spaceused exactly ???How do I SELECT the 320;80 of the taskpad with a query ???Greetings,Arno de Jong, The Netherlands.

View 1 Replies View Related

Question On Sp_spaceused

Nov 2, 1999

What does sp_spaceused show nonzero sizes for data, reserved and index size when the table is empty?
It also does this on 6.5.

View 1 Replies View Related

Sp_spaceused Riddle....

Mar 15, 1999

I have ran sp_spaceused (SQL 6.5 SP4) on my database (4000MB Data, 500 Log) and received the following output for "Reserved" : 4412390 KB. Note that this is more than 4000MB. I checked and made sure my data and log were truly separated...

Just to make sure, I added 2000MB more data space. Sp_spaceused now returned the following for reserved: 3493220 KB.

I am wondering why the allocation dropped, while no user activity was taking place during the process of growing the database....sp_spaceused reported data size first at 2725532, then at 1806314. Any ideas? A bug? Did the database fill up and begin using log pages...?

Any help is GREATLY appreciated...

Thanks!

Dean

View 2 Replies View Related

Sp_spaceused Result

Oct 26, 2006

Hi,
I ran sp_spaceused against a DB table, and got -160K in the field "unused". If anybody can explain what this negative number means?
We have a problem with performance. It's extremly slow. The table contains 600,000 records. Even simple select * from <table> (table scan) takes 6 minutes. This is SQL Server2000.
Any help is appreciated.

View 5 Replies View Related

Enhanced Sp_spaceused

Aug 16, 2005

I can't remember if I posted this already or not:

CREATE PROCEDURE sp_space @sortbyrows bit=0 AS
SET NOCOUNT ON
select cast(object_name(id) as varchar(50)) AS name, sum(CASE WHEN indid<2 THEN rows END) AS rows,
sum(reserved)*8 AS reserved, sum(dpages)*8 AS data, sum(used-dpages)*8 AS index_size, sum(reserved-used)*8 AS unused
from sysindexes with (nolock) where indid in(0,1,255) and id>100
GROUP BY id with rollup
ORDER BY CASE WHEN @sortbyrows=1 THEN sum(CASE WHEN indid<2 THEN rows END) ELSE sum(reserved)*8 END desc

Usage:

EXEC sp_space --show stats sorted by reserved space size
EXEC sp_space 1 --show stats sorted by row count

It basically displays the results of sp_spaceused, but broken out by each table, and it rolls it up to a grand total. Naturally, for the most accurate results you should run DBCC UPDATEUSAGE before running this sproc.

View 10 Replies View Related

Sp_spaceused Equivalent In CE?

Oct 3, 2007

I am looking for a way to programatically determine the size of the data contained in a table, much like the sp_spaceused proc in SQL Server.


Thanks.

View 3 Replies View Related

Sp_spaceused Question !

May 10, 2007

name
rows
reserved
data
index_size
unused

Table1
2553136
294424 KB
293176 KB
1072 KB
176 KB





When I run sp_spaceused on a table called Table1, I get numbers as shown above.



I have a clustered Index on a datetime column AND that is the only index on the table.



So according to my calculations Index Size should be 2553136 (No. Of Rows) X (8 (DataType of DateTime) + 4 (Uniquifier) )



So the number I should be seeing in the Index Size column = 2553136 * 12 = 30637 KB, why am I only seeing 1072 KB ?



Where am I going wrong in my calculations.



To be more specific -- how do I calculate the Size Occupied by Indexes on a Particular Table ??



Thanks

View 5 Replies View Related

EXEC Sp_msforeachtable 'sp_spaceused ''?'''

Feb 25, 2008

What does the following SQL code mean?
 EXEC sp_msforeachtable 'sp_spaceused ''?'''

View 2 Replies View Related

Quick Question On Sp_spaceused

Jun 10, 2004

I executed sp_spaceused on the db ang got following results
database_name:myDB
database_size: 1017.75 MB
unallocated space :104.13 MB

reserved : 309752 KB
data : 306832 KB
index_size : 1936 KB
unused : 984 KB

If we add reserved,data,index_size and unused up , we will get around 600MB.But the database has size of 1G. Could anyone tell me why?

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved