Re: Finding dbspace from system catalog tables
Posted in 1998
On 10 Jun 1998 17:22:55 GMT, "James Richardson" <jamesr@aethos.co.uk.nospam> wrote: > >I am currently attempting to write a dbschema-alike program, which analyses the information contained in the sys* tables, which >will compare differences between two different database schemas, and , later, will generate the SQL to convert one database to be >the same as another. > >Things are going fairly well so far, however I have found no information about how to determine which dbspace a table is in from >the system catalog. > >If anybody could tell me where the information is, that would be great. > >TIA > >James Richardson > >PS: The next step is determining how to reconstruct fragmentation information, so if you have any tips...... For a non-fragmented table, convert the partnum field of the systables entry to an 8-digit hex number (with leading zeros). The first three digits will be the dbspace number as defined in the sysmaster:sysdbspaces table. For a fragmanted table, the partnum is 0 in systables, and the dbspace information is contained in the sysfragments table. -Curt