oracle数据库新特性之spa.ppt

上传人:小飞机 文档编号:6513554 上传时间:2023-11-08 格式:PPT 页数:26 大小:343.49KB
返回 下载 相关 举报
oracle数据库新特性之spa.ppt_第1页
第1页 / 共26页
oracle数据库新特性之spa.ppt_第2页
第2页 / 共26页
oracle数据库新特性之spa.ppt_第3页
第3页 / 共26页
oracle数据库新特性之spa.ppt_第4页
第4页 / 共26页
oracle数据库新特性之spa.ppt_第5页
第5页 / 共26页
点击查看更多>>
资源描述

《oracle数据库新特性之spa.ppt》由会员分享,可在线阅读,更多相关《oracle数据库新特性之spa.ppt(26页珍藏版)》请在三一办公上搜索。

1、SQL Performance Analyzer,Objectives,After completing this lesson,you should be able to:Identify the benefits of using SQL Performance Analyzer Describe the SQL Performance Analyzer workflow phasesUse SQL Performance Analyzer to ascertain performance gains following a database change,SQL Performance

2、Analyzer:Overview,Targeted users:DBAs,QAs,application developersHelps predict the impact of system changes on SQL workload response timeBuilds different versions of SQL workload performance(that is,SQL execution plans and execution statistics)Executes SQL serially(concurrency not honored)Analyzes pe

3、rformance differencesOffers fine-grained performance analysis on individual SQLIs integrated with SQL Tuning Advisor to tune regressions,SQL Performance Analyzer:Use Cases,SQL Performance Analyzer is beneficial in the following use cases:Database upgradesImplementation of tuning recommendationsSchem

4、a changesStatistics gatheringDatabase parameter changesOS and hardware changes,Using SQL Performance Analyzer,Capture SQL workload on production.Transport the SQL workload to a test system.Build“before-change”performance data.Make changes.Build“after-change”performance data.Compare results from step

5、s 3 and 5.Tune regressed SQL.,Step 1:Capture SQL Workload,Database Instance,Productiondatabase,Cursor cache,SQL Tuning Set(STS)is used to store SQL workload.Includes:SQL TextBind variablesExecution plansExecution statisticsIncremental capture is used to populate STS from cursor cache over a period o

6、f time.STSs filtering and ranking capabilities filter out undesirable SQL.,Incremental capture,Productiondatabase,Testdatabase,Step 2:Transport to a Test System,Copy SQL Tuning Set to staging table(“pack”).Transport staging table to test system(data pump,DB link,etc).Copy SQL Tuning Set from staging

7、 table(“unpack”).,Database instance,Cursor cache,Database instance,Step 3:Build Before Change Performance Data,Before change,SQL performance version is the SQL workload performance baseline.SQL performance=execution plans+execution statisticsTest/execute SQL in STS:Produce execution plans and statis

8、tics.Execute SQL serially(no concurrency).Every SQL is executed at least twice.Skip DDL/DML effects.Explain plan SQL in STS generates only SQL plans.,Testdatabase,Database instance,Beforechanges,Test/execute,11.2 update,Step 4:Implement Planned Change andStep 5:Build After-Change Performance Data,Ma

9、nually implement the planned change:Database upgradeImplementation of tuning recommendationsSchema changesStatistics gathering Database parameter changesOS and hardware changesReexecute SQL after change:Test/execute SQL in STS to generate SQL execution plans and statistics.Explain plan SQL in STS to

10、 generate SQL plans.,Testdatabase,Database instance,After changesimplemented,Afterchanges,Step 6:Compare and Analyze Performance andStep 7:Tune Regressed SQL,Rely on user-specified metric to compare SQL performance:ELAPSED_TIME,BUFFER_GETS,DISK_READS,.Calculate impact of change on individual SQLs an

11、d SQL workload:Overall impact on workload Net SQL impact on workloadUse SQL execution frequency to define a weight of importance.Detect improvements,regressions,and unchanged performance.Detect changes in execution plans.Recommend running SQL Tuning Advisor to tune regressed SQLs.Analysis results ca

12、n be used to seed SQL Plan Management baselines.,Testdatabase,Database instance,Compareanalysis,Regression,Improvement,SQL Tuning Advisor,Quiz,Which of the following does SQL Performance Analyzer perform?Tunes regressionsProvides before-and-after execution statisticsExecutes SQL statements seriallyB

13、uilds different versions of SQL workload performance,Accessing SQL Performance Analyzer,Use Enterprise ManagerUse the DBMS_SQLPA package,Using Enterprise Manager to Access SQL Performance Analyzer,Access SQL Performance Analyzer on the Software and Support tab.Select one of the five types of workflo

14、ws:Upgrade from 9i or 10.1Upgrade from 10.2 or 11gParameter ChangeExadata SimulationGuided WorkflowTune regressing statements by invoking SQL Tuning Advisor.Prevent regressions by using SQL plan baselines.,SQL Performance Analyzer:PL/SQL Example,exec:tname:=dbms_sqlpa.create_analysis_task(-sqlset_na

15、me=MYSTS,task_name=MYSPA);,exec dbms_sqlpa.execute_analysis_task(task_name=:tname,-execution_type=TEST EXECUTE,execution_name=before);,SELECT dbms_sqlpa.report_analysis_task(task_name=:tname,type=text,section=summary)FROM dual;,Create the tuning task:Execute the task to build the before-change perfo

16、rmance data:Produce the before-change report:,After making your changes:Create the after-change performance data:Generate the after-change report:Compare the task executions:Generate the analysis report:,SQL Performance Analyzer:PL/SQL Example,EXEC dbms_sqlpa.execute_analysis_task(task_name=:tname,-

17、execution_type=TEST EXECUTE,execution_name=after);,SELECT dbms_sqlpa.report_analysis_task(task_name=:tname,type=text,section=summary)FROM dual;,EXEC dbms_sqlpa.execute_analysis_task(task_name=:tname,execution_type=COMPARE PERFORMANCE);,SELECT dbms_sqlpa.report_analysis_task(task_name=:tname,type=tex

18、t,section=summary)FROM dual;,Tuning Regressed SQL Statements,BEGINDBMS_SQLTUNE.CREATE_TUNING_TASK(spa_task_name=MYSPA,spa_compare_exec=MYCOMPEXEC);END;/,To tune regressed SQL statements reported by SQL Performance Analyzer,create a SQL tuning task for the SQL Performance Analyzer execution by using

19、the DBMS_SQLTUNE.CREATE_TUNING_TASK function:,11.2,Testing Database Upgrades:Oracle9i Database and Oracle Database 10g Release 1,SQL Performance Analyzer supports testing database upgrades of Oracle9i and Oracle Database 10g Release 1,to Oracle Database 10g Release 2 and later releases.Execute the S

20、QL tuning set on the upgraded database remotely over a database link.The production system which you are upgrading from should be running Oracle9i or Oracle Database 10g Release 1.The test system which you are upgrading to should be running Oracle Database 10g Release 2(10.2.0.2)or a newer release.S

21、et up a separate system for SQL Performance Analyzer:Oracle Database 11g Release 1(11.1.0.7)or a later release.,Testing Database Upgrades:Oracle9i Database and Oracle Database 10g Release 1,To use SQL Performance Analyzer in a database upgrade from Oracle9i or Oracle Database 10g Release 1 to a newe

22、r release,perform the following steps:1.Enable the SQL Trace facility on the production system.2.On the production system,create a mapping table.3.Move the SQL trace files and the mapping table from the production system to the SQL Performance Analyzer system.4.On the SQL Performance Analyzer system

23、,construct a SQL tuning set by using the SQL trace files.,Testing Database Upgrades:Oracle9i Database and Oracle Database 10g Release 1,5.On the SQL Performance Analyzer system:Use SQL Performance Analyzer to create a SQL Performance Analyzer task and convert the contents in the SQL tuning set into

24、a preupgrade SQL trial that will be used as a baseline for comparison.Remotely test execute the SQL statements on the test system over a database link to build a postupgrade SQL trial.6.Compare SQL performance and fix regressed SQL statements.,Testing Database Upgrades:Oracle Database 10g Release 2

25、and Later Releases,SQL Performance Analyzer supports testing database upgrades of Oracle Database 10g Release 2 or a later release to any later release.Capture a SQL tuning set on the production system,then execute it twice remotely over a database link on a test system.The production system which y

26、ou are upgrading from should be running Oracle Database 10g Release 2 or a later release.The test system which you are upgrading to initially should be running the same release as the production system.Set up a separate system for running SQL Performance Analyzer:Oracle Database 11g Release 1(11.1.0

27、.7)or a later release.,Testing Database Upgrades:Oracle Database 10g Release 2 and Later Releases,Perform the following steps to use SQL Performance Analyzer in a database upgrade from Oracle Database 10g Release 2 and later releases to a newer release:1.On the production system,capture the SQL work

28、load that you intend to analyze and store it in a SQL tuning set.2.Set up the test system so that it matches the production environment as closely as possible.3.Transport the SQL tuning set to the SQL Performance Analyzer system.4.On the SQL Performance Analyzer system,create a SQL Performance Analy

29、zer task using the SQL tuning set as its input source.,Testing Database Upgrades:Oracle Database 10g Release 2 and Later Releases,5.Upgrade the test system.6.Remotely test execute the SQL statements a second time on the upgraded test system over a database link to build a postupgrade SQL trial.7.Com

30、pare SQL performance and fix regressed SQL statements.,SQL Performance Analyzer:Data Dictionary Views,Modified views in Oracle Database 11g:DBAUSER_ADVISOR_TASKS:Displays details about the analysis taskDBAUSER_ADVISOR_FINDINGS:Displays analysis findingsNew views in Oracle Database 11g:DBAUSER_ADVISO

31、R_EXECUTIONS:Lists metadata information for task executionDBAUSER_ADVISOR_SQLPLANS:Displays the list of SQL execution plansDBAUSER_ADVISOR_SQLSTATS:Displays the list of SQL compilation and execution statistics,Summary,In this lesson,you should have learned how to:Identify the benefits of using SQL P

32、erformance Analyzer Describe the SQL Performance Analyzer workflow phasesUse SQL Performance Analyzer to determine performance gains following a database change,Practice 9:Overview,This practice covers the following topics:Capturing SQL Tuning SetsMigrating SQL Tuning Sets from Oracle Database 10g to Oracle Database 11gUsing SQL Performance Analyzer in an upgrade scenario,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号