Program: fragments.sh Author: Jacob Salomon jakesalomon@yahoo.com 2010-07-25 fragments.sh queries the SMI tables and the system catalogs of each database, producing columns of data in the form: |TableName|FT|Partition|DBspace|NRows|Xtns|NPused|NPtotl|Index| TableName: The qualified database:table name PT: Fragment Type: with the following possible values: S: Single table partition i.e. non-fragmented table T: Table fragment - part of a fragmented table I: Index fragment - detached index or fragment thereof t: Temp table (or fragment thereof) Partition: The hex partition number of the tablespace. DBSpace: Name of the dbspace containing this partition. (Easier than figuring it out from inspecting the partition number, isn't it?) NRows: Number of rows in the tablespace (0 for index fragment). Xtns: Number of extents in the tablespace NPused: Number of pages in the tablespace containing something NPtot: Number of pages allocated to the tablespace IndexName: For an index fragment, the name of the index. Usage: $program [-H] [-C] [-S] [-T] [-V] [-d database] [-t table] [-o owner] [-f [width] ] [-D DBspace] Note that the -d, -t, and -D options accept multiple arguments, If you specify more than one argument to an option, separate the arguments with commas, not spaces. e.g. -d stores7,myowndb . They also accept multiple arguments if the option is repeated. eg. -d stores -d max,min will display information about dstsbses stores, max, and min. If you separate with spaces (e.g. -d stores7 myowndb) the second parameter is likely to be ignored and may even result in an error message. -H : Display this help text and exit. Ignore all other options -h : (Compatibility for the -h option. Please use -H to request the help page.) -C : Include system catalogs in the listing. Default: Omit them, since it is very difficult to defragment system catalogs anyway. -c : (Compatibility for the -C option. Please use -C to see catalogs.) -S : Include partitions in the sysmaster and sysutils databases. Default: Omit partitions in sysmaster and sysutils. -s : (Compatibility for the -s option. Please use -S to include SMI tables.) -T : Include temp tables: those associated with a database (explicitly created by a user) as well as temp tables in the bogus databases HASHTEMP and SORTTEMP (created by the optimizer when joining tables and sorting data). Default: Omit these because we are seldom concerned about their growth. -V : Display version number and exit, ignoring other parameters -d : Display data only on partitions belonging to tables in the specified database. You can explicitly specify sysmaster or sysutils here without having to use the -s option. Example: To specify more than one databases, use: $program -d stores7,sysmaster Default: All databases (except sysmaster and sysutils). Note: Specifying a database automatically enables display of sysmaster and sysutils -o : Display information on tables owned by the specified user. You may specify a comma-separated list of users or repeat this option for several users. Example: $program -o moe,larry -o curly -f : How wide to make the column for the fragmentation expression, if it is wanted at all. Default: Omit the fragmentation expression. -t : Display data only on partitions belonging to the specified table. Example: To specify more than one table, use: $program -d table1,table2.. You may specify the name of a temp table with this option without specifying -T . It is a good idea (but not absolutely necessary) to specify a database (-d) when using this option This is in order to avoid extraneous listings when multiple databases have tables with the same names. Default: Display data on all tables [in the specified database] (except the catalogs, of course. See the -C option for that). Note: Specifying a table name automatically enables display of catalogs and temp tables. -D : Display data only on partitions in the specified dbspace[s]. Example: To display data only on tablespaces that reside in this couple of dbspaces, use: $program -d dbspace1,dbspace2.. Default: TableSpaces in all dbspaces. Note: Specifying a DBspace enables display of temp and hash tables within that DBspace. ========================================================================