Before performing the data migration, it is strongly recommended that you analyze all of your database tables using the dbms_stats package.
Run the following command, which generates histograms:
execute dbms_stats.gather_schema_stats
(ownname => 'OWNERNAME',
estimate_percent => dbms_stats.auto_sample_size,
method_opt=>'for all columns size auto',
cascade=>true)
Note that OWNERNAME is the owner name in the database.
Running this command is crucial if you are restoring a database. For example, assume that you are going to export your production database, and import it into the test database in order to run the upgrade process in a test environment. If you do not analyze the tables, under certain circumstances, Oracle may opt to perform full table scans instead of using an index. This may slow down the migration. In addition, if your tables have a large number of records, analysis may take a long time.