psListSegments

Description

    This program lists all the segments of a database, the objects on the segments,
the size of the objects on each segment, the distribution of segments on Sybase
logical devices, and the distribution of the objects themselves on Sybase logical devices.
You must be 'sa' to run this program.

 

Syntax

psListSegments -Sserver -Uusername -Ppassword -Ddatabase
-Ee_mail_address -Tsegment_threshold -Ysybase_execution_priority
-Foutput_file
-Ooptions

 

Arguments

-S

Sybase Server Name

-U

Sybase User Name

-P

Sybase User's Password

-D

Sybase Database

-E

E-mail address to where psListSegments sends notification when

-T

Threshold. Threshold = (pages used)/(total pages available to segment)

-Y

Priority ('high', 'medium' or 'low')

-F

Name of output file [standard output]

-O

Options

 

Options

s

Do NOT report segment total summary.

f

Do NOT report the disk fragments where the segments reside.

t

Do NOT report the names of the tables and indices on the disk fragments.

d

Report the distribution of individual objects on the disk fragments.

o

Report the OAM structures.

 

Environment Variables Behind the Scenes

DSQUERY

When -S is not specified

SYB_USER

When -U is not specified

SYB_PASS

When -P is not specified

SYB_DATABASE

When -D is not specified

PS_SYSMSG_FILE

Name of the tool's messages file

 

Notes

     A disk fragment equates to a row in the master.dbo.sysusages table.  Each time you
alter a database, you create a disk fragment.  A single logical device may have several
fragments.
     psListSegments finds the location of every data block of a table and index.
For every disk fragment, psListSegments sums the data block sizes.   Each disk
fragment belongs to one or more segments.   In this fashion, psListSegments computes
the total space allocated for a segment and how much space is left.
     You can use this information to plan ahead for extending segments and adding new
devices for your database.   To get an overview of what devices your ASE database server
is currently using, run psListDevices.
     This program is also good for spotting one extremely common DBA blunder and one
Sybase white lie.   The DBA blunder is this:
*   A DBA has loaded the database with a dump of the database of a prior fragment or
    segment configuration.   For example, the dump came from the database before it
    had been 'alter'ed.   Or, the dump came from the database when it had 3 segments
    and the current one as 4.   When this happens,  this program will report all sorts
    of crazy numbers.   You'll get negative numbers of allocated pages, segment map
    errors, and pages that do not belong to any segment (non-pool pages).   The way out of
    this mess is to use psCopySchema to copy the data definitions and data from your
    misconfigured database to a new database.

The White Lie

*   Sybase says, 'When you move a clustered index, the entire table moves with it.'
    Well, that is not true.   You will see that the entire table moves with the
    clustered index,  EXCEPT for the table's initial allocation page.   If you move
    the clustered index from segment A to segment B, you will still find a single
    allocation page of your table remaining on segment A.   Sybase will assign your
    table and clustered index to segment B, but that one page will be left behind.  That
    one page will not belong to the table's new segment.  It will not belong to any
    particular segment.  I call such a page a 'NON-POOL' page.   Watch for them.
    If you want a table to be entirely on a segment, create the table on your desired
    segment and then create your clustered index on the same desired segment.

 

Go to DBPowerSuite 7.9 List of Programs.


Updated: Thu Jun 18 21:12:26 2009