Oracle 10g Performance: chapter 00 intro live_short

356 views
293 views

Published on

Published in: Technology, News & Politics
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
356
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
18
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • In Oracle Support I learned more faster than I think I could have anywhere. Porting gave me my first appreciation for the shareable nature of Oracle code and also a bit of disbelief that it worked as well as it did. Oracle France gave me an opportunity to concentrate on the Oracle kernel. At Oracle France I had 3 amazing experiences. First was being sent to the Europecar site where I first met a couple of the people who would later become the founding members of the Oaktable, James Morle and Anjo Kolk. The Europecar site introduced me to a fellow name Roger Sanders who first showed me the wait interface before anyone knew what it was. Roger not only used it but read it directly from shared memory without using SQL. Soon after Europecar I began to be sent often to benchmarks at Digital Europe. These benchmarks were some of my favorite work at Oracle. The benchmarks usually consisted of installing some unknown Oracle customer application and then having a few days to make it run as fast as possible. I first started using TCL/TK and direct shared memory access (DMA) at Digital Europe and got solid hands on tuning experience testing things like striping redo and proving it was faster long before people gave up arguing that this was bad from a theoretical point of view. Finally in France, my boss, Jean Yves Caleca was by far the best boss I ever had, but on top of that he was wonderful at exploring the depths of Oracle and explaining it to others, teaching me much about the internals of block structure, UNDO, REDO and Freelsits. I came back from France wanting to do performance work and especially graphical monitoring. The kernel performance group had limited scope in that domain, so I left for a dot com where I had my first run as the sole DBA for everything, backup, recovery, performance, installation and administration. I was called away by Quest who had my favorite performance tool Spotlight. It turns out thought that scope for expanding Spotlight was limited so I jumped at the chance in 2002 to restructure Oracle OEM. The work at OEM I’m proud of but still want to do much more to make performance tuning faster, easier and more graphical.
  • In Oracle Support I learned more faster than I think I could have anywhere. Porting gave me my first appreciation for the shareable nature of Oracle code and also a bit of disbelief that it worked as well as it did. Oracle France gave me an opportunity to concentrate on the Oracle kernel. At Oracle France I had 3 amazing experiences. First was being sent to the Europecar site where I first met a couple of the people who would later become the founding members of the Oaktable, James Morle and Anjo Kolk. The Europecar site introduced me to a fellow name Roger Sanders who first showed me the wait interface before anyone knew what it was. Roger not only used it but read it directly from shared memory without using SQL. Soon after Europecar I began to be sent often to benchmarks at Digital Europe. These benchmarks were some of my favorite work at Oracle. The benchmarks usually consisted of installing some unknown Oracle customer application and then having a few days to make it run as fast as possible. I first started using TCL/TK and direct shared memory access (DMA) at Digital Europe and got solid hands on tuning experience testing things like striping redo and proving it was faster long before people gave up arguing that this was bad from a theoretical point of view. Finally in France, my boss, Jean Yves Caleca was by far the best boss I ever had, but on top of that he was wonderful at exploring the depths of Oracle and explaining it to others, teaching me much about the internals of block structure, UNDO, REDO and Freelsits. I came back from France wanting to do performance work and especially graphical monitoring. The kernel performance group had limited scope in that domain, so I left for a dot com where I had my first run as the sole DBA for everything, backup, recovery, performance, installation and administration. I was called away by Quest who had my favorite performance tool Spotlight. It turns out thought that scope for expanding Spotlight was limited so I jumped at the chance in 2002 to restructure Oracle OEM. The work at OEM I’m proud of but still want to do much more to make performance tuning faster, easier and more graphical.
  • In Oracle Support I learned more faster than I think I could have anywhere. Porting gave me my first appreciation for the shareable nature of Oracle code and also a bit of disbelief that it worked as well as it did. Oracle France gave me an opportunity to concentrate on the Oracle kernel. At Oracle France I had 3 amazing experiences. First was being sent to the Europecar site where I first met a couple of the people who would later become the founding members of the Oaktable, James Morle and Anjo Kolk. The Europecar site introduced me to a fellow name Roger Sanders who first showed me the wait interface before anyone knew what it was. Roger not only used it but read it directly from shared memory without using SQL. Soon after Europecar I began to be sent often to benchmarks at Digital Europe. These benchmarks were some of my favorite work at Oracle. The benchmarks usually consisted of installing some unknown Oracle customer application and then having a few days to make it run as fast as possible. I first started using TCL/TK and direct shared memory access (DMA) at Digital Europe and got solid hands on tuning experience testing things like striping redo and proving it was faster long before people gave up arguing that this was bad from a theoretical point of view. Finally in France, my boss, Jean Yves Caleca was by far the best boss I ever had, but on top of that he was wonderful at exploring the depths of Oracle and explaining it to others, teaching me much about the internals of block structure, UNDO, REDO and Freelsits. I came back from France wanting to do performance work and especially graphical monitoring. The kernel performance group had limited scope in that domain, so I left for a dot com where I had my first run as the sole DBA for everything, backup, recovery, performance, installation and administration. I was called away by Quest who had my favorite performance tool Spotlight. It turns out thought that scope for expanding Spotlight was limited so I jumped at the chance in 2002 to restructure Oracle OEM. The work at OEM I’m proud of but still want to do much more to make performance tuning faster, easier and more graphical.
  • What allows Oracle, all the dials and knobs, to be the fastest, most robust database on the market also make it one of the most complicated on the market. For those few users that know and love the 1000s of performance options in Oracle, access to those performance options through sql and C code is the defacto standard. For seasoned users it is often difficult to understand why anyone would want to be limited by a GUI which can often be slower, and almost always lacking the latest commands allowed through interfaces such as SQL and C. On the OEM side, when a new tuning feature in the kernel is externalized in OEM (Oracle Enterprise Manager) it is often difficult to see the forest for the tree, or where and how that new feature fits into the grand scheme of things.
  • This presentation presented a challenge because many of the concepts were like the chicken and the egg. In order to explain one I needed the other. I ’ve tried to keep the subjects as linear as possible but sometimes I interweave from one to another.
  • In order to tune an Oracle database the first step in a complete analysis is to verify the machine because there are a couple of factors that can only be clearly determined by looking at machine statistics. Those two factors are Memory Usage CPU Usage Memory and CPU problems will have tell tale repercussions on Oracle performance statistics and thus can be deduced from just looking at the Oracle statistics, but it is clear just to start with the machine statistics. CPU For CPU, we check the “run queue” which is the number of processes that are ready to run but have to wait for the CPU. A machine free of CPU contention would have a run queue of 0 and could have CPU usage near 100% at the same time. A high CPU usage can be a good sign that the system is being utilized fully. On the other hand a high run queue will indicated that there is more demand for CPU than CPU power available. High run queue can be determined via Oracle statistics by looking at ASH data and seeing if more sessions are marked as being on the CPU than the number of CPUs available. For example if there are 4 sessions average active on CPU in the ASH data and only 2 CPUs then the machine is CPU bound. Solutions for high run queue are either to add more processors or reduce the load on the CPU. If the CPU is mainly being used by Oracle, then that is going to mean tuning the application and ther SQL queries. Memory If the machine is paging out to disk it means there is a memory crunch and can dramatically slow down Oracle. Oracle will sometimes indicate a paging problem through a spike in “latch free” waits but the only guarenteed method of diagnosing this problem is looking at the machine statistics. Machines have statistics for paging and free memory. Often there can be some free memory even when there is paging out because machines start paging out before memory is completely filled. Solutions if the machine is paging out are either to add more memory or to reduce memory usage. Memory usage can be reduced by reducing Oracle cache sizes or reducing Oracle session memory usage.
  • Oracle 10g Performance: chapter 00 intro live_short

    1. 1. Oracle Performance TuningKyle HaileyKylelf@gmail.comdboptimizer.com
    2. 2. Who is Kyle Hailey 1990 Oracle 90 support 92 Ported v6 93 France 95 Benchmarking 98 ST Real World Performance 2000 Dot.Com 2001 Quest 2002 Oracle OEM 10g Success!Success!First successful OEM designFirst successful OEM design
    3. 3. Who is Kyle Hailey 1990 Oracle 90 support 92 Ported v6 93 France 95 Benchmarking 98 ST Real World Performance 2000 Dot.Com 2001 Quest 2002 Oracle OEM 10g 2005 Embarcadero DB Optimizer
    4. 4. Who is Kyle Hailey 1990 Oracle 90 support 92 Ported v6 93 France 95 Benchmarking 98 ST Real World Performance 2000 Dot.Com 2001 Quest 2002 Oracle OEM 10g 2005 Embarcadero DB Optimizer DelphixWhen not being a Geek- Have a little 4 year old boy who takes up all my time
    5. 5. Typical ArchitectureDatabaseDatabaseFile systemFile systemProductionProductionInstanceInstanceDatabaseDatabaseFile systemFile systemDevelopmentDevelopmentInstanceInstanceDatabaseDatabaseFile systemFile systemQAQAInstanceInstanceDatabaseDatabaseUATUATInstanceInstanceFile systemFile system
    6. 6. Database VirtualizationDevelopmentDevelopmentInstanceInstanceDatabaseDatabaseProductionProductionInstanceInstanceFile systemFile systemvDatabasevDatabaseQAQAInstanceInstanceUATUATInstanceInstancevDatabasevDatabase vDatabasevDatabaseNFSNFSSourceSource ClonesClonesFiberFiberChannelChannel
    7. 7. My GoalSimplify the informationand empower the DBA
    8. 8. How do you tune a Database?“Database is running slow!”•What :• first step?• questions do you ask?• tools?Do you have a repeatable method?
    9. 9. What statistics do you look at?
    10. 10. Launch: PressureMidnightJanuary 28, 1986Lives are on the lineThanks to Edward Tufte
    11. 11. 13 Pages Faxed
    12. 12. Original Engineering dataonly showed damage““damages at the hottestdamages at the hottestand coldest temperature”and coldest temperature”-- managementmanagement
    13. 13. Congressional Hearings Evidence
    14. 14. Clearer1. Include successes2. Mark Differences3. Normalize same temp4. Scale known vs unknown5555 6565 75756060 7070 808044881212448812123030 4040 50503535 4545XX
    15. 15. Difficult NASA Engineers Fail Congressional Investigators Fail Data Visualization is DifficultBut …Lack of Clarity can be devastating
    16. 16. What statistics do you look at?AASAAS
    17. 17. Solutions• Clear Identification• Know how to identify problems and issues• Access to details• Provide solutions and/or information to address the issues• Graphics• Easy understanding, effective communication and discussion
    18. 18. First Step: Graphics“The humans … are exceptionally goodat parsing visual information,especially when that information iscoded by color and/or .”Knowledge representation in cognitive science. Westbury, C. & Wilensky, U. (1998)motionmotion
    19. 19. Why Use Graphics   You cant imagine how many times I was told that nobody wanted orwould use graphics …-- Jef Raskin, the creator of the MacintoshInfocus – (overhead projectors) sited astudy that humans can parse graphicalinformation 400,000 times faster thantextual data
    20. 20. Counties in US 3101 Counties 50 pages
    21. 21. “If I cant picture it, I cant understand it”Anscombes QuartetI II III IVx y x y x y x y10 8.04 10 9.14 10 7.46 8 6.588 6.95 8 8.14 8 6.77 8 5.7613 7.58 13 8.74 13 12.74 8 7.719 8.81 9 8.77 9 7.11 8 8.8411 8.33 11 9.26 11 7.81 8 8.4714 9.96 14 8.1 14 8.84 8 7.046 7.24 6 6.13 6 6.08 8 5.254 4.26 4 3.1 4 5.39 19 12.512 10.84 12 9.13 12 8.15 8 5.567 4.82 7 7.26 7 6.42 8 7.915 5.68 5 4.74 5 5.73 8 6.89Average 9 7.5 9 7.5 9 7.5 9 7.5Standard Deviation 3.31 2.03 3.31 2.03 3.31 2.03 3.31 2.03Linear Regression 1.33 1.33 1.33 1.33- Albert Einstein- Albert Einstein
    22. 22. Graphics for Anscombe’s Quartet
    23. 23. What is a day in the life look likeWhat is a day in the life look likefor a DBA who has performancefor a DBA who has performanceissues?issues?Tuning the DatabaseAnscombes QuartetI II III IVx y x y x y x yAverage 9 7.5 9 7.5 9 7.5 9 7.5Standard Deviation 3.31 2.03 3.31 2.03 3.31 2.03 3.31 2.03Linear Regression 1.33 1.33 1.33 1.33ComplexComplexAveragesAverages
    24. 24. LOADLOADTopTopActivityActivitySQLSQL EventsEvents SessionsSessionsMax CPUMax CPU(yard stick)(yard stick)How Can We Open the Black Box?
    25. 25. LOADLOADTopTopActivityActivitySQLSQL EventsEvents SessionsSessionsGet DetailsGet DetailsClick hereClick hereMax CPUMax CPU(yard stick)(yard stick)How Can We Open the Black Box?
    26. 26. How Can We Open the Black Box?OEMOEM ASHMON/SASHASHMON/SASH DB OptimizerDB Optimizer•Powerful - Identifies issues quickly and powerfully•Interactive - Allows exploring the data•Easy - Understandable by everyone, DBA, Dev and Managers !
    27. 27. Ideas for TodayASHASHSamplingSamplingWaitsWaitsAASAAS
    28. 28. Before Tuning Oracle, Tune the MachineMake sure the machine is healthy before tuning Oracle CPU => use run queue, < 2 * #CPU Memory => page outVMSTAT
    29. 29. Sections Statspack ASH AAS OEM 10g Buffer Cache IO Redo Enqueues Shared Pool SQL*Net SQL Tuning
    30. 30. Do You Want?Engineering Data?Engineering Data?
    31. 31. Do You Want?Pretty PicturesPretty Pictures
    32. 32. Do You Want?Clean and ClearClean and Clear? ? ? ?? ? ? ?? ?? ?
    33. 33. Imagine Trying to Drive your CarAnd is updated once and hourAnd is updated once and hourOr would you like it toOr would you like it tolook …look …Would you want your dashboard to look like :Would you want your dashboard to look like :
    34. 34. Or This
    35. 35. Embarcadero35
    36. 36. Summary1.Machine - vmstat Memory, CPU (we can see IO response in Oracle)1.Database - AAS Use wait interface and graphics Identify machine, application, database or SQL1.SQL - VST Indexes, stats, execution path Visual SQL Tuning
    37. 37. Bibliographywww.simple-talk.com/sql/performance/designing-efficient-sql-a-visual-approach/www.simple-talk.com/sql/performance/designing-efficient-sql-a-visual-approach/Refactoring SQL Applications – Stephane FaroultTroubleshooting Oracle Performance – Christian AntogniniSQL Tuning – Dan TowCost-Based Oracle Fundamentals – Jonathan Lewis
    38. 38. Books The Visual Display ofQuantitative Information Eduard Tufte Oracle Wait Interface Kirtikumar Deshpande, K. Gopalakrishnan SQL Tuning Dan TowDesignDesignWaitsWaitsSQLSQL
    39. 39. Books Jonathan Lewis Cost-Based Oracle (Tough Read) Practical Oracle 8i (easy read) Oracle Insights Kyle Hailey & Oaktable MembersDirectDirectMemoryMemoryAttachAttachOracleOracleOptimizerOptimizer
    40. 40. ENDCopyright 2006Copyright 2006
    41. 41. When to Tune1. Machinea) CPU Response times skewed 100% CPU might be fine Users wait in queue (run queue) => machineunderpowereda) Memory Paging Wait times skewed (ex : latch free) Erratic response times ( ex : ls )1. Oracle1) Waits > CPU ? tune waits1) CPU > 100% ? tune top CPU SQL1) Else It’s the applicationOracle LoadOracle Load(AAS)(AAS)Top SessionTop Session Top WaitTop Wait Top SQLTop SQLSQL DetailSQL Detail Session DetailSession Detail File DetailFile DetailObject DetailObject Detail Wait DetailWait DetailHostHostAAS >AAS >#CPU#CPUAAS > 1AAS > 1Waits >Waits >CPUCPUCPU >CPU >WaitsWaitsCPUCPUMemoryMemory
    42. 42. Summary1.Database - AAS Profile database Use wait interface and graphics Identify machine, application, database or SQL1.SQL - VST Indexes, stats, execution path Visual SQL Tuning

    ×