Tablespace tablespace hackery 
Author Message
 Tablespace tablespace hackery
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...

Andrew



Tue, 08 Oct 1996 18:32:16 GMT
 Tablespace tablespace hackery

andrew,

check out the /usr/informix/etc/makeps.sql script. its not supported by
informix prior to version 6.x but it does what you want. its a little
buggy, but works for most cases.

Quote:

> 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...

> Andrew

--
regards,
+----------------------------------------------------------------------------+
|     .     .     |                                                          |
|    ...   ...    | Bob Baskett                                              |
|   ..... .....   | Software Engineer, DBA                                   |
|  ..   ...   ..  | Business Systems Integration Group                       |
| .      .      . | Semiconductor Products Sector                            |
|                 | Mesa, AZ                                                 |
|  Motorola, Inc. |                                                          |
|----------------------------------------------------------------------------|
|   'connectionLESS IS MORE' -- Data Broker                                  |
|----------------------------------------------------------------------------|
| Duct tape is like the force.  It has a light side, and a dark side, and    |
| it holds the universe together ...                                         |
|                 -- Carl Zwanzig                                            |
+----------------------------------------------------------------------------+


Wed, 09 Oct 1996 00:28:08 GMT
 Tablespace tablespace hackery

Quote:

}Subject: Tablespace tablespace hackery
}Date: Fri, 22 Apr 1994 10:32:16 GMT
}X-Informix-List-Id: <news.6439>
}
}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...

I think you're looking for the SysMaster database which comes as standard
with OnLine DSA (Version 6.0).  This handles exactly that sort of
information.  Of course, you don't have extensive update privileges, so you
can't do much damage.

If you want to play with a non-working, non-supported version of this, you
can play with $INFORMIXDIR/*ps.sql -- but if it takes your OnLine system
down (or out), that is your problem.  This is rather like telling you
there's a jar of nitro-glycerine over in the corner; you can go and pick it
up and play with it if you want to, but I don't advise doing it.

Yours,



Tue, 08 Oct 1996 23:58:07 GMT
 Tablespace tablespace hackery

Quote:

> 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   ......|.........

--

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.



Fri, 11 Oct 1996 12:39:55 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Copy from tablespace to tablespace

2. Dropping tablespace (zero-block tablespace)

3. 8i Tablespace removal if someone has deleted the .dbf instead of dropping the tablespace

4. moving tables from the system tablespace to a new tablespace

5. Moving Tables from Tablespace A to Tablespace B

6. locally-managed tablespaces vs dictionary-managed tablespaces in 8i

7. moving data from 8.0.5 user_data tablespace to 8.1.7 users tablespace

8. Tablespace local management and temporary tablespace

9. Dropping tablespace (create zero-block tablespace)

10. restore tablespace backup after DROP tablespace (UDB 5.2)

11. How to move a user's tables from one tablespace to another tablespace.

12. how long to "transport tablespaces" with a read only tablespace?


 
Powered by phpBB® Forum Software