Slide 1

Slide 1 text

1 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. A Deep Dive Into the SQL Monitoring Report Greg Rahn Real-World Performance Group, Server Technologies

Slide 2

Slide 2 text

2 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. About Me •  Over 7 years in Real-World Performance Group •  Twitter: @GregRahn •  Blog: http://structureddata.org NoCOUG 2011-11-09

Slide 3

Slide 3 text

3 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Program Agenda •  Quick Intro •  Walkthroughs •  Summary NoCOUG 2011-11-09

Slide 4

Slide 4 text

4 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. What is SQL Monitoring? •  Introduced in Oracle Database 11g •  Enables performance monitoring of SQL statements while they are executing •  Allows execution details stored in offline report NoCOUG 2011-11-09

Slide 5

Slide 5 text

5 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. What statements get monitored? •  Monitors –  Serial statements with 5 seconds of total CPU/IO time –  All parallel statements –  Includes queries / DML / DDL –  Always on, enabled out of the box •  Hints –  MONITOR –  NO_MONITOR NoCOUG 2011-11-09

Slide 6

Slide 6 text

6 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. How do I get a SQL Monitoring Report? •  GUI via Oracle Enterprise Manager –  Performance Page –  SQL Monitoring Link –  Click on completed or currently executing statement •  Command line via SQL*Plus –  pagesize 0 linesize 1000 trimspool on trim on long 2000000 longchunksize 2000000! –  dbms_sqltune.report_sql_monitor(! sql_id=>’2foo4uy583wtf’, type=>’ACTIVE’)! –  Types: TEXT (default), or ACTIVE (same as EM) NoCOUG 2011-11-09

Slide 7

Slide 7 text

7 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 7 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 NoCOUG 2011-11-09

Slide 8

Slide 8 text

8 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 8 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 NoCOUG 2011-11-09

Slide 9

Slide 9 text

9 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 9 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 NoCOUG 2011-11-09

Slide 10

Slide 10 text

10 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Monitored SQL Executions •  Let’s take a look… Oracle Enterprise Manager NoCOUG 2011-11-09

Slide 11

Slide 11 text

11 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 11 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 Status Duration Parallel Info DB Time IO Requests Start/End SQL Text Queued Running Completed Error Queued/Execution Parallel Degree PX Downgraded NoCOUG 2011-11-09

Slide 12

Slide 12 text

12 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Active SQL Monitoring Report •  Serial Execution •  Parallel Execution •  PL/SQL Basic Overview NoCOUG 2011-11-09

Slide 13

Slide 13 text

13 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Walkthrough Scenarios •  PDML disabled vs. PDML enabled •  Bad cardinality •  Undersized PGA •  Parallel skew NoCOUG 2011-11-09

Slide 14

Slide 14 text

14 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Benefits of SQL Monitor Reports •  Always on •  Currently executing statements •  Recently completed statements •  Execution information •  Execution plans •  Performance profile •  Both on-line and off-line NoCOUG 2011-11-09

Slide 15

Slide 15 text

15 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Q&A NoCOUG 2011-11-09

Slide 16

Slide 16 text

16 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. NoCOUG 2011-11-09

Slide 17

Slide 17 text

17 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.