When using the Dbms_stats analysis table, we often have to save the previous analysis to prevent the system from performing poorly after the analysis and then recover quickly.
First, create a parse table that is used to save the parsed values before:
Sql> begin
2 dbms_stats.create_stat_table (ownname => ' TEST ', Stattab => ' stat_table ');
3 END;
4/
The PL/SQL process has completed successfully.
Analysis Table Information
Sql> BEGIN
2--dbms_stats.delete_table_stats (ownname => ' TEST ', tabname => ' A ');
3 Dbms_stats.gather_table_stats (ownname => ' TEST ', tabname => ' A ');
4 End;
5/
The PL/SQL process has completed successfully.
Export table profiling information to stat_table.
Sql> BEGIN
2 dbms_stats.export_table_stats (ownname => ' TEST ', tabname => ' A ', Stattab => ' stat_table ');
3 END;
4/
The PL/SQL process has completed successfully.
Sql>