Database sizes. 
Author Message
 Database sizes.

Can anyone help me with the following :
I have a database which has the total size of 6MB.It's log and data are on the
same device.(I know this is stupid,but it is only a database which I use for
testing these sorts of things.)

If I run     sp_spaceused         it says reserved=4064 KB.
If I now run sp_spaceused syslogs it says reserved=2868 KB.

I thought that those two numbers put together would give me the total amount of
space used in my database, but 4064+2868=7MB>6MB.

Does this mean that syslogs is NOT the size of the transaction log (what is it then) ?

Is it different if you have the log and data on different devices ?
I talked with our sa and he said that if you have got a database with log and data
separated, the total space used by data(+indexes) is given by sp_spaceused
       and the total space used by the trans. log is given by sp_spaceused syslogs.

I must say I'm very confused...

============================================================================
Per Walstrom                             |
The Royal Institute Of Technology        |
On assignment at :                       | Fax:    +46 8 719 29 00

S-126 25 Stockholm,Sweden                | Phone:  +46 8 719 28 16    
----------------------------------------------------------------------------
Opinions are my own and do not necessarily reflect those my employers.
============================================================================



Sat, 30 Dec 1995 02:37:37 GMT
 Database sizes.

In comp.databases.sybase Per Walstrom you write:

Quote:
>Can anyone help me with the following :
>I have a database which has the total size of 6MB.It's log and data are on the
>same device.(I know this is stupid,but it is only a database which I use for
>testing these sorts of things.)
>If I run     sp_spaceused         it says reserved=4064 KB.
>If I now run sp_spaceused syslogs it says reserved=2868 KB.
>I thought that those two numbers put together would give me the total
>amount of space used in my database, but 4064+2868=7MB>6MB.
>Does this mean that syslogs is NOT the size of the transaction log (what is
>it then) ?
>Is it different if you have the log and data on different devices ?  I
>talked with our sa and he said that if you have got a database with log and
>data separated, the total space used by data(+indexes) is given by
>sp_spaceused and the total space used by the trans. log is given by
>sp_spaceused syslogs.
>I must say I'm very confused...

Ok, you're confused because Sybase is not very clear in the manuals as to
what is going on with space allocation, nor is there model consistently
represented.

All bashing aside, your sa is not correct.  Please look at the script
$SYBASE/scripts/installmaster.  You should find a "create procedure"
statement for sp_spaceused.  If you specify no arg to sp_spaceused, then it
figures out the size of syslogs, then figures the size of everything else,
then adds them together.  This is independent of how the database is
orgranized, as can be verified by the fact that sysusages is not consulted
(other than to get the page size).

So, your problem is that the number returned by sp_spaceused includes
syslogs.

Sp_spaceused has bugs and does not give complete information.  The latest
Sybase EBF that I have does not fix all of the bugs.  So, I have written my
own version that has a different output format that is somewhat more useful.
It separates the log and data space calculations and is a heck of a lot
faster.  It is less flexible in that it will only report summary stats on an
entire database.  Anybody interested in this code?  Mail to me, and I will
see if my boss will let me publish it.

=-Dave-F->

The source is the best documentation.  Reading installmaster is very
enlightening.  Long live the SQL kung fu!
--
_   /|                                  Dave Feldman

=(___)=         Ok, cough!
   U                                    DFA : land of wonder and enchantment



Tue, 02 Jan 1996 12:12:14 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. data space (database size) how database size calculate for known record numbers

2. How to shrink the Database size and Database Device size

3. Device size and database size

4. Device size and database size

5. Database size bigger than device size???

6. Max database size vs max data file size

7. Log size vs Database size

8. Oracle7 database size limit (or tablespace size)?

9. dump size and database size

10. table size and database size in bytes

11. table size and database size in bytes

12. change database size after database was created


 
Powered by phpBB® Forum Software