Checking space used in a database

Source: Internet
Author: User
Tags sybase
Checking space used in a database

To get a summary of the amount of storage space used by a database, executeSp_spaceusedIn the database:

sp_spaceused 
database_name                  database_size ------------------------------ ------------- pubs2                          2.0 MB  reserved      data          index_size      unused ------------- ------------- --------------- -------- 1720 KB       536 KB        344 KB          840 KB 

Table 6-2 describes the columns in the report.


Table 6-2: Columns in sp_spaceused output

Column

Description

Database_name

The name of the database being examined.

Database_size

The amount of space allocated to the databaseCreate databaseOrAlter database.

Reserved

The amount of space that has been allocated to all the tables and indexes created in the database. (Space is allocated to database objects inside a database in increments of 1 extent, or 8 pages, at a time .)

Data,Index_size

The amount of space used by data and indexes.

Unused

The amount of space that has been reserved but not yet used by existing tables and indexes.

The sum of the values inUnused,Index_size, AndDataColumns shoshould equal the figure inReservedColumn. SubtractReservedFromDatabase_sizeTo get the amount of unreserved space. This space is available for new or existing objects that grow beyond the space that has been reserved for them.

By runningSp_spaceusedRegularly, you can monitor the amount of database space available. For example, ifReservedValue is close toDatabase_sizeValue, you are running out of space for new objects. IfUnusedValue is also small, you are running out of space for additional data as well.

This article is copied from http://infocenter.sybase.com/help/index.jsp? Topic =/com. sybase. help. ase_15.0.sag2/html/sag2/sag2200.htm.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.