You can export stats and then after you have inserted into all rows into the new table, you can import them back. When you issue this command:
SHOW STATISTICS VALUES ON table-name;
You get COLLECT STATISTICS statements that include a VALUES clause, which causes all the values and histogram detail and history records that have been collected for each statistic in that table to be produced in the output.
When you submit those COLLECT STATISTICS commands in a script (they are just regular SQL) after the new table has been created (assuming the new talbe is named the same as the table you exported from, or that you have modified the table-name in the COLLECT STATISTICS commands) it will copy in that histogram and history detail just as if you had manually one-by-one collected the statistics yourself.
Using the export (which creates the SQL to repopulate statistics after the table has been recreated) followed by an import (which can be submitted as regular SQL) you will preserve the histograms and the history records.
Response to Nazy:
You can export stats and then after you have inserted into all rows into the new table, you can import them back. When you issue this command:
SHOW STATISTICS VALUES ON table-name;
You get COLLECT STATISTICS statements that include a VALUES clause, which causes all the values and histogram detail and history records that have been collected for each statistic in that table to be produced in the output.
When you submit those COLLECT STATISTICS commands in a script (they are just regular SQL) after the new table has been created (assuming the new talbe is named the same as the table you exported from, or that you have modified the table-name in the COLLECT STATISTICS commands) it will copy in that histogram and history detail just as if you had manually one-by-one collected the statistics yourself.
Using the export (which creates the SQL to repopulate statistics after the table has been recreated) followed by an import (which can be submitted as regular SQL) you will preserve the histograms and the history records.
Thanks, -Carrie