SQL Performance Analyzer: Performance - Oracle

1y ago
4 Views
2 Downloads
1.55 MB
56 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Julia Hutchens
Transcription

SQL Performance Analyzer:Eliminating the Guesswork from SQLPerformancePrabhaker Gongloor (GP)Khaled YagoubPete BelknapDatabase Manageability GroupOracle Corporation

Outline MotivationSQL Performance Analyzer (SPA) OverviewSPA for Pre-11g Database ReleasesNew!Usage Scenarios Upgrade testing:9i R2, 10g R1, 10g R2 10g R2 OR 11g Any change that impacts SQL performance Real-world Deployments ConclusionPlease visit us at the OOW DemogroundsBooth Moscone West: L52/L51 : DatabaseReplay/SPA

Why SQL Performance Analyzer (SPA)? Businesses want systems that are performant andmeet SLA’s SQL performance regressions are #1 cause of poorsystem performance Solution for proactively detecting all SQL regressionsresulting from changes not available DBA’s use ineffective and time-consuming manualscripts to identify problemsSPA identifies all changes in SQL performance beforeimpacting users

Real Application Testing Real Application Testing SPA Database Replay SPA Database Replay are complementary Together, provide comprehensive & flexible testing solution SQLSQLPerformancePerformanceAnalyzerAnalyzer LSQLresponseresponsetimetime outwithoutconcurrencyconcurrency x,index,etc.etc. CanCanuseuseforforupgradesupgradesfromfrom 9.2/10.19.2/10.1 10.210.2oror11g11g10.210.2 10.210.2oror11g11g DatabaseDatabase ReplayReplay PredictsPredicts impactimpact ofof changechange ononworkloadworkload throughputthroughput AssessAssess changechange byby replayingreplayingworkloadworkload withwith concurrencyconcurrency ComprehensiveComprehensive testingtesting ofof DBDBstack,stack, e.g,e.g, memory,memory, RAC,RAC,concurrencyconcurrency relatedrelated CanCan useuse forfor upgradesupgrades fromfrom 9.29.2 oror 10.210.2 11g11g

SQL PerformanceAnalyzer (SPA)

SPA : Common Usage Scenarios Database upgrades and patch-set releases 9.2/10.1 10.2 or 11.1 releases 10.2.0.x 10.2.0.y or 11.1 releases Database parameter changes Schema changes Optimizer statistics refresh Implementation of tuning recommendations I/O subsystem changesSPA can be used for any change that affects SQLexecution plan and performance

SQL Performance Analyzer: Overview Helps users predict the impact ofsystem changes on SQL workloadresponse time Builds different trials (experiment)of SQL workload performance(i.e., SQL execution plans andstatistics) SQL WorkloadSQL plans statsPre-change TrialAnalyzes performance differencesCompare Offers fine-grained performanceanalysis on individual SQL Integrated with SQL tuning set,SQL plan baselines, and SQLtuning advisor to form an End-toend solutionSQL PerformanceAnalysis ReportSQL plans statsPost-change Trial

SQL Performance Analyzer Generic WorkflowProduction DatabaseTest DatabaseSQL Tuning SetFetch Next SQLTest ExecuteCursor CacheFtpExport/ImportIncremental Capture*SQL Tuning SetExecution Plan &StatisticseChangerofBeTrialCompareSQL Performance*Negligible Overhead , 1- 2%geChanAfterTrial

SPA Report32514

SPA ReportRegressed SQL Statements

SPA Enterprise Manager Interface Rich GUI through Enterprise Manager DBMS SQLPA package PL/SQL API

SPA Usage Scenarios

Database Upgrade: 9.2/10.1* 10.2Scenario 1:I have heard premier DB support for 9.2 hasended, I want to upgrade 10.2 database release. Howcan I use 11g SPA functionality to accomplish theupgrade?Goal:Assess impact of upgrade on SQL workloadperformance on a test system using SPA so that thereare no surprises after upgrade.* For 10.1, the solution is similar to 9.2

Scenario 1: Database Upgrade: 9.2/10.1 10.2System SetupTest DatabaseProduction DatabaseProd DB (9.2/10.1)No patchesneededUpgradeTest DB (10.2)Clone of Production10.2 system Test Execpatch installed11g Test System: No applicationschema/data, stores SPA results11.1.0.7 or 11.1.0.6 patch11g SPA SystemMetalink Note: 560977.1

Scenario 1: Database Upgrade: 9.2/10.1 10.2SPA EnhancementsTest DatabaseProduction DatabaseProd DB (9.2/10.1)UpgradeTest DB (10.2)2. Remote Test ExecuteWorkload over DB Link1. Consume 9i SQLTrace files andgenerate STS11g SPA System

Scenario 1: Database Upgrade: 9.2/10.1 10.2Test DatabaseProduction DatabaseProd DB (9.2/10.1)UpgradeSend SQL forRemoteExecution1. Capture SQLworkload usingSQL*TraceTest DB (10.2)Collectexecutionstats2. Generate STS from trace file3. Generate Pre-Change TrialMove trace file to11g SPA system4. Send SQL to 10.2 DB to execute11g SPA System5. Compare performance andgenerate SPA report

Scenario 1: Database Upgrade: 9.2/10.1 10.2Test DatabaseProduction DatabaseProd DB (9.2/10.1)Test DB (10.2)UpgradeSend SQL forRemoteExecutionCollectexecutionstats1. Capture SQLworkload usingSQL*Trace2. Generate STS from trace fileMove trace file to11g SPA system3. Send SQL to 10.2 DB to execute11g SPA System4. Compare performance andgenerate SPA report

Scenario 1: Database Upgrade: 9.2/10.1 10.2Step 1: Capture SQL workload using SQL Trace Identify all interesting workloads such as month-end, daily peak,etc. Capture SQL trace for the workload, few sessions at a time Use dbms support/dbms monitor package, these support bind value capture tracing other running sessions SQL trace considerations time statistics true: Important for performance datauser dump destmax dump file sizetrace file identifierPerformance overhead: 10-15% for traced sessions

Scenario 1: Database Upgrade: 9.2/10.1 10.2Step 1: Capture SQL workload using SQL Trace (contd.) SQL Trace files only have object identifiers Create mapping table to map object identifiers intrace files to schema namesIdOwnerName123SCOTTEMP124SCOTTDEPTSQL trace files* SQL in Note pages/OTN

Scenario 1: Database Upgrade: 9.2/10.1 10.2Step 2: Transport Workload and Create STS11g SPA SystemProduction DatabaseSQL trace mportSQL trace filesIdOwnerName123SCOTTEMP124SCOTTDEPTMapping TableMapping TableSQL Tuning Set Transport SQL trace files, mapping table using ftp/expdp/impdp., etc.Create STS from trace files using dbms sqltune API (SQL in Notespage/OTN) Specify directory object containing trace files, mapping table, STS nameas input

Scenario 1: Database Upgrade: 9.2/10.1 10.2Step 3a: Create SPA Task Create SPA task on 11g SPA System

Scenario 1: Database Upgrade: 9.2/10.1 10.2Step 3a: Create SPA Task

Scenario 1: Database Upgrade: 9.2/10.1 10.2Step 3b: Establish “Before Change” Trial Trial Creation Method: Select “Build From SQL Tuning Set”option to use plans and statistics from 9i

Scenario 1: Database Upgrade: 9.2/10.1 10.2Step 4: Establish “After Change” Trial

Scenario 1: Database Upgrade: 9.2/10.1 10.2Test DatabaseProduction DatabaseProd DB (9.2/10.1)Test DB (10.2)UpgradeSend SQL forRemoteExecutionCollectexecutionstats1. Capture SQLworkload usingSQL*Trace2. Generate STS from trace fileMove trace file to11g SPA system3. Send SQL to 10.2 DB to execute11g SPA System4. Compare performance andgenerate SPA report

Scenario 1: Database Upgrade: 9.2/10.1 10.2Step 5: Compare and Generate Report Compare Pre-Change and After-Change Trials basedon a performance metric Oracle recommends using CPU TIME and BUFFER GETSmetrics Use multiple metrics that provide repeatable andcomprehensive statistics

Fixing Regressed SQL Systematic problems Check un-analyzed tables, PGA memory, statistics collection,system statistics Refer “Upgrading from Oracle 9i to 10g: What to expect from theOptimizer” on OTN For statements suffering from isolated problems use one ofthe following fixes SQL Profiles: Implement Profiles recommended by SQL TuningAdvisor (STA) Stored Outlines**: If no profile was recommended by STA, thencapture Stored Outlines in 9i for the targeted SQL statements.Import stored outline into 10g.

Database Upgrade: 10.2.0.x 10.2.0.yScenario 2:One of the database I’m managing is on10.2.0.2. How can I use 11g SPA functionality toaccomplish an 10.2.0.4 patchset upgrade?Goal:Assess impact of upgrade on SQL workloadperformance using SPA so that there are no surprisesafter upgrade.

Scenario 2: Database Upgrade: 10.2.0.x 10.2.0.ySystem SetupTest DatabaseProduction DatabaseProd DB (10.2.0.x)UpgradeTest DB (10.2.0.y)UpgradeTest DB (10.2.0.x)No patchesneeded10.2.0.x: Clone of Prod10.2 systems Test Execpatch installed11g Test System: No applicationschema/data, stores SPA results11.1.0.7 or 11.1.0.6 patch11g SPA SystemMetalink Note: 560977.1

Scenario 1: Database Upgrade: 10.2.0.x 10.2.0.yWorkflowProduction DatabaseProd DB (10.2.0.x)Test DatabaseUpgradeTest DB (10.2.0.y)UpgradeTest DB (10.2.0.x)Send SQL forRemoteExecution1. Capture SQLworkload to STSusing IncrementCursor CacheCaptureCollectexecutionstats2. Import STSMove STS dmpfile to 11g SPAsystem11g SPA System3. Send SQL for test execution on10.2 before and after upgrade4. Compare performance andgenerate SPA report

Scenario 3: Using SPA Functionalityfor 9i/10g 11g Upgrades Similar workflow as Scenario 2 Use 11g SPA system and test execute on 10g/11gsource and destination target databases Stores results of experiments separately Allows use of latest releases for 11g SPA system

Schema ChangesScenario 4:A few months after upgrade, the databaseengineering team wants to add few indexes on theproduction system. They want my input on how it willimpact the database and applicationGoal:Assess impact of schema changes on SQLworkload on test system performance & make sure areno negative effects of the change

Schema Changes

Schema ChangesChange Accepted1

Evaluating Optimizer Statistics RefreshScenario 5:Can I use SPA to check if any SQL statementsregressed due to optimizer statistics refresh on my 10.2production databases. If so, how can I evaluate therefreshed optimizer statistics?Goal:Assess impact of optimizer statistics gatheringon SQL workload performance on production system &make sure are no negative effects of the change

Evaluating Optimizer Statistics Refresh Assumptions Optimizer has already gathered statistics on the database Statistics refreshed periodically No prod copy is available on test Use “11g SPA system” to evaluate optimizer statistics on 10.2production database Remote test execute before/after statistics refresh Analyze SPA report and take appropriate action Overall improvement but few SQL regressions Solution: Use SQL Profiles for regressed SQL No improvement and many regressions Solution: Revert to old statistics: Use optimizer statisticsretention/history feature For Oracle Database 11g, use publish pending statistics feature topublish statistics after evaluation of statistics

Evaluating Optimizer Statistics Refresh for 10.2Production DatabaseProd DB (10.2)11g SPA SystemOpt Statistics RefreshProd DB (10.2)1. Capture SQLworkload toSTS2. Import STS3. Use SPA to detect planchanges4. Compare performance andgenerate SPA report5. Retain new statistics orrevert to old statistics or useSQL Profiles for regressiontuning

SPA Real-World CaseStudies

Case Study 1:Large Hotel ChainChallengeSolutionApproachBenefit Upgrade critical customer-facing application providing ratesfor room reservations from Oracle Database 10.2.0.4 to 11.1 Highly volatile data where plan stability is critical Unsuccessfully used synthetic queries to test previousupgrades SQL Performance Analyzer to identify SQL regressions SQL Profiles to tune SQL transparently SQL Plan Baselines for plan stability Very successful upgrade. No surprises! Predictable performance and SLAs Reduced testing time from 5 months to 10 days

Large Hotel ChainProblems Resolved Issues Prior to Upgrade Volatile nature of data sometimes produced inefficient queries basedon stale stats. Impossible to maintain good statistics due to the nature of data load– frequent and widely changing Bind variables didn't always help Outlines hurt in some cases due to nature of the data values After Oracle Database 11g Upgrade: No performance problems noticed Predictable query performance and plan stability due to PlanBaselines Provided a history of plan changes Allowed a more efficient usage of bind variables due to adaptivecursor sharing

SPA Case Study 2:E-Business Suite (EBS) Certification and TestingChallenge Certify EBS release 11i, R12 against Oracle Database 11g Complex & large workload: More than 650K unique SQLstatements need to be validated Ensure application optimized for Oracle Database 11g Difficult to perform realistic and efficient testing with previous(home-grown) toolsSolutionApproachBenefit SQL Performance Analyzer to run regression tests andidentify performance deviations Regressions reported to base development for fixes Reduced testing time from 21 to 2 days for each release Faster and higher quality testing Faster adoption and certification of newer features

SPA: E-Business Suite Certification and Testing SPA has been extensively used for Apps certification and testing R12.0.4 E-Business Suite w/ 11.1.0.6 DB: 650K unique SQL stmts 11i E-Business Suite w/ 11.1.0.6 DB: 550K unique SQL stmts Workload is complex, large Challenges before SPA deployment Manually maintain SQL repository of statements Need to maintain database hosting the SQL repository and javaapplication SPA deployment Eliminated need to maintain SQL repository, java application,database hosting the repository Higher quality and realistic testing Fine-grain, reporting analysis possible Automatic tracking of trials and performance data

SPA: E-Business Suite Certification and Testing SPA is already being used in many scenarios Certification of EBS (11i and R12) with Oracle Database 11.1.0.6 Impact of new features on EBS Extended Optimizer Statistics, SQL Plan Baselines, SQL Profiles Performance Testing: 10.2.0.3 Vs 11.1.0.6 Vs 11.2 Impact of Parameter Changes: Obsolete/new parameters Impact of HW changes

SPA Case Study 3: Internal Mail System Background: Internal mail system, critical application Collaboration Suite 10.1.2.3, 4000 named users, 25 Average Active Sessions, RDBMS4-node RAC, DG Physical Standby, 4 nodes x 8 (4-dual core) CPUs, 15Gb SGA perinstance, ASM 4.5 TB DB size (allocated data), Apple XServe RAID, Linux-64 bit OEL4U4 Before SPA: Used manual processes, captured SQL with no bind data for testing andchecked plan regression, 80 hrs, but still not reliable SPA used for DB upgrade testing, from release 10.2.0.3 to 11.1.0.6 (Jan 2008) Switching to 11g optimizer statistics gathering Removing legacy, custom optimizer parameters Moving to 11g optimizer code path SPA reported about 20% overall performance improvement SQL Workload consisted of 818 statementsTesting revealed most workload would be unchanged (by buffer gets/elapsed time, etc)Few statements improved, but for 5 critical statements plans regressedSQL Plan Baselines used in production successfully for remediating these 5 queries

Case Study 3: Internal Mail system After upgrade, SLAs were same as before, and noinstabilities were noticed in the last 8 months Upgrade Testing Summary with SPA Resulted in reduced time/effort for actual testing from 80 hrsto 2 hrs More accurate and realistic testing than before SLAs being met and successful production deployment

Resources on OTN Real Application Testing for Earlier Releases Testing Performance Impact of an Oracle Database 9i/10g Release1 to Oracle Database 10g Release 2 Upgrade with SQLPerformance Analyzer Migration to Cost-Based Optimizer Upgrading from Oracle 9i to 10g: What to expect from the Optimizer Upgrade Companion: Metalink Note: 466181.1: One-stop shop forUpgrades Real Application Testing Users Guide

David MitchellSenior Vice President, OVUM“Oracle Real Application Testing reduces the timerequired to test changes by as much as 80%, lowertesting costs by as much as 70%, mitigate risks byreducing the number of unexpected outages, andimprove the quality of service for their IT operations.”Source: Oracle Real ApplicationTesting – business agility through superior testing, Jan 2008

Conclusion SPA provides comprehensive and easy to use solution forassessing impact of changes on SQL response time Eliminates SQL performance guess work!! SPA can be used to test many changes Upgrade testing including 9i, 10g to 10.2 or 11g releases Index creation/drop, statistics gathering, etc. Helps adopt technology faster by cutting down testing time frommonths for days With SPA and Real Application Testing businesses can Stay competitive Improve profitability Be compliant

The following is intended to outline our generalproduct direction. It is intended for informationpurposes only, and may not be incorporated into anycontract. It is not a commitment to deliver anymaterial, code, or functionality, and should not berelied upon in making purchasing decisions.The development, release, and timing of anyfeatures or functionality described for Oracle’sproducts remains at the sole discretion of Oracle.

Recommended Campground DemosDemoLocationComplete Data Center ManagementMoscone WestExhibit HallOracle Real Application Testing: Database Replay andSQL Performance AnalyzerMoscone WestExhibit HallSelf-Managing Database: Automatic Performance DiagnosticsMoscone WestExhibit HallSelf-Managing Database: Automatic Application & SQLTuningMoscone WestExhibit HallSelf-Managing Database: Automatic Fault DiagnosticsMoscone WestExhibit HallChange Management & Data Masking for DBAsMoscone WestExhibit HallApplication Quality ManagementMoscone WestExhibit Hall

Recommended Sessions (Monday sessions)Session TitleDateTimeLocationOptimizing Application Performance: Application TestingSuite to the RescueMonday,Sept. 221:00pmMoscone West2001Performance Fundamentals for Oracle Database 10g andOracle Database 11gMonday,Sept. 222:30pmMoscone South302First-Failure Fault Diagnosability and Diagnostics: OracleDatabase 11g Features and Novel ApproachesMonday,Sept. 222:30pmMoscone South304Oracle Enterprise Manager: Oracle's ManagementSolution for Your EnterpriseMonday,Sept. 224:00pmMoscone West2003

Recommended Sessions (Tuesday sessions)Session TitleDateTimeLocationApplication Upgrade Secrets: Avoid Surprises WhileMaking Database ChangesTuesday,Sept. 239:00amMoscone West2003Using Oracle Database 11g Real Application Testing toSimulate Production System PatchingTuesday,Sept. 239:00amMoscone South304Advanced Performance Diagnostics: What the GUIDoesn't Tell YouTuesday,Sept. 2311:30amMoscone West2003Demystifying SQL Tuning: Tips and Techniques for SQLExpertsTuesday,Sept. 231:00pmMoscone South303Successful Upgrade Secrets: Preventing PerformanceProblems with Database ReplayTuesday,Sept. 235:00pmMoscone South303

Recommended Sessions(Wednesday sessions)Session TitleDateTimeLocationStorage Monitoring Made Easy: Diagnosing I/OPerformance ProblemsWednesday,Sept. 249:00amMoscone South303Applications Data Privacy: An Expert Panel DiscussionWednesday,Sept. 2411:30amMoscone West2001SQL Tuning Roundtable with the ExpertsWednesday,Sept. 241:00pmMoscone West2001Deploying Oracle Enterprise Manager in a SecureMaximum Availability ArchitectureWednesday,Sept. 245:00pmMoscone West2001

Create SQL Set : Filters

Recommended Sessions (Thursday sessions)Session TitleDateTimeLocationThe Danish Experiment: Oracle Database 11g ShockUpgrades and Massive Workload Reduction via COBSThursday,Sept. 259:00amMoscone South301Integrating 40 Data Centers in Three Years: How Oracle'sDBAs Control the Data Center ExplosionThursday,Sept. 2510:30amMoscone South303Application Testing Best Practices: Real-World CustomerTestimonialsThursday,Sept. 2512:00pmMoscone South303Proactive Performance Monitoring with Baselines andAdaptive ThresholdsThursday,Sept. 251:30pmMoscone South303Managing Oracle Grid Computing: Oracle Real ApplicationClusters, Oracle Automatic Storage Management, OracleData GuardThursday,Sept. 253:00pmMoscone South303

SQL Performance Analyzer: Overview Helps users predict the impact of system changes on SQL workload response time Builds different trials (experiment) of SQL workload performance (i.e., SQL execution plans and statistics) Analyzes performance differences Offers fine-grained performance analysis on individual SQL

Related Documents:

Oracle is a registered trademark and Designer/2000, Developer/2000, Oracle7, Oracle8, Oracle Application Object Library, Oracle Applications, Oracle Alert, Oracle Financials, Oracle Workflow, SQL*Forms, SQL*Plus, SQL*Report, Oracle Data Browser, Oracle Forms, Oracle General Ledger, Oracle Human Resources, Oracle Manufacturing, Oracle Reports,

Oracle e-Commerce Gateway, Oracle Business Intelligence System, Oracle Financial Analyzer, Oracle Reports, Oracle Strategic Enterprise Management, Oracle Financials, Oracle Internet Procurement, Oracle Supply Chain, Oracle Call Center, Oracle e-Commerce, Oracle Integration Products & Technologies, Oracle Marketing, Oracle Service,

Oracle is a registered trademark and Developer/2000, Oracle8, Oracle Application Object Library, Oracle Alert, Oracle Financials, Oracle Quality, Oracle Workflow, Oracle Work in Process, SQL*Forms, SQL*Plus, SQL*AMX, SQL*Report, and SQL*ReportWriter are

2.5 Installing Oracle Trace File Analyzer on Microsoft Windows in Non-Daemon Mode 2-4 2.6 Oracle Trace File Analyzer Key Directories 2-4 2.7 Oracle Trace File Analyzer Command Interfaces 2-5 2.8 Masking Sensitive Data 2-5 2.9 Securing Access to Oracle Trace File Analyzer 2-6 2.10 Uninstalling Oracle Trace File Analyzer 2-7iii

Logical SQL statements understood by the Oracle BI Server. Logical SQL includes standard SQL, plus special functions (SQL extensions) such as AGO, TODATE, EVALUATE, and others. Logical SQL queries resolve to Presentation layer objects. This guide contains the following topics: About Logical SQL in Oracle Business Intelligence SQL Syntax .

SQL Server supports ANSI SQL, which is the standard SQL (Structured Query Language) language. However, SQL Server comes with its own implementation of the SQL language, T-SQL (Transact- SQL). T-SQL is a Microsoft propriety Language known as Transact-SQL. It provides further capab

MS SQL Server: MS SQL Server 2017, MS SQL Server 2016, MS SQL Server 2014, MS SQL Server 2012, MS SQL Server 2008 R2, 2008, 2008 (64 bit), 2008 Express, MS SQL Server 2005, 2005 (64 bit), 2005 Express, MS SQL Server 2000, 2000 (64 bit), 7.0 and mixed formats. To install the software, follow the steps: 1. Double-click Stellar Repair for MS SQL.exe.

advanced accounting program. Understanding students’ intentions in pursuing their studies to higher level of accounting courses is an important step to attract students to accounting courses. Beside intention, students’ perception on advanced accounting programs and professional courses may