Way to find which tables are being accessed

Hi Guys
I have a large database and i want to find which tables are not being accessed (even select) from a specific period of time. is there any way to find out . I am using oracke 10g release 1
Regards
Khurana
Edited by: Khurana on Sep 8, 2009 4:29 PM

select sp.object_owner,sp.object_name,
(select sql_text from v$sqlarea sa
where sa.address = sp.address
and sa.hash_value =sp.hash_value) sqltext,
(select executions from v$sqlarea sa
where sa.address = sp.address
and sa.hash_value =sp.hash_value) no_of_full_scans,
(select lpad(nvl(trim(to_char(num_rows)),' '),15,' ')||' | '||lpad(nvl(trim(to_char(blocks)),' '),15,' ')||' | '||buffer_pool
from dba_tables where table_name = sp.object_name
and owner = sp.object_owner) "rows|blocks|pool"
from v$sql_plan sp
where operation='TABLE ACCESS'
and object_owner IN ('YOUR_USER_NAME')
order by 1,2
It will tell you that currently "OBJECT_NAME" is being accessed; but i think it is for full table scan.
Source:http://www.oracle.com/technology/oramag/code/tips2005/032105.html
Regards
Girish Sharma

Similar Messages

  • How to find which tables are being used by a workbook.

    I was asked by the client to generate a report which will show the Workbook name and it's corresponding tables/views.
    Any idea on how to use the EUL tables for this purpose. I know the SQL query to find the tables in case the workbook was run at least once. But I want to show the Workbook and it's table details even the report was never run.
    Advanced thanks,
    Lokesh.

    Hi Jay
    While we're on the subject of scripts, here's a couple more you might like:
    Script 1:
    =========
    This one shows you how many times an item has been used. It is useful for determining how often users make use of items in a folder. It could be used as research for a materialized view, for dropping items which are not used, or for understanding usage.
    SELECT
    OBJ.OBJ_NAME FOLDER,
    EXP.EXP_NAME ITEM,
    COUNT(QPP.QS_ID) USAGE
    FROM
    EUL5_OBJS OBJ,
    EUL5_QPP_STATS QPP,
    EUL5_EXPRESSIONS EXP
    WHERE
    OBJ.OBJ_NAME = <Folder Name>
    AND OBJ.OBJ_ID = EXP.IT_OBJ_ID
    AND INSTR(QPP.QS_OBJECT_USE_KEY,OBJ.OBJ_ID) > 0
    AND INSTR(EUL5_GET_ITEM_NAME(QPP.QS_ID),EXP.EXP_ID) > 0
    GROUP BY
    OBJ.OBJ_NAME,
    EXP.EXP_NAME;
    Script 2:
    =========
    This one examines the whole EUL and displays a count of the number of times a worksheet has been run by folder. It also shows the date and time of the last run. This one is useful to determine the most and / or least popular worksheets. Adjusting the ORDER BY clause can throw up some interesting results.
    SELECT
    OBJ.OBJ_NAME FOLDER,
    MAX(QPP.QS_CREATED_DATE) LAST_DATE,
    QPP.QS_DOC_OWNER OWNER,
    QPP.QS_DOC_NAME WORKBOOK_NAME,
    QPP.QS_DOC_DETAILS SHEET_NAME,
    COUNT(QPP.QS_ID) USAGE
    FROM
    DRAKE.EUL5_OBJS OBJ,
    DRAKE.EUL5_QPP_STATS QPP
    WHERE
    INSTR(QPP.QS_OBJECT_USE_KEY,OBJ.OBJ_ID) > 0
    GROUP BY
    OBJ.OBJ_NAME,
    QPP.QS_DOC_OWNER,
    QPP.QS_DOC_DETAILS,
    QPP.QS_DOC_NAME
    ORDER BY
    OBJ.OBJ_NAME,
    COUNT(QPP.QS_ID) DESC;
    I'm considering a blog entry of useful EUL scripts. Anyone interested? Yes - either reply here or drop me a line.
    Best wishes
    Michael

  • How to get which tables are being updated by running any transaction code

    Hi experts,
    please tell me how to find which system table are being updated after running any transaction code .
    please tell me the procedure to find that.
    Thanks & Regards,
    Yogesh

    Hi yogesh patil,
    for the dbtable..
    goto technical settings and activate the log...
    it will tells u..
    transaction...Table history (SCU3)
    Log data changes
    The logging flag defines whether changes to the data records of a table
    should be logged. If logging is activated, every change (with UPDATE,
    DELETE) to an existing data record by a user or an application program
    is recorded in a log table in the database.
    Note: Activating logging slows down accesses that change the table.
    First of all, a record must be written in the log table for each change.
    Secondly, many users access this log table in parallel. This could cause
    lock situations even though the users are working with different
    application tables.
    Dependencies
    Logging only takes place if parameter rec/client in the system profile
    is set correctly. Setting the flag on its own does not cause the table
    changes to be logged.
    The existing logs can be displayed with Transaction Table history (SCU3)
    Reward points if helpful

  • Which tables are being used to extract the data for the materi Extractors

    Hi
    please advise which tables are used to extract the data for the extarctors
    0MAT_SALES_ATTR,
    0MATERIAL_ATTR,
    0MAT_PLANT_ATTR
    0PLANT_ATTR
    ,Many thanks.

    Hi,
    Activate a database trace using ST01. Then perform the MM03 operation and goto the SD Texts tab. Now stop the trace and see if you can locate either a table or program which you can utilize in the log.
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/55f993545a11d1a7020000e829fd11/frameset.htm
    Hope this helps..
    Rgs,
    Ravikanth.

  • Find which tables are linked to this one via foreign keys

    Hi, I need to drop & recreate a table, but this table is referenced by other tables via foreign key constraints.
    1. Is there a query I can run to find those tables (the ones referencing this one) ?
    2. What is the standard way to drop & recreate this table being referenced by others?

    1) You can try the following query:
    select r.owner, r.table_name
    from user_constraints r, user_constraints o
    where r.r_owner = o.owner and r.r_constraint_name = o.constraint_name
    and o.constraint_type in ('P','U') and r.constraint_type = 'R'
    and o.table_name = 'DEPT'
    2) To drop tables with references you can also use drop table cascade constraints,
    which will also drop constraints from tables:
    [email protected]> drop table dept;
    drop table dept
    ERROR at line 1:
    ORA-02449: unique/primary keys in table referenced by foreign keys
    [email protected]> drop table dept cascade constraints;
    Table dropped.
    Another way is to prepare a script which will remove the tables in proper order.
    Best Regards
    Krystian Zieja / mob

  • How to find which tables are filling by a transaction

    hi ,
            what is the process to know which talbes are filled by a particular transaction eg, by using tcode vd03 we  create customer , which we can see in kna1 tables.

    Use trace like
    - SQL trace, [ST05 (doc)|http://help.sap.com/erp2005_ehp_04/helpdata/EN/43/cb632772cd0cd4e10000000a1553f7/frameset.htm] will show you the tables accessed.
    - performance trace, [SE30 (doc)|http://help.sap.com/erp2005_ehp_04/helpdata/EN/00/e0a73e5b7a424de10000000a114084/frameset.htm] will show you the tables accessed, the FM used, etc.
    NB: VD03 is an inquiry transaction, i suppose you meant VD01
    Regards

  • How can I find out which tables are having DDL locks?

    I can see related information by querying DBA_DDL_LOCKS view, but it doesn't give me the information which tables are having DDL locks.
    Is there a way I can find out which tables are having DDL locks?
    Thanks!

    Here's a long script written back in 2001. Still works:
    BREAK on sid on serial# on username
    COL sid        for 9999
    COL serial#    for 99999
    COL username   for a20
    COL type       for a20    trunc
    COL lmode      for a5     trunc
    COL lrequest   for a4     trunc
    COL detail     for a75    trunc
    SELECT   s.sid
           , s.serial#
           , s.username
           , DECODE(
                  l.TYPE
                -- Long locks
                , 'TM', 'dml/data enq (TM)'
                , 'TX', 'transac enq (TX) '
                , 'UL', 'pls usr lock (UL)'
                -- Short locks
                , 'BL', 'buf hash tbl (BL)'
                , 'CF', 'control file (CF)'
                , 'CI', 'cross inst f (CI)'
                , 'CU', 'cursor bind (CU) '
                , 'DF', 'data file (CF)   '
                , 'DL', 'direct load (DL) '
                , 'DM', 'mount/strtup (DM)'
                , 'DR', 'reco lock (DR)   '
                , 'DX', 'distrib tran (DX)'
                , 'FI', 'sga opn file (FI)'
                , 'FS', 'file set (FS)    '
                , 'IN', 'instance num (IN)'
                , 'IR', 'instce recvr (IR)'
                , 'IS', 'get state (IS)   '
                , 'IV', 'libcache inv (IV)'
                , 'JQ', 'job queue (JQ)   '
                , 'KK', 'log sw kick (KK) '
                , 'LS', 'log switch (LS)  '
                , 'MM', 'mount def (MM)   '
                , 'MR', 'media recvry (MR)'
                , 'PF', 'pwfile enq (PF)  '
                , 'PR', 'process strt (PR)'
                , 'RW', 'row wait (RW)    '
                , 'RT', 'redo thread (RT) '
                , 'SC', 'scn enq (SC)     '
                , 'SM', 'smon lock (SM)   '
                , 'SN', 'seqno instce (SN)'
                , 'SQ', 'seqno enq (SQ)   '
                , 'ST', 'space transc (ST)'
                , 'SV', 'seqno value (SV) '
                , 'TA', 'generic enq (TA) '
                , 'TD', 'dll enq (TD)     '
                , 'TE', 'extend seg (TE)  '
                , 'TS', 'temp segment (TS)'
                , 'TT', 'temp table (TT)  '
                , 'UN', 'user name (UN)   '
                , 'WL', 'write redo (WL)  '
                , 'TYPE = ' || l.TYPE) AS type
           , DECODE(l.lmode, 0, 'none', 1, 'null', 2, 'RS', 3, 'RX', 4, 'S', 5, 'SRX', 6, 'X', TO_CHAR(l.lmode)) A
    S lmode
           , DECODE(l.request, 0, 'none', 1, 'null', 2, 'RS', 3, 'RX', 4, 'S', 5, 'SRX', 6, 'X', TO_CHAR(l.request
    )) AS lrequest
           , DECODE(
                  l.TYPE
                , 'JQ', 'Job #' || j.job || ' (' || j.what || ') owned by: ' || j.username
                , 'MR', DECODE(s.user_type, 'BG', 'DICTIONARY OBJECT', LOWER(obj.owner) || '.' || LOWER(obj.name))
    || ' (' || LOWER(obj.TYPE) || ')'
                , 'RT', 'thread #' || LOWER(l.id1)
                , 'RW', 'file#' || LOWER(SUBSTR(l.id1, 1, 3)) || ', block#' || LOWER(SUBSTR(l.id1, 4, 5)) || ', ro
    w#' || LOWER(l.id2)
                , 'TD', 'object: ' || LOWER(obj.owner) || '.' || LOWER(obj.name) || ' (' || LOWER(obj.TYPE) || ')'
                , 'TM', 'object: ' || LOWER(obj.owner) || '.' || LOWER(obj.name) || ' (' || LOWER(obj.TYPE) || ')'
                , 'TS', DECODE(l.id2, 0, 'enqueue', 'new block allocation')
                , 'TX', DECODE(
                             lo.object_name
                           , NULL, 'rbs #' || TRUNC(l.id1 / 65536) || ', slot #' || LOWER(l.id1)
                           , 'rbs #' || TRUNC(l.id1 / 65536) || ', slot #' || LOWER(l.id1) || ', object: ' || LOWE
    R(lo.object_name))
                , 'UL', 'lock name: ' || la.name || ', expiration date: ' || TO_CHAR(la.expiration, 'DD-MON-RR HH2
    4:MI:SS')
                , 'WL', 'redo log file#' || LOWER(l.id1)
                , 'id1 = ' || l.id1 || ', id2 = ' || l.id2) AS detail
        FROM sys.v_$lock l
           , (SELECT a.sid
                   , a.serial#
                   , NVL(a.username, 'SYS (' || LOWER(b.name) || ')') AS username
                   , DECODE(a.username, NULL, 'BG', 'USER') AS user_type
                FROM sys.v_$session a
                   , sys.v_$bgprocess b
               WHERE a.paddr = b.paddr(+)) s
           , (SELECT o.obj#
                   , u.name AS owner
                   , o.name
                   , DECODE(
                          o.type#
                        , 0, 'NEXT OBJECT'
                        , 1, 'INDEX'
                        , 2, 'TABLE'
                        , 3, 'CLUSTER'
                        , 4, 'VIEW'
                        , 5, 'SYNONYM'
                        , 6, 'SEQUENCE'
                        , 7, 'PROCEDURE'
                        , 8, 'FUNCTION'
                        , 9, 'PACKAGE'
                        , 11, 'PACKAGE BODY'
                        , 12, 'TRIGGER'
                        , 13, 'TYPE'
                        , 14, 'TYPE BODY'
                        , 19, 'TABLE PARTITION'
                        , 20, 'INDEX PARTITION'
                        , 22, 'LIBRARY'
                        , 23, 'DIRECTORY'
                        , 24, 'QUEUE'
                        , 28, 'JAVA SOURCE'
                        , 29, 'JAVA CLASS'
                        , 30, 'JAVA RESOURCE'
                        , 32, 'INDEXTYPE'
                        , 33, 'OPERATOR'
                        , 34, 'TABLE SUBPARTITION'
                        , 35, 'INDEX SUBPARTITION'
                        , 39, 'LOB PARTITION'
                        , 40, 'LOB SUBPARTITION'
                        , 43, 'DIMENSION'
                        , 44, 'CONTEXT'
                        , 47, 'RESOURCE PLAN'
                        , 48, 'CONSUMER GROUP'
                        , 51, 'SUBSCRIPTION'
                        , 52, 'LOCATION'
                        , 'UNDEFINED') AS type
                FROM sys.obj$ o
                   , sys.user$ u
               WHERE o.owner# = u.user#) obj
           , (SELECT vlo.xidusn
                   , vlo.xidslot
                   , vlo.xidsqn
                   , vlo.process
                   , o.owner || '.' || o.object_name AS object_name
                FROM sys.v_$locked_object vlo
                   , sys.dba_objects o
               WHERE vlo.object_id = o.object_id) lo
           , (SELECT job
                   , schema_user AS username
                   , what
                FROM dba_jobs) j
           , sys.dbms_lock_allocated la
       WHERE l.sid = s.sid
         AND l.id1 = obj.obj#(+)
         AND l.id2 = j.job(+)
         AND TRUNC(l.id1 / 65536) = lo.xidusn(+)
         AND LOWER(l.id1) = lo.xidslot(+)
         AND l.id2 = lo.xidsqn(+)
         AND l.id1 = la.lockid(+)
         AND l.TYPE != 'MR'
    UNION ALL
                      /*** LATCH HOLDERS ***/
    SELECT   s.sid
           , s.serial#
           , s.username
           , 'latch'
           , 'X'
           , 'none'
           , h.name || ' addr=' || LOWER(RAWTOHEX(laddr)) AS object
        FROM sys.v_$process p
           , sys.v_$session s
           , sys.v_$latchholder h
       WHERE h.pid = p.pid
         AND p.addr = s.paddr
    UNION ALL
                      /*** LATCH WAITERS ***/
    SELECT   s.sid
           , s.serial#
           , s.username
           , 'latch'
           , 'none'
           , 'X'
           , name || ' latch=' || p.latchwait AS object
        FROM sys.v_$session s
           , sys.v_$process p
           , sys.v_$latch l
       WHERE latchwait IS NOT NULL
         AND p.addr = s.paddr
         AND p.latchwait = l.addr
    ORDER BY sid
           , serial#
           , username
           , 4
           , 5
           , 6
           , 7;

  • How to find out which queries are being used ?

    We have a number of InfoSet Queries which the users are calling from SQ00. Some of them are very old.
    I would like to find out which queries are being used, so we can have the idle queries decommissioned.
    How can this be done ?
    Best regards,
    Peter

    Hi,
    It's been a while since I've done this but one method is to use ST03N & look for the execution of programs with an AQ* prefix.  The general structure is AQZZ/<query user group><query name>.
    You could probably get the same info from the audit log but I've not checked that.
    Cheers,

  • Is there a way to determine which rows are inserted in JDT1 table by the system automatically?

    Hi,
    Is there a way to determine which rows are inserted in JDT1 table by the system automatically? Example, many GLs which are mapped in GL Account Determination, like Foreign Exchange Gain / Loss, Rounding Account, etc. are inserted by the system automatically in the Journal Entry on various scenarios, like during Incoming Payment, etc.
    Which SQL query can give me those rows? Basically the WHERE condition should be based on which column or multiple columns in JDT1 table?
    Thanks.

    Hi Rajesh,
    I'm not entirely sure but I think the TransId is the same in the header that belongs to the transaction.
    OINV.TransId = JDT1.TransId
    Best regards,
    Pedro Magueija

  • How to find which datasource are using  tables AFRU ,CAUFV and AUFM

    *how to find which datasource are using  tables AFRU ,CAUFV and AUFM*

    Hi,
    You can enter your table names in SE11 transaction and click "Display" and again click "Where -Used-List". Then it will show all the places where these tables are used(Datasources)
    Hope this helps.....
    Regards,
    SUman

  • In I06, I have no way of knowing which songs are on my iphone 4s vs being stored in the cloud. There used to be a small cloud next to songs that were not downloaded. This was important to make sure I had the music I wanted when in an airplane.

    In the new i06 that I just loaded into my 4s, I have no way of knowing which songs are on my iphone vs stored in the cloud. There used to be a small cloud next to songs that were not on the phone. This is an important piece of information if you are a frequent traveller, as most of the flights I am on don't have onboard wifi, so it becomes a crap shoot as to what I will have available to listen to.
    Is there a way I can view what songs are actually stored locally?

    Go to Settings > Music and set "show all music" to OFF.

  • A way to find out tables and fields referred by a transaction

    I want to know whether there is a way to find all the database tables and fields referred by a transaction. I know that we can do F1 on each field to get the reference table and the fielname but its taking a lot of time for me..I need to know if there is any program or a way(some tool) to find out the tables and fieldnames for a transaction. Any help would be greatly appreciated..
    Thanks,
    Mohsin.

    Hi Mohsin,
    As suggested <b>SQL Trace</b> is the best Option.
    Say inorder to Find the field inf. you can use SQL trace (ST05) .
    <b>Steps for the same:</b>
    1) Go to ST05 --> Activate Trace.
    2) Run the trasaction , make some changes to the field for which you want to have the table name then SAVE.
    3) Go again to ST05 ---> Deactive Trace
    4) List trace
    5) Then search for the chaged value which u had done on that transaction.
    6) With this you will be able to see the table name in the Obj. name column.
    **How can we find out what tables are being referred for what field???.
    For this , one way which i follow other then F1 is :
    <b>i follow Steps 2 and step 5</b> which help me to locate those values only for which i am looking for the table only as with the changed value in transaction which u had done in step 2 and after saving it it will go to the DB table and on searching the same changed value in the trace give u the quick link of the table .
      It helped me many times and saves time by doing linke this otherwise u have got all the options to as suggested by the FORUM .
    Cheers
    Sunny
    Rewrd points, if found helpful

  • How to figure out which tables are using Extensible Optimizer?

    Hi guys,
    I'm sure that there're several tables those are associated with Extensible Optimizer in my database, I can also find the Extensible Optimizer relevant type and the implementation of interface functions ODCIGetInterfaces, ODCIStatsTableFunction.
    I'm curious to know is there a way to figure out which tables are associated with this Extensible Optimizer, does anyone have any clues?
    Database: oracle 11.2
    Thank you in advance.

    Hi,
    Can you please check the below link.It may help you:
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28425/ext_optimizer.htm
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com

  • How can I find which applications are using the most power?

    I have recently noticed a full charge of power doesn't last as long as it used to on my iPad 2.  Is there some way to determine which applications are using the most power?
    I have been monitoring my home network router accesses and have noticed the iPad logs accesses every 15 seconds.  This only happened recently.  It had been well behaved and only accessing once or twice a day before.  I installed the most recent iTunes upgrade, per suggestions during a Sync.  The problems seemed to occur after this update.  I have gone through all the settings and have minimized the applications requiring higher power (I switch off the location services unless I'm away from home.  Likewise, I turn off my cellular carrier unless I'm away from home, etc.)
    In short, how can I maximize my power usage (aside from turning it off)?
    Thanks.
    Dave

    Thanks for responding so quickly.
    I'm really trying to find out why the battery is depleting much faster than it used to all of a sudden.  I used to be able to put a full charge on it and it would last about 5 to 6 days with normal use (normal for me).  Now that battery only lasts about 2 to 3 days with the same use.
    I DO recharge it when it needs to be charged but this is indicating there is something else (new) that is causing the power drain.

  • Which table are notification status in?

    hi,dear experts,
    Do you know which table are notification status in? and which fields are they? I can't find them in table QMEL.
    And, which table are the system status of notification in? which fields are they?
    I are doing a report and need these information. I used ST05 to trace IW29,but i failed.
    Thank you very much.

    JEST

Maybe you are looking for

  • Need  interview questions on SAP-XI  3.0

    HI all, Can some body help me. I am Explicitly luking for NEW (or updated ) interview questions and i am abt to start my interviews from tommorrow. any idea where i can find more info on SPECIFIC XI interview questions/FAQS other than the available s

  • How to confiture virtual hosts with multiple domain names

    hello, I've read through some of the postings here on virtual hosts, but I thought I'd better solicit advice before I actually try some of the things I've read about. In a nutshell, I've purchased multiple domain names that I'd like to alias to a new

  • Migrating to new Active Directory Domain

    Hey people, I have a OSX Server here at a school which I need to move from an old Active Directory domain to a new one. We are having a restructure of our IT System and 90% of our equipment is PC but have a few macs on site for the specific tasks tha

  • Help -- vectors

    i am writing an editor and i have run into a problem. I am using vectors to keep track of the documents that opened. the documents are displayed in a JTabbedPane and i am using a JTextArea for editing them. When i try to do go to Select All of i get

  • Difference between ';' and '/' in the SQL scripts

    Hi All, Could anyone please let me know the difference between placing ';' and '/' in the sql scripts. I am placing couple of insert statements in a textfile with .sql extension and running it from the sql prompt. Which one( ';' or '/') should be kee