ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Manage CBO statistics

Manage CBO statistics

原创 Linux操作系统 作者:licheng79 时间:2011-11-02 15:56:21 0 删除 编辑

DBA Notes: 2011/11/02

Cheng Li


Manage CBO statistics


系统需要升级到
11g R2, 想把现在的CBO统计信息保存起来,然后,万一升级后的性能下降了,可以从新导入。结合11g,SPM的特性,就起码可以保证升级后性能不下降了。 方法很直接,只要把CBO的Statistics数据在Schema这个Level导出和从新导入就可以了

 

Transferring Stats

In the following examples the statistics for the APPSCHEMA user are collected into a new table, STATS_TABLE, which is owned by DBASCHEMA:

SQL> EXEC DBMS_STATS.create_stat_table('DBASCHEMA','STATS_TABLE');
SQL> EXEC DBMS_STATS.export_schema_stats('APPSCHEMA','STATS_TABLE',NULL,'DBASCHEMA');

This table can then be transfered to another server using your preferred method (Export/Import, SQLPlus Copy etc.) and the stats imported into the data dictionary as follows:

SQL> EXEC DBMS_STATS.import_schema_stats('APPSCHEMA','STATS_TABLE',NULL,'DBASCHEMA');
SQL> EXEC DBMS_STATS.drop_stat_table('DBASCHEMA','STATS_TABLE');

 

Reference:

http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/stats.htm#autoId27

http://www.oracle-base.com/articles/8i/CostBasedOptimizerAndDatabaseStatistics.php

http://www.myoraclesupports.com/content/statistics-best-practices-how-backup-and-restore-statistics

 

Img318778079.jpg

Img318778090.jpg

Img318778081.jpg

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26136400/viewspace-710113/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-09-07

  • 博文量
    54
  • 访问量
    84438