Re: How can I disable a foreign key???
Posted in 2006
Diego Morales wrote: > Hi to all. I have problems to unload/load a table to set extents > correctly (I have table with more than 500,000 records and more than 100 > extents). I need to disable foreign keys to unload and load the main > table but I don’t know how. Please help me. Diego, you do not have to unload/reload the table to compress the extents. The following will do it. 1) ALTER TABLE mytable NEXT SIZE <newsize>; 2) ALTER FRAGMENT ON TABLE mytable INIT IN <dbspace or fragmentation expression>; The dbspace/expression can be the same one the table already uses as long as there is space for a 2nd copy of the table temporarily. You should end up with one or at most 2 extents - assuming the table is smaller than a chunk - or one per chunk if it is larger unless that dbspace is badly fragmented. In which case doing this 2x for each table in the dbspace or moving the table(s) to an empty dbspace will solve that. Art S. Kagel