SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Mitigating Performance Degradations
Jul 22, 2010
Peter Dobler | Managing Partner
Dynamic Database Solutions
 Performance Paradigm
◦ What causes performance degradation?
 SQL Plan Management
◦ Ensure the best query execution plan
 Oracle Database Resource Manager
◦ Protect your valuable system resources
 Alternatives
◦ What if this doesn’t solve your problem?
◦ What if you’re not running 11g?
◦ What if you’re running a 3rd party application?
The Bermuda Triangle of
Performance Degradation
Data
Volume
Software
Changes
Structure
Changes
System
Performance
OS Upgrades
DB Server Upgrades
New App Version
Schema Changes
Index Changes
Partition Changes
 To Improve Performance
◦ Buy more hardware
◦ Hire a performance tuning guru
◦ Do-It-Yourself performance tuning
◦ Reduce the data volume
 To Maintain Performance
◦ Use SQL Plan Management to counteract query plan
degradation
◦ Use Database Resource Manager to ensure that maximal
resources are allocated to the most important tasks.
From Stored Outlines to SQL
Profiles to SQL Plan
Management
Oracle 8i Oracle 9i Oracle 10g Oracle 11g
Stored
Outlines
SQL Profiles
SQL Plan
Management
Plan Stability Limited Self-Tuning
Auto Deactivate
Self-Tuning
Plan Baselines
Plan History
 SQL Plan Baselines are used to capture changes
caused by:
◦ New optimizer version
◦ Changes to optimizer statistics and optimizer
parameters
◦ Changes to schema and metadata definitions
◦ Changes to system settings
◦ SQL profile creation
 Containing:
◦ Set of hints
◦ Plan hash value
◦ Plan-related information
 First a baseline needs to be established by
◦ Capture a plan automatically by setting the
OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES
initialization parameter to TRUE (Default = FALSE)
◦ Load from existing plans
 From SQL Tuning Sets and AWR snapshot
 From the Cursor Cache
◦ Plans are automatically accepted and enabled. Set the
OPTIMIZER_USE_SQL_PLAN_BASELINES parameter to
FALSE to disable this behavior (Default = TRUE).
 A SQL plan will be selected through this logic.
◦ Each time the database compiles a SQL statement, the
optimizer does the following:
1. Uses a cost-based search method to build a best-
cost plan
2. Tries to find a matching plan in the SQL plan baseline
3. Does either of the following depending on whether a
match is found:
 If found, then the optimizer proceeds using the matched
plan
 If not found, then the optimizer evaluates the cost of each
accepted plan in the SQL plan baseline and selects the
plan with the lowest cost
 SQL Plan Management can evolve a plan by:
◦ Using the PL/SQL function
DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE to evolve a
plan captured into the baseline.
◦ Manually loading new plans from a SQL Tuning Set or the
Cursor Cache into the Plan history. These plans are
automatically accepted.
 Automatic SQL Plan Management that adapts to
most changes, except radical schema changes.
 Only 2 parameters used:
◦ OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES
◦ OPTIMIZER_USE_SQL_PLAN_BASELINES
 Pay close attention to the SYSAUX tablespace.
It’s been used to store the plans. Automatic
purge policy is in place, but only runs once a
week.
 Only available in 11gR1 and later
 Stored Outlines and SQL Profiles are being
depreciated.
 More automation by using SQL Plan Baseline with
SQL Tuning Advisor.
 Freeze SQL Plans by using the FIXED parameter.
 Export and Import SQL Plans.
◦ Fine tune SQL in a UAT environment or near production
and then export plans via data pump and then import
into production.
 SQL Plan Management
 SQL Tuning Advisor
 SQL Tuning Sets
 SQL Profiles
 AWR
 ADDM
Are separately licensed features
 Reference: E10821-05 Oracle Performance Tuning
Guide 11g Release 2 (11.2)
Throttle Down Your Resource
Hogs
 Database Resource Manager is designed to
address the following problems:
◦ Excessive overhead
◦ Inefficient scheduling
◦ Inappropriate allocation of resources
◦ Inability to manage database-specific resources, such
as parallel execution servers and active sessions
 Resource consumer group
◦ A group of sessions that are grouped together based on
resource requirements. The Resource Manager allocates
resources to resource consumer groups, not to
individual sessions.
 Resource plan
◦ A container for directives that specify how resources
are allocated to resource consumer groups. You specify
how the database allocates resources by activating a
specific resource plan.
 Resource plan directive
◦ Associates a resource consumer group with a particular
plan and specifies how resources are to be allocated to
that resource consumer group.
 There are three special consumer groups
◦ SYS_GROUP
 Default group for the users sys and system.
◦ DEFAULT_CONSUMER_GROUP
 Default group for all other user accounts.
◦ OTHER_GROUPS
 Default group if there’s no active plan assigned to the
groups above. This group must have an active plan.
 User Defined Groups
◦ Map sessions to consumer groups based on CPU or I/O
consumption thresholds.
 Only one resource plan can be active for a
consumer group.
 Resource plans can contain sub-plans and can
grow very complex.
◦ Remember that each plan level and sub plan level needs
to add up to 100% and cannot exceed 100%.
Plan A
Plan B Group A Plan D
Group B Group C Group D Group E
50%
CPU
20%
CPU
20%
CPU
50%
CPU
50%
CPU
50%
CPU
60%
CPU
 CPU
◦ Up to 8 levels of consumer group allocations
 Active Session Pool with Queuing
◦ Max concurrent sessions per consumer group
 Degree of Parallelism Limit
◦ Per session limit, but does not limit system setting
 Automatic Consumer Group Switching
◦ Switch groups, typically higher to lower priority.
◦ Canceling SQL and Terminating Sessions
 Execution Time Limit
◦ Estimate query run-time, trap and reschedule
 Undo Pool
◦ Limits the undo for uncommitted transactions per consumer
group
 Idle Time Limit
◦ Terminating session when exceeded.
 Resource Manager is on by default in 11g
 To avoid surprises when installing or upgrading to
11g, switch the active resource plan from
DEFAULT_PLAN to MIXED_WORKLOAD_PLAN.
 Carefully plan your resource groups and plan
directives.
 I/O limit switching is available in 11gR1 and
later.
 Reference: E10595-07 Database Administrator's
Guide 11g Release 2 (11.2)
How ActiveBase Opens Closed
Doors
 SQL Plan Management
◦ Manages SQL plans, but does not optimize SQL queries.
◦ Protects the database from performance degradation
due to common changes to the environment.
◦ Based on query optimizer cost calculation.
◦ 11gR1 and later only
 Database Resource Manager
◦ Forces database sessions to play nicely.
◦ Moves offending sessions out of the way to give priority
sessions all the resources possible.
◦ Protects the system from runaway queries.
◦ Based on CPU and I/O consumption.
◦ Latest features are 11gR1 and later only
 ActiveBase Performance
◦ Dynamic SQL Optimization via the creative use of a rules-
based SQL*Net Proxy that selectively intercepts and
evaluates in-bound SQL generated by applications. When sub-
optimal SQL is being submitted, the Proxy can re-structure
the syntax of the statement to apply performance
improvements which would then be executed by the
database.
 ActiveBase Priority
◦ Dynamic Server Prioritization via the creative use of a rules-
based Session Monitor that can detect when the server load
reaches various thresholds (e.g. 80%), which will then
throttle down the resources allocated to lesser-important
applications. The result is dynamic resource allocation that
enables critical applications to maintain SLAs during peak
processing periods.
THANK YOU!
Peter Dobler| Managing Partner
Dynamic Database Solutions
peter@dynamic-db.com
813 210 7060

Weitere ähnliche Inhalte

Was ist angesagt?

Oracle Database 12c features for DBA
Oracle Database 12c features for DBAOracle Database 12c features for DBA
Oracle Database 12c features for DBA
Karan Kukreja
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
vivaankumar
 
Sql server 2008 r2 perf and scale datasheet
Sql server 2008 r2 perf and scale   datasheetSql server 2008 r2 perf and scale   datasheet
Sql server 2008 r2 perf and scale datasheet
Klaudiia Jacome
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
Yogiji Creations
 
Chris resume.docx(updated)
Chris resume.docx(updated)Chris resume.docx(updated)
Chris resume.docx(updated)
CHRISTOPHER MADU
 
ABCs of CDC with SSIS 2012
ABCs of CDC with SSIS 2012ABCs of CDC with SSIS 2012
ABCs of CDC with SSIS 2012
Steve Wake
 

Was ist angesagt? (19)

Database administrator project-presentation-1-v1
Database administrator project-presentation-1-v1Database administrator project-presentation-1-v1
Database administrator project-presentation-1-v1
 
Srihari_Resume
Srihari_ResumeSrihari_Resume
Srihari_Resume
 
Database performance tuning and query optimization
Database performance tuning and query optimizationDatabase performance tuning and query optimization
Database performance tuning and query optimization
 
Oracle Database 12c features for DBA
Oracle Database 12c features for DBAOracle Database 12c features for DBA
Oracle Database 12c features for DBA
 
Less15 Backups
Less15 BackupsLess15 Backups
Less15 Backups
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Oracle dba training in Canada|Oracle dba training From Canada phno 09705612767
Oracle dba training in Canada|Oracle dba training From Canada phno 09705612767Oracle dba training in Canada|Oracle dba training From Canada phno 09705612767
Oracle dba training in Canada|Oracle dba training From Canada phno 09705612767
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
 
Sql server 2008 r2 perf and scale datasheet
Sql server 2008 r2 perf and scale   datasheetSql server 2008 r2 perf and scale   datasheet
Sql server 2008 r2 perf and scale datasheet
 
Oracle 11g new features for administrators
Oracle 11g new features for administratorsOracle 11g new features for administrators
Oracle 11g new features for administrators
 
Less10 Undo
Less10 UndoLess10 Undo
Less10 Undo
 
SQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersSQL Server 2008 Development for Programmers
SQL Server 2008 Development for Programmers
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 
Chris resume.docx(updated)
Chris resume.docx(updated)Chris resume.docx(updated)
Chris resume.docx(updated)
 
Database development life cycle unit 2 part 1
Database development life cycle  unit 2 part 1Database development life cycle  unit 2 part 1
Database development life cycle unit 2 part 1
 
ABCs of CDC with SSIS 2012
ABCs of CDC with SSIS 2012ABCs of CDC with SSIS 2012
ABCs of CDC with SSIS 2012
 
Les 04 Config Bu
Les 04 Config BuLes 04 Config Bu
Les 04 Config Bu
 
Performance tuning and optimization (ppt)
Performance tuning and optimization (ppt)Performance tuning and optimization (ppt)
Performance tuning and optimization (ppt)
 
Presentation cloud control enterprise manager 12c
Presentation   cloud control enterprise manager 12cPresentation   cloud control enterprise manager 12c
Presentation cloud control enterprise manager 12c
 

Andere mochten auch (7)

A Practitioner's Guide to Successfully Migrate from Oracle to Sybase ASE Part 2
A Practitioner's Guide to Successfully Migrate from Oracle to Sybase ASE Part 2A Practitioner's Guide to Successfully Migrate from Oracle to Sybase ASE Part 2
A Practitioner's Guide to Successfully Migrate from Oracle to Sybase ASE Part 2
 
Keeping Private Data Private
Keeping Private Data PrivateKeeping Private Data Private
Keeping Private Data Private
 
Sybase to oracle_conversion
Sybase to oracle_conversionSybase to oracle_conversion
Sybase to oracle_conversion
 
A Practitioner's Guide to Successfully Migrate from Oracle to Sybase ASE Part 1
A Practitioner's Guide to Successfully Migrate from Oracle to Sybase ASE Part 1A Practitioner's Guide to Successfully Migrate from Oracle to Sybase ASE Part 1
A Practitioner's Guide to Successfully Migrate from Oracle to Sybase ASE Part 1
 
Sybase To Oracle Migration for Developers
Sybase To Oracle Migration for DevelopersSybase To Oracle Migration for Developers
Sybase To Oracle Migration for Developers
 
JMeter Intro
JMeter IntroJMeter Intro
JMeter Intro
 
Sybase To Oracle Migration for DBAs
Sybase To Oracle Migration for DBAsSybase To Oracle Migration for DBAs
Sybase To Oracle Migration for DBAs
 

Ähnlich wie Dynamic Database Solutions - Mitigating Performance Degradations

NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseNoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
Paresh Patel
 
Oracle data capture c dc
Oracle data capture c dcOracle data capture c dc
Oracle data capture c dc
Amit Sharma
 

Ähnlich wie Dynamic Database Solutions - Mitigating Performance Degradations (20)

NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseNoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
 
12c Multi-Tenancy and Exadata IORM: An Ideal Cloud Based Resource Management
12c Multi-Tenancy and Exadata IORM: An Ideal Cloud Based Resource Management12c Multi-Tenancy and Exadata IORM: An Ideal Cloud Based Resource Management
12c Multi-Tenancy and Exadata IORM: An Ideal Cloud Based Resource Management
 
Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
 
Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4 Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4
 
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
 
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
 
AutoDOPandRest
AutoDOPandRestAutoDOPandRest
AutoDOPandRest
 
Taking Splunk to the Next Level - Architecture
Taking Splunk to the Next Level - ArchitectureTaking Splunk to the Next Level - Architecture
Taking Splunk to the Next Level - Architecture
 
Taking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionTaking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout Session
 
Coronel_PPT_Ch11.ppt
Coronel_PPT_Ch11.pptCoronel_PPT_Ch11.ppt
Coronel_PPT_Ch11.ppt
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
 
Dg Ers Costsaving 040309
Dg Ers Costsaving 040309Dg Ers Costsaving 040309
Dg Ers Costsaving 040309
 
Designer 2000 Tuning
Designer 2000 TuningDesigner 2000 Tuning
Designer 2000 Tuning
 
dd presentation.pdf
dd presentation.pdfdd presentation.pdf
dd presentation.pdf
 
Azure data platform overview
Azure data platform overviewAzure data platform overview
Azure data platform overview
 
Les 16 resource
Les 16 resourceLes 16 resource
Les 16 resource
 
05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx
 
Oracle data capture c dc
Oracle data capture c dcOracle data capture c dc
Oracle data capture c dc
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Dynamic Database Solutions - Mitigating Performance Degradations

  • 1. Mitigating Performance Degradations Jul 22, 2010 Peter Dobler | Managing Partner Dynamic Database Solutions
  • 2.  Performance Paradigm ◦ What causes performance degradation?  SQL Plan Management ◦ Ensure the best query execution plan  Oracle Database Resource Manager ◦ Protect your valuable system resources  Alternatives ◦ What if this doesn’t solve your problem? ◦ What if you’re not running 11g? ◦ What if you’re running a 3rd party application?
  • 3. The Bermuda Triangle of Performance Degradation
  • 4. Data Volume Software Changes Structure Changes System Performance OS Upgrades DB Server Upgrades New App Version Schema Changes Index Changes Partition Changes
  • 5.  To Improve Performance ◦ Buy more hardware ◦ Hire a performance tuning guru ◦ Do-It-Yourself performance tuning ◦ Reduce the data volume  To Maintain Performance ◦ Use SQL Plan Management to counteract query plan degradation ◦ Use Database Resource Manager to ensure that maximal resources are allocated to the most important tasks.
  • 6. From Stored Outlines to SQL Profiles to SQL Plan Management
  • 7. Oracle 8i Oracle 9i Oracle 10g Oracle 11g Stored Outlines SQL Profiles SQL Plan Management Plan Stability Limited Self-Tuning Auto Deactivate Self-Tuning Plan Baselines Plan History
  • 8.  SQL Plan Baselines are used to capture changes caused by: ◦ New optimizer version ◦ Changes to optimizer statistics and optimizer parameters ◦ Changes to schema and metadata definitions ◦ Changes to system settings ◦ SQL profile creation  Containing: ◦ Set of hints ◦ Plan hash value ◦ Plan-related information
  • 9.  First a baseline needs to be established by ◦ Capture a plan automatically by setting the OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES initialization parameter to TRUE (Default = FALSE) ◦ Load from existing plans  From SQL Tuning Sets and AWR snapshot  From the Cursor Cache ◦ Plans are automatically accepted and enabled. Set the OPTIMIZER_USE_SQL_PLAN_BASELINES parameter to FALSE to disable this behavior (Default = TRUE).
  • 10.  A SQL plan will be selected through this logic. ◦ Each time the database compiles a SQL statement, the optimizer does the following: 1. Uses a cost-based search method to build a best- cost plan 2. Tries to find a matching plan in the SQL plan baseline 3. Does either of the following depending on whether a match is found:  If found, then the optimizer proceeds using the matched plan  If not found, then the optimizer evaluates the cost of each accepted plan in the SQL plan baseline and selects the plan with the lowest cost
  • 11.  SQL Plan Management can evolve a plan by: ◦ Using the PL/SQL function DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE to evolve a plan captured into the baseline. ◦ Manually loading new plans from a SQL Tuning Set or the Cursor Cache into the Plan history. These plans are automatically accepted.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.  Automatic SQL Plan Management that adapts to most changes, except radical schema changes.  Only 2 parameters used: ◦ OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES ◦ OPTIMIZER_USE_SQL_PLAN_BASELINES  Pay close attention to the SYSAUX tablespace. It’s been used to store the plans. Automatic purge policy is in place, but only runs once a week.  Only available in 11gR1 and later  Stored Outlines and SQL Profiles are being depreciated.
  • 19.  More automation by using SQL Plan Baseline with SQL Tuning Advisor.  Freeze SQL Plans by using the FIXED parameter.  Export and Import SQL Plans. ◦ Fine tune SQL in a UAT environment or near production and then export plans via data pump and then import into production.
  • 20.  SQL Plan Management  SQL Tuning Advisor  SQL Tuning Sets  SQL Profiles  AWR  ADDM Are separately licensed features  Reference: E10821-05 Oracle Performance Tuning Guide 11g Release 2 (11.2)
  • 21. Throttle Down Your Resource Hogs
  • 22.  Database Resource Manager is designed to address the following problems: ◦ Excessive overhead ◦ Inefficient scheduling ◦ Inappropriate allocation of resources ◦ Inability to manage database-specific resources, such as parallel execution servers and active sessions
  • 23.  Resource consumer group ◦ A group of sessions that are grouped together based on resource requirements. The Resource Manager allocates resources to resource consumer groups, not to individual sessions.  Resource plan ◦ A container for directives that specify how resources are allocated to resource consumer groups. You specify how the database allocates resources by activating a specific resource plan.  Resource plan directive ◦ Associates a resource consumer group with a particular plan and specifies how resources are to be allocated to that resource consumer group.
  • 24.  There are three special consumer groups ◦ SYS_GROUP  Default group for the users sys and system. ◦ DEFAULT_CONSUMER_GROUP  Default group for all other user accounts. ◦ OTHER_GROUPS  Default group if there’s no active plan assigned to the groups above. This group must have an active plan.  User Defined Groups ◦ Map sessions to consumer groups based on CPU or I/O consumption thresholds.
  • 25.  Only one resource plan can be active for a consumer group.  Resource plans can contain sub-plans and can grow very complex. ◦ Remember that each plan level and sub plan level needs to add up to 100% and cannot exceed 100%. Plan A Plan B Group A Plan D Group B Group C Group D Group E 50% CPU 20% CPU 20% CPU 50% CPU 50% CPU 50% CPU 60% CPU
  • 26.  CPU ◦ Up to 8 levels of consumer group allocations  Active Session Pool with Queuing ◦ Max concurrent sessions per consumer group  Degree of Parallelism Limit ◦ Per session limit, but does not limit system setting  Automatic Consumer Group Switching ◦ Switch groups, typically higher to lower priority. ◦ Canceling SQL and Terminating Sessions  Execution Time Limit ◦ Estimate query run-time, trap and reschedule  Undo Pool ◦ Limits the undo for uncommitted transactions per consumer group  Idle Time Limit ◦ Terminating session when exceeded.
  • 27.
  • 28.
  • 29.
  • 30.  Resource Manager is on by default in 11g  To avoid surprises when installing or upgrading to 11g, switch the active resource plan from DEFAULT_PLAN to MIXED_WORKLOAD_PLAN.  Carefully plan your resource groups and plan directives.  I/O limit switching is available in 11gR1 and later.  Reference: E10595-07 Database Administrator's Guide 11g Release 2 (11.2)
  • 31. How ActiveBase Opens Closed Doors
  • 32.  SQL Plan Management ◦ Manages SQL plans, but does not optimize SQL queries. ◦ Protects the database from performance degradation due to common changes to the environment. ◦ Based on query optimizer cost calculation. ◦ 11gR1 and later only  Database Resource Manager ◦ Forces database sessions to play nicely. ◦ Moves offending sessions out of the way to give priority sessions all the resources possible. ◦ Protects the system from runaway queries. ◦ Based on CPU and I/O consumption. ◦ Latest features are 11gR1 and later only
  • 33.  ActiveBase Performance ◦ Dynamic SQL Optimization via the creative use of a rules- based SQL*Net Proxy that selectively intercepts and evaluates in-bound SQL generated by applications. When sub- optimal SQL is being submitted, the Proxy can re-structure the syntax of the statement to apply performance improvements which would then be executed by the database.  ActiveBase Priority ◦ Dynamic Server Prioritization via the creative use of a rules- based Session Monitor that can detect when the server load reaches various thresholds (e.g. 80%), which will then throttle down the resources allocated to lesser-important applications. The result is dynamic resource allocation that enables critical applications to maintain SLAs during peak processing periods.
  • 34. THANK YOU! Peter Dobler| Managing Partner Dynamic Database Solutions peter@dynamic-db.com 813 210 7060