In many cases, the local test environment cannot simulate all the performance problems of the customer's production system. It may take only a few minutes to quickly run in the local environment, but it usually takes several hours for the customer to run, in this case, in addition to trying to simulate the same amount of data in the customer's production system, you also need to obtain the statistical information of the production system and import it to the local system to reproduce the performance problem! The following statements are specific operation steps!
Production system:-- Perform statistics
Begin
Dbms_stats.gather_schema_stats ('citictest', 10 );
End;
-- Create a statistical entity table
Begin
Dbms_stats.create_stat_table (Null, 'Statistics ',Null);
End;
-- Export statistics to the object table
Begin
Dbms_stats.export_schema_stats ('citictest', 'statistics ',Null,Null);
End;
-- Export the object table exp citictest/citictest @ colm2Tables=Statistics File=Statistics. DmpLog= Statistics_export.Log Test System:-- Import the object table imp test/test @ colm2Tables=Statistics File=Statistics. DmpLog= Statistics_import.Log Ignore= Y -- Update the user nameUpdate Statistics SetC5 = 'test' -- import the object table to statisticsBegin
Dbms_stats.import_schema_stats ('test', 'statistics ',Null,Null,Null);
End; -- View statisticsSelectUser_tables.num_rows, user_tables.last_analyzed, user_tables .*FromUser_tables