Ash masters : advanced ash analytics on Oracle

Click here to load reader

download Ash masters : advanced ash analytics on Oracle

of 127

  • date post

    24-Jan-2017
  • Category

    Software

  • view

    618
  • download

    7

Embed Size (px)

Transcript of Ash masters : advanced ash analytics on Oracle

  • **ASH MastersKyle [email protected]/khaileyASH SQL Query Repository

    **Have you ever been hiking in the Yosemite?I went hiking in Yosemite by myself. I was friends with one of the park rangers in Yosemite.She love to hike and she always hiked off trail.She told me about a beautiful lake off trail that would be wonderful to hike to.The lake was just on the other side of the mountain crest from where we were.She gave me a topographic map to use.Have you ever used a topographic map?Its a map that shows elevations with contour lines.Each line denotes say 50 of elevation change.The more lines together closer together the steeper the terrain.I used this map to plot out a course to the lake that didnt have cliffs or other obstacles.I managed to make it to the top of the mountain crest and when there I could see the beautiful lake below way off any trail.From where I was it was a steep descent of 300 feet to the lake. All approaches looked the same on the topographic map.As I approached the lake it got steeper and steeper and steeper.I finally found my self on a vertial face with no way to go down fatherAnd unsure if I could even climb back up. I was stuck.Then I thought if I got here with a big back pack on, I can certainly climb back up without it!I gingerly undid the clips and slid my backpack off my back.SwooshIt went down the rock face.Unbeknownst to me, there was a snow ramp at the bottom of the clift left over from the winter.My pack hit the snow ramp at full force and went shooting out into the middle of the lake.Here I was like at 8pm at on a late summers dusk in the mountains at 11000 feet way off train aftera day of hiking and my backpack with my foot, shelter, warm clothing was in the middle of a lake 100-200 feet below.Lucky for me my backpack floated and before long had floated to the side of the lake.I went back up tried a different path down and made it. But it just goes to show that the user interface of this particular topographic map didnt distinguish between an impenetrable 200 feet and a navigat-able 200 feet drop.Hi, my names Kyle Hailey, and I love working with user interface s that help me navigate the world.

  • Save the DateCOLLABORATE 17 registration will open on Thursday, October 27.

    Call for SpeakersSubmit your session presentation! The Call for Speakers is open until Friday, October 7

    collaborate.ioug.org

  • How do you tune a Database?Database is running slow!first step?questions?tools?repeatable method?

    **

  • What statistics do you look at?Disastrously difficult

    *

  • Imagine Trying to Drive your Car And is updated once and hourOr would you like it to look Would you want your dashboard to look like :

    *

  • Max CPU(yard stick)

    Top Activity SQLSessionsLOADDont always have OEM, but always have SQL

    *

  • Ideas for TodayASHSamplingWaitsOEMWhere does the OEM data come from ?

    *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. Ive tried to keep the subjects as linear as possible but sometimes I interweave from one to another.

  • Ideas for TodayASHSamplingWaits

    OEM

    *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. Ive tried to keep the subjects as linear as possible but sometimes I interweave from one to another.

  • Copyright 2006 Kyle HaileyStatspack = always availableInstallConnect as [email protected]?/rdbms/admin/spcreate.sqlRunExec statspack.snap;Generate [email protected]?/rdbms/admin/spreport.sql

    AWR SQL> @?/rdbms/admin/awrrpt.sql

    Where do you get data ?

    *

  • Sections (10g)

    Instance descriptionHost hardwareSnapshot headlineCache informationLoad profileInstance efficiencyShared pool statsTop timed eventsHost CPU loadHost / Instance CPU warningVM activityMemory usageTime model statsRAC statisticsAll wait eventsBackground wait eventsEvent histogramSQL x 9Instance activityLog switchesOS statsLatch parent and childMutexSegment stats x 8Dictionary cacheLibrary cacheRAC (GES)RAC (CR and CUR served)RAC (cache xfer x 2)RAC (Remastering)Streams x 7Shared pool advisorJava pool advisorSGA resizingSGA target advisorSGA summarySGA detailSQL memory summaryResource limitsParametersSession details x 3Tablespace I/OFile I/OFile I/O histogramBuffer poolInstance RecoveryBuffer pool advisoryBuffer busy waitsVarious PGA summariesPGA histogramPGA advisoryPGA allocation summaryPGA allocation top NEnqueue (lock) activityUndo stats x 2Latch activityLatch miss details

  • Statspack Method

    Load profile good for having a feel for the application and comparing two periods for changes Efficiency ratios misleading carry over from version 6 days

    SummaryWaits

    Who/WhenBig Picture

    *

  • Latch Free Top 5 Timed Events~~~~~~~~~~~~~~~~~~ % TotalEvent Waits Time (s) Ela Time-------------------------------------------- ------------ ----------- --------latch free 9,652 760 66.10CPU time 248 21.62PL/SQL lock timer 41 123 10.72SQL*Net message from dblink 681 14 1.22log file parallel write 128 1 .13 -------------------------------------------------------------What Latch? There are 100s

    *

  • Row Locks 10g+op 5 Timed Events Avg %Total~~~~~~~~~~~~~~~~~~ wait CallEvent Waits Time (s) (ms) Time----------------------------------------- ------------ ----------- ------ ------enq: TX - row lock contention 59 160 2714 41.8PL/SQL lock timer 4 117 29291 30.6CPU time 28 7.2buffer busy waits 1,217 18 15 4.7log file parallel write 422 11 27 3.0Who is waitingWho is blockingWhat is the SQLWhat is the row?

    *

  • Buffer Busy WaitTop 5 Timed Events~~~~~~~~~~~~~~~~~~ % TotalEvent Waits Time (s) Call Time-------------------------------------------- ------------ ----------- ---------buffer busy waits 2,748 250 78.72CPU time 32 10.16free buffer waits 1,588 15 4.63write complete waits 10 8 2.51log buffer space 306 5 1.51 ------------------------------------------------------------Buffer Busy Wait trying to modify a block Who blocks? What object? what is the SQL?

    *

  • Statspack fails for analysisSolution : Sampling ASHSamplingWaits

    OEM

    *

  • ExampleLook at Statspack:

    Top 5 Timed Events~~~~~~~~~~~~~~~~~~ % TotalEvent Waits Time (s) Call Time-------------------------------------------- ------------ ----------- ---------buffer busy waits 2,748 250 78.72CPU time 32 10.16free buffer waits 1,588 15 4.63write complete waits 10 8 2.51log buffer space 306 5 1.51 ------------------------------------------------------------

    *

  • What do we do?buffer busy wait ??Need:SQLSessionsObjects Statspack or AWR fail

    *

  • Solution V$sessionWho is waiting (like buffer busy waits )While happeningDataSqlSessionObjectType of buffer busy waitFile and block involved in buffer busy waitProblem: waits over, data is goneSolution: Sample data

    *

  • Sample Query select nvl(s.username,s.program) username, s.sid sid, s.serial# serial, s.sql_hash_value sql_hash_value SQLID , substr(decode(w.wait_time, 0, w.event, 'ON CPU'),1,15) event , w.p1 p1, w.p2 p2, w.p3 p3from v$session s, v$session_wait wwhere w.sid=s.sidand s.status='ACTIVE'and s.type='USER';This query works since v7SQL StateUserOnly Active UsersDetailsUniqueIdentifiers

    *

  • Sampling Output USERNAME SID SERIAL SQL_HASH_V EVENT P1 P2 P3---------- ----- -------- ---------- -------------------- -------- -------- ----SYS 64 8717 4116021597 PL/SQL lock timer 300 0 0SYS 58 19467 961168820 ON CPU 16508152 1 0STARGUS 71 6251 1311875676 direct path write 201 2155902 127(CJQ0) 9 1 0 rdbms ipc message 500 0 0Run sample query every second and save into a table v$ashCreate table v$ash as select ;Insert into v$ash select ; -- wait 1 secInsert into v$ash select ; -- wait 1 secInsert into v$ash select ;Insert into v$ash select ;

    *

  • Buffer busy wait typeSQL> Select count(*), p3 from v