How to ensure performance after upgrade to Oracle 11g R2

本文提供了Oracle 11g R2升级后确保数据库性能的详细步骤,包括预升级成本基优化管理任务、使用AWR收集性能指标、启用SPM自动管理执行计划等关键措施,旨在帮助用户实现平滑升级并维持高效性能。

DBA Notes: 2011/10/29

Cheng Li

 

How to ensure performance after upgrade to Oracle 11g R2

 

Steps to ensure database performance:

 

1  Perform. Pre-Upgrade Cost-Based Optimizer (CBO) Management Tasks

 

a)     Gather dictionary statistics.

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS; 

       CBO will depend on CBO data to accurate choose execution plan

b)    Gather fixed object statistics only when queries on dynamic performance views are performance poorly. (This is only recommended for poorly view performance )

 SQL> EXEC DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

c)     Backup of your CBO statistics for regression issues (This is only expected for regression issues)
Use  DBMS_STATS.export_schema_stats  and  EXEC DBMS_STATS.import_schema_stats to transfer CBO statistics

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

2  Use AWR to collect performance metric

NOTE:  If you are licensed for the Diagnostic Management Pack, you can capture AWR snapshots before and after the upgrade and then compare them using the AWR Comparison Report ($ORACLE_HOME/rdbms/admin/awrddrpt.sql or for Oracle Database 11g Release 2 with RAC use awrgdrpt.sql).

 

[oracle@ctmcmsdb dbalog]$ sqlplus

SQL*Plus: Release 11.1.0.6.0 - Production on Tue Oct 11 09:18:35 2011

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Enter user-name: / as sysdba

 Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> @$ORACLE_HOME/rdbms/admin/awrddrpt.sql
 

3  Use SPM to automatically manage execution plan

 

NOTE:  SQL Plan Management (SPM) is a freely available new feature in Oracle Database 11g that ensures plan stability and the same plan as in the original (pre-upgrade) database release. With Oracle Database 11g and SPM, the optimizer automatically manages plans and ensures that only verified or known plans are used. SPM allows controlled plan evolution by only using a new plan after it has been verified to perform better than the current plan. Some small amount of preparation is needed to ensure that execution plans are preserved for use after the upgrade, but for best results, use SQL Plan Management as part of your upgrade strategy.

1)      Prepare Software package:

Download and unzip the spm.zip file into a working directory.

2)      Automatic plan capture switch:

a)     Setting the init.ora parameter optimizer_capture_sql_plan_baselines to true.

 

b)     -- flush shared pool
alter system flush shared_pool;

-----------------------------------------------------
-- Step1: initial plan baseline

-- turn on baseline capture
alter session set optimizer_capture_sql_plan_baselines = true;
alter session set statistics_level = all;


Reference:

http://st-curriculum.oracle.com/obe/db/11g/r1/prod/manage/spm/spm.htm

http://blog.itpub.net/post/11835/474845

http://sites.google.com/site/ukja/oracle-is-madr/plan-stability--sql-baseline

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=465787.1


fj.png温哥华、维多利亚.jpg

fj.png温哥华、维多利亚2.jpg

fj.png温哥华、维多利亚3.jpg

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值