How to find which queries is using which indexes

So, I have a db 11gr2 and many indexes. Since I would like to delete some of them, I could see which indexes are unused, but I would like to see if some of indexes are used ony by one or two queries...
how could I found that?

If you have license for AWR views, use the below sql to identify indexes used.
This script has following bind variable
a1: owner
a and b: begin and end of snapshot
a2: tablespace name where your index exists
As suggested in this thread, do not plan to drop Foriegn key indexes if they are not listed.
col object_name for a30
col tablespace_anme fora 12
col count for 9999
col operation for a35
col options for a25
set lines 160
select c.*, d.tablespace_name
from (select
a.object_name ,
a.operation ,
a.options ,
count(1)
from
dba_hist_sql_plan a,
dba_hist_sqlstat b
where
a.object_owner ='&a1'
and
a.operation like '%INDEX%'
and
a.sql_id = b.sql_id
and b.snap_id between &a and &b
group by
a.object_name,
a.operation,
a.options
order by
4 desc) c,
dba_segments d
where c.object_name=d.segment_name
and d.tablespace_name='&a2'

Similar Messages

  • How find out which user is using which company code?

    Hi Gurus,
    I am having more than 500 users in Production System.I need to find out which user is using which company code?I can get the roles and users separately from two different SAP tables.
    Is it possible to get it from a single table or Tcode?
    Best Regards,
    Rahman

    Hi,
    Thanks for the update.Yes I tried with SUIM.But I was unable to find any clue.
    Regards,
    Rahman

  • How to find which user is using the index?

    Hi All,
    I have an index named 'CTXT_ITEM_CODE' . The Index _type is Domain. When i try to drop this index its telling ORA-00054: resource busy and acquire with NOWAIT specified error
    now i need to find out which session is using this index, so that i can kill it and drop the index.
    Thanks

    SELECT c.owner,
           c.object_name,
           c.object_type,
           b.SID,
           b.serial#,
           b.status,
           b.osuser,
           b.machine
      FROM v$locked_object a, v$session b, dba_objects c
    WHERE b.SID = a.session_id AND a.object_id = c.object_id
    AND c.object_name='CTXT_ITEM_CODE';
    ALTER SYSTEM KILL SESSION '<sid, serial#>'

  • How to find in R/3 System, which FI document is from which external system?

    Hi Moderator/ FICO Experts,
    How to find in R/3 System, which FI document is from which external system?
    In case of different Non-SAP external Systems posting the data to one R/3 System.
    Thanks
    Chandra

    Hi,
    That really depends on the interfaces that your external systems are using. Check with your ABAP or BASIS team to see what is the method used for posting those documents and with which parameters is passed. Look at BKPF table (FI header) to see the attributes such as user, document type, reference, etc.
    Regards,
    Eli

  • How to find out my 5 computers which have been authorized for Itunes.

    How to find out my 5 computers which have been authorized for Itunes.

    Sorry, but you can't. You can, however,  log into your iTunes Store and use the "deauthorize all" command and then reauthorize the computers you're using now.
    Regards.

  • How to find bex query name of which dashboard built on?

    How to find bex query name of which dashboard built on?

    Hello,
    When you add a "SAP BW Connection" to you dashboard, you find in the output parameters the query technical name and the query description. you can bind it to the embedded spreedsheet and then use it in yoyr dashboard
    Best regards,
    Mohamed AISSA

  • How to find material and vendor combination which has freight conditions?

    Hi Please help me, its very urgent.
    How to find material and vendor combination which has freight conditions?
    Waiting for your help.
    Regards,
    Marella.

    Hi marella,
    Try MEKA transaction.
    Gopi

  • How to find unused queries in BWD?

    How to find unused queries in BWD?
    Please let me know the process after finding  unused queries to delete them,and  what are the various possibilities we need check before deleting??

    Hi Bharani,
    You can use Transaction RSZDELETE for deletion of query objects with respect to many selections.
    In that you have one selection as 'Last Used'. So you can deleted these queries which are very old and not used for long time.
    In case if you want to see these queries you can check in the table RSZCOMPDIR using SE16 giving the technical name of the query and here also you can find the field called 'Last Used'.
    Based on this you will be able to decide which query you can delete.
    Reward points if helpful.
    Kind Regards,
    Raghu

  • Which query is using which Hierarchy?

    Hello All,
    Where can i get the information like which query is using which hierarchy!?
    I tried to make it happen by combining lot of tables like
    RSRREPDIR
    RSZELTPROP
    RSZELTXREF
    RSHIEDIR
    RSZCOMPDIR
    but couldn't arrive at a solution. Did u guys come across such a situation!?
    If so please brief me how?
    Thanks
    Karthik

    Please see this link for a solution:
    Queries that use a hierarchy
    Hope this helps.
    Regards
    PS: assign points is the way to say thanks

  • How to find the queries based on the hierarchy

    Hi experts,
    Many queries are using one hierarchy.now I want to know which queries are using this hierarchy. How to make it? Thank you.
    Best regards,
    Gavin

    Under this object check where used list. Then you should get the list of queries where this hierarchy is used.
    Regards
    Rohini

  • How to find the query name using infoset name

    Hi Experts
           Iam new to the sap queries(SQ01,SQ02), some queries already created.
          now i want to do some modification, my problem is i am not able to find the query name.
          I know the infoset name, can you tell me how to find the query name using the infoset name, is ther any table for this.
    i tried in sq01 also, but its confusion, pls advice me on this.
    thanks in advance.
    regards
    rajaram

    Hi
    try like this..
    SQ02 --> go to --> Query Directory..
    from there you can get all the queries belong to a Infoset.

  • TS1368 I want to delete a lot of things childrens stories, albums which are not used which that are on my ipad. However when I go through Itunes it wont show me most of the stuff in my library. it takes ages to delete one at a time.

    I want to delete a lot of things childrens stories, albums which are not used which that are on my ipad. However when I go through Itunes it wont show me most of the stuff in my library. it takes ages to delete one at a time.
    Can you help please?

    Thanks King_Penguin for taking time to read and reply. 
    I just purchased this movie on Thursday, May 15, so just a few days ago.  I have never had any trouble whatsoever since I have been in Vietnam.  I have downloaded several movies and even music and they have all synced to my respected Apple products except for this purchase. 
    Sorry, I don't quite understand what you mean by studios and different versions.  Could you please explain? 
    I checked my purchased list in my purchase history under my account and there are no hidden items. 

  • How to find out the Transactions used per month & the USER who used that

    Hi,
    1)How to find out the Transactions used per month & the USER who used that?
    2)and can i get the above same for minimum 20 month?
    System : SAP- Enterprise Core Component.

    You can use my program...
    *& Report  Z_ABAP_TCODE_MONITOR
    *****&  Program Type          : Report                                 *
    *****&  Title                 : Z_ABAP_TCODE_MONITOR                   *
    *****&  Transaction code      : ZTCODE_USAGE                           *
    *****&  Developer name        : Shailendra Kolakaluri                  *
    *****&  Deveopment start date : 26 th Dec 2011                         *
    *****&  Development Package   : ZDEV                                   *
    *****&  Transport No          : DEVK906086                                       *
    *****&  Program Description   : This program is to display
    *List all tcodes executed during previous day.
    *& Show the number of users executing tcodes
    *& Modification history
    REPORT  Z_ABAP_TCODE_MONITOR.
    *& List all tcodes executed during previous day.
    *& Show the number of users executing tcodes
    TYPE-POOLS : slis.
    DATA: ind TYPE i,
          fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          layout TYPE slis_layout_alv,
          variant TYPE disvariant,
          events  TYPE slis_t_event WITH HEADER LINE,
          heading TYPE slis_t_listheader WITH HEADER LINE.
    *REPORT  z_report_usage.
    TYPES: BEGIN OF zusertcode,
      date   TYPE swncdatum,
      user   TYPE swncuname,
      mandt     TYPE swncmandt,
      tcode     TYPE swnctcode,
      report TYPE swncreportname,
      count     TYPE swncshcnt,
    END OF zusertcode.
    *data   : date type n.
    DATA: t_usertcode  TYPE swnc_t_aggusertcode,
          wa_usertcode TYPE swncaggusertcode,
          wa           TYPE zusertcode,
          t_ut         TYPE STANDARD TABLE OF zusertcode,
          wa_result    TYPE zusertcode,
          t_result     TYPE STANDARD TABLE OF zusertcode.
    PARAMETER: month TYPE dats DEFAULT sy-datum.
    *PARAMETER: date TYPE dats.
    *select-options : username for wa_usertcode-account.
    START-OF-SELECTION.
    PERFORM get_data.
    PERFORM get_fieldcatalog.
      PERFORM set_layout.
    PERFORM get_event.
    PERFORM get_comment.
      PERFORM display_data.
    FORM get_data .
    *date = sy-datum - 2 .
    After start-of-selection add this line (parameter Month required 01 as day).
      concatenate month+0(6) '01' into month.
      CALL FUNCTION 'SWNC_COLLECTOR_GET_AGGREGATES'
        EXPORTING
          component     = 'TOTAL'
          ASSIGNDSYS    = 'DEV'
          periodtype    = 'M'
          periodstrt    = month
        TABLES
          usertcode     = t_usertcode
        EXCEPTIONS
          no_data_found = 1
          OTHERS        = 2.
      wa-date  = month.
    *wa-date  = date.
      wa-mandt = sy-mandt.
    wa_usertcode-account = username.
      LOOP AT t_usertcode INTO wa_usertcode.
        wa-user = wa_usertcode-account.
        IF wa_usertcode-entry_id+72 = 'T'.
          wa-tcode  = wa_usertcode-entry_id.
          wa-report = space.
        ELSE.
          wa-tcode  = space.
          wa-report = wa_usertcode-entry_id.
        ENDIF.
        COLLECT wa INTO t_ut.
      ENDLOOP.
      SORT t_ut BY report ASCENDING.
      CLEAR: wa, wa_result.
    endform.
    FORM get_fieldcatalog .
    fcat-tabname     = 't_ut'.
    fcat-fieldname   = 'DATE'.
    fcat-seltext_l   = 'Date'.
    fcat-key         = 'X'.
    APPEND fcat.
      CLEAR fcat.
      fcat-tabname     = 't_ut'.
      fcat-fieldname   = 'MANDT'.
      fcat-seltext_l   = 'Client'.
      fcat-key         = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-tabname     = 't_ut'.
      fcat-fieldname   = 'USER'.
      fcat-seltext_l   = 'User Name'.
      fcat-key         = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-tabname     = 't_ut'.
      fcat-fieldname   = 'TCODE'.
      fcat-seltext_l   = 'Transaction Code'.
      fcat-key         = 'X'.
      APPEND fcat.
    ENDFORM.
    *&      Form  SET_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM set_layout .
      layout-colwidth_optimize = 'X'.
    ENDFORM.                    " SET_LAYOUT
    *&      Form  GET_EVENT
          text
    -->  p1        text
    <--  p2        text
    *FORM get_event .
    events-name = slis_ev_top_of_page.
    events-form = 'TOP_OF_PAGE'.
    APPEND events.
    *ENDFORM.                    " GET_EVENT
    **&      Form  GET_COMMENT
          text
    -->  p1        text
    <--  p2        text
    *FORM get_comment .
    DATA: text(30).
    text = 'Billing Report'.
    heading-typ = 'H'.
    heading-info = text.
    APPEND heading.
    *ENDFORM.                    " GET_COMMENT
    **&      Form  top_of_page
          text
    -->  p1        text
    <--  p2        text
    *FORM top_of_page .
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
         it_list_commentary       = heading[]
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
    *ENDFORM.                    " top_of_page
    *&      Form  DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
      sort t_ut[].
    DELETE ADJACENT DUPLICATES FROM t_ut[] COMPARING ALL FIELDS.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-cprog
          is_layout          = layout
          it_fieldcat        = fcat[]
          i_save             = 'A'
          is_variant         = variant
          it_events          = events[]
        TABLES
          t_outtab           = t_ut
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " DISPLAY_DATA

  • How to find out query name using Elements of the query builder.

    Hi SDNers,
    how to find out query name using Elements of the query .
    thanks,
    satyaa

    Hi,
    For having a look at the relation between BEx tables,check the link below:
    http://wiki.sdn.sap.com/wiki/display/BI/ExploretherelationbetweenBEx+Tables
    -Vikram

  • How to find the File name using the FTP Adapter

    hi all,
    how to find the File name using the FTP Adapter with BPEL.
    Regards

    Found the solution for this.
    First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
    In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
    Thanks for the posts

Maybe you are looking for

  • Licensing for this product has stopped working Error: 5

    OK. Totally frustrated here. Trying to start InDesign (installed with Master Collection CS4) on Powerbook Pro running 10.5.7 and consistently get the error above: "Licensing for this product has stopped working" and with error: 5. I have attached a d

  • Help with J2EE Project Management

    Hi, We are about to begin a large J2EE project and are wondering if anyone could help with the following questions: 1. Given the division of labor on J2EE projects (JSP developers, EJB developers, application deployers, etc...), what are "best practi

  • Why doesn't dimming my screen affect the estimated battery time remaining?

    rMBP 15". The brightness of my screen greatly affects the battery life. At near-full brightness it will discharge from 100% to 20% in about two hours. At the lowest brightness setting, it lasts between four and five hours. However, when I click the b

  • Using You Tube video clips question:

    After importing several clips from You Tube (of varying quality) to incorporate into an editing project, the clips look okay and play  full screen, in the "source" window, but when I put them in the timeline and play them in the "program" window, the

  • Exporting flash to quicktime

    I have tried exporting from flash to a QT movie using Flash MX AND CS4. Each time I get an error "The installed version of QuickTime does not have a handler for this type of Macromedia Flash movie" I have changed publish settings to ALL options (incl