Manage CBO statistics

DBA Notes: 2011/11/02

Cheng Li


Manage CBO statistics


系统需要升级到
11g R2 想把现在的CBO统计信息保存起来,然后,万一升级后的性能下降了,可以从新导入。结合11gSPM的特性,就起码可以保证升级后性能不下降了。 方法很直接,只要把CBOStatistics数据在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

 

fj.pngImg318778079.jpg

fj.pngImg318778090.jpg

fj.pngImg318778081.jpg

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

转载于:http://blog.itpub.net/26136400/viewspace-710113/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值