This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Custom Report - Top SQL by O/S User

DESCRIPTION

This custom report will list the Top N SQL statements in your instance for a specified O/S user name. To use this report, run it from SQL*Plus while connected to the Ignite repository database.

SQL*PLUS SCRIPT

select id, name from cond order by name;

prompt Which Database ID

accept DBID

prompt Enter Start Date (mm/dd/yy hh24:mi)

accept BeginDate

prompt Enter End Date (mm/dd/yy hh24:mi)

accept EndDate

prompt How many SQLs should be displayed

accept HowMany

prompt Enter the OS username

accept OSUser

set pagesize 999

set linesize 132

column hash_or_name format a22

select hash_or_name, timesecs from (

  select nvl(n.name, sw.izho) hash_or_name, sum(sw.qp/100) timesecs

  FROM consw_&DBID sw, cono_&DBID o, con_sql_name n

  where sw.d between to_date('&BeginDate','mm/dd/yy hh24:mi') and to_date('&EndDate','mm/dd/yy hh24:mi')

  and sw.ixoy = o.id

  and sw.izho = n.hash emoticons_plus.png

  and upper(o.name) = upper('&OSUser')

  group by nvl(n.name, sw.izho)

  order by sum(sw.qp/100) desc)

where rownum <= &HowMany

order by timesecs desc

/

Parents
  • Here's another option.  How many users are you interested in showing?  You can show more than 10 or 15 users on a chart by using the Advanced Options.  And that way you have the nice colored graph to show management - most managers love colorful charts because they can tell the impact at a glance that way.

    To show more than the top 15 users, go to Options at the very top of the Home screen, then choose the Administration tab, then Advanced Options under Configuration, then the DB Instance Options tab.  Use the dropdown to select your instance; then scroll down and select the blue hyperlink called Number_of_Items_in_TimeSeries_Charts.  Now you'll be able to set some high number that may show all your users - hopefully it's not hundreds - I've never tried more than 50 myself on one of these charts - but maybe it can even show hundreds?

Reply
  • Here's another option.  How many users are you interested in showing?  You can show more than 10 or 15 users on a chart by using the Advanced Options.  And that way you have the nice colored graph to show management - most managers love colorful charts because they can tell the impact at a glance that way.

    To show more than the top 15 users, go to Options at the very top of the Home screen, then choose the Administration tab, then Advanced Options under Configuration, then the DB Instance Options tab.  Use the dropdown to select your instance; then scroll down and select the blue hyperlink called Number_of_Items_in_TimeSeries_Charts.  Now you'll be able to set some high number that may show all your users - hopefully it's not hundreds - I've never tried more than 50 myself on one of these charts - but maybe it can even show hundreds?

Children
No Data