sp_helpsegment

Description

Reports information about a particular segment or about all segments in the current database.

Syntax

sp_helpsegment [segname]

Parameters

segname

is the name of the segment about which you want information. If you omit this parameter, information about all segments in the current database appears.

Examples

Example 1

Reports information about all segments in the current database:

sp_helpsegment

segment name                       status
------- ------------------------------ ------
      0 system                          0
      1 default                         1
      2 logsegment                      0

Example 2

Reports information about the segment named order_seg, including which database tables and indexes use that segment and the total number of pages, free pages and used pages on the segment:

sp_helpsegment order_seg

segment name                           status 
------- ------------------------------ ------ 
      3 order_seg                       0 

device                 size           free_pages
---------------------- -------------- ----------- 
tpcd_data1             25.0MB                8176 
tpcd_data2             25.0MB                8512 
tpcd_data3             25.0MB                8392 
tpcd_data4             25.0MB                8272 
tpcd_data5             25.0MB                8448 
tpcd_data6             25.0MB                8512 

table_name             index_name             indid
---------------------- ---------------------- ------ 
orders                 orders                  0 

total_size     total_pages free_pages  used_pages
-------------- ----------- ----------- ----------- 
150.0MB              76800       50312       26488

Example 3

Reports information about the default segment. The keyword default must be enclosed in quotes:

sp_helpsegment "default"

Example 4

Reports information about the segment on which the transaction log is stored:

sp_helpsegment logsegment

segment name                       status 
------- ------------------------------ ------ 
      2 logsegment                      0 

device                 size              free_pages
---------------------- ----------------- ----------- 
tpcd_log1              20.0MB                  10200 

table_name             index_name                indid
---------------------- ------------------------- ------ 
syslogs                syslogs                    0 

total_size        total_pages free_pages  used_pages
----------------- ----------- ----------- ----------- 
20.0MB                  10240       10200          40 

Usage

Permissions

Any user can execute sp_helpsegment.

See also

Commands create index, create table

System procedures sp_addsegment, sp_dropsegment, sp_extendsegment, sp_helpdb, sp_helpdevice, sp_placeobject