Re: Tablespace tablespace hackery
Posted in 1994
gaffer@ibmpcug.co.uk (Andrew Beattie) writes: > I would like to be able to access the tablespace tablespace (and other hidden > tables) through a database, just like any regular table. > > My plan of action would be something like: > > Create a database, with a table with the same structure as the tablespace > tablespace, go into systables and change the partition number to point at > the real tablespace tablespace. > > Anyone done this before? Anyone got schemas? > > Yes, I know - I could do no end of damage this way... In the following: TT = tablespace tablespace I have done this with the database tablespace. It worked with no problems. However, there are several problems with doing this with the TT. 1. Each page within the TT contains 5 rows for each table. Even if rows 1-5 for the second table you create could fit in the first page they are not inserted there, but are placed in a page by themselves. This is different then how a normal table is handled. 2. These five rows are all of a different structure. Even though it does not say so, the five rows correspond to the tblspace hdr, column info, index info, index column info and extent info described on page 2-93 of the On-Line Admin. Guide for Version 5x. 3. There is not even a fixed number of columns in some of these rows. For instance there is an eight byte entry describing each extent for a table. There are as many entries as needed for each extent. You can also have zero columns, and hence a zero length row, for the index related rows. If you have not yet discovered it, the "tbcheck -pp" command will display these 5 rows as shown below. tbcheck -pp 16777217 2 # This is the TT entry for the database tblspace addr stamp nslots flag type frptr frcnt next prev 10000f 34722010 5 2 PARTN 116 1908 0 0 slot ptr len flg 1 24 56 0 2 80 0 0 3 80 0 0 4 80 20 0 5 100 16 0 slot 1: # TBLSPACE INFO 0: 1 0 0 2 0 2 0 a 0 24 0 0 0 1 0 1 .........$...... 16: 2d 4e c7 90 0 0 0 1 0 0 0 4 0 0 0 4 -NG............. 32: 0 0 0 4 0 0 0 3 ff ff ff fa ff ff ff ff ...........z.... 48: 0 0 0 24 0 0 0 1 ...$............ slot 2: slot 3: slot 4: 0: 0 18 0 1 0 12 c7 10 0 0 0 1 0 10 12 0 ......G......... 16: 0 0 0 0 ................ slot 5: # EXTENT INFO 0: 0 0 0 0 0 10 7c 16 0 0 0 4 0 0 0 0 ......|......... -- Daniel Wood daniel@starsight.com The opinions expressed herein are those of myself, my employers, the carriers of this news message or any other messages for that matter, you the reader and any of your relations(whether by birth or chromosome count), all life forms and all inanimate objects.