Gustavo:
Addressing your follow-up questions:
1 - After creating the tables in the new DBSPACE, can I recreate the tables in the original DBSPACE ?. I suppose so, using the same command that was used to move them from DBSPACE. I ask this because all my tables are in a single DBSPACE. I understand this would involve doing the job 2 times for each table, but I would like to keep all the tables together.
You COULD do that, but you do not have to. The ALTER FRAGMENT command can reorg the table into the same dbspace that it already lives in. The only downsides of doing that (instead of using another dbspace) are: a) the dbspace has to have at least enough free space to hold the new copy of the table concurrently with the original copy during the ALTER operation, and b) that if the free space in the current dbspace is fragmented (look at the oncheck -pe report to see whether this will be a problem) then the ALTER may recreate the table with worse fragmenting that it already had. If there is a large contiguous chunk of free space then if you make the NEXT SIZE big enough then the table may have as few as one or two extents.
2 - Assuming that when you return the table to its original DBSPACE, it runs out of space, how could I solve it?
See #1, but if you do temporarily move the table to another dbspace then move it back, the result may not be any better than you originally had. Again see #1.
3 - Does this process also copy the indexes of the tables ?.
The indexes are rebuilt after the table as part of the ALTER if that's what you are asking. If the indexes were created with an IN dbspace clause then they will stay where they are (you could ALTER FRAGMENT on the indexes too if you want to actually move them to another dbspace). But if the index was created ATTACHED to the table (either create before 7.30 without an IN clause or created with the IN TABLE clause) then they will follow the table to its new location.
4 - The NEXT SIZE value could be indicated as a percentage ratio of the size of each table ?. This because the table would already be compacted by calling it somehow.
OK, no. You want to make the NEXT SIZE big enough to hold all of the data that is normally accessed together (so a full year's worth if you typically report on a whole year of data for example) so that only one or two extents are actually accessed for those big reports no matter how many extents you actually end up with. When the table is rebuild with ALTER FRAGMENT the engine will create an initial extent based on the current EXTENT SIZE which you cannot change in v7.31 (as I mentioned you can in modern releases) then the NEXT SIZE will be used for all of the following extents. If there are blocks of free space that are at least as large as the NEXT SIZE then that's good. If two extents happen to be contiguous the engine will concatenate them into one bigger extent. So, setting NEXT SIZE is crucial to reducing the number of extents during the ALTER FRAGMENT processing.
I hope that helps.
Art
Art S. Kagel, President and Principal Consultant
ASK Database Management
Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.
------Original Message------
Hello Art!
I sensed that you were going to respond quickly to my queries. It is something I always appreciate.
Regarding migration to a new version of Informix, in this case 14.10, it will be impossible, since the provider of our application has a new version of its application that works with Oracle. For this reason, until the new system is implemented, I must keep the current one running with Informix.
This is something that frustrates me since Informix seems to me to be a much better database engine than Oracle. But unfortunately, there is nothing I can do to change the situation.
Returning to the topic of my query, I am interested in the idea of making an ALTER to the tables and creating them in another DBSPACE. Related to this, I have some doubts:
1 - After creating the tables in the new DBSPACE, can I recreate the tables in the original DBSPACE ?. I suppose so, using the same command that was used to move them from DBSPACE. I ask this because all my tables are in a single DBSPACE. I understand this would involve doing the job 2 times for each table, but I would like to keep all the tables together.
2 - Assuming that when you return the table to its original DBSPACE, it runs out of space, how could I solve it?
3 - Does this process also copy the indexes of the tables ?.
4 - The NEXT SIZE value could be indicated as a percentage ratio of the size of each table ?. This because the table would already be compacted by calling it somehow.
Forgive me for so many questions, but I am extremely suspicious and cautious when working in a production environment.
Thanks for your reply again !!!
------------------------------
Gustavo Echenique
------------------------------
#Informix