All SQL currently in the Library Cache for a specific table
                                                 Last update (2008-04-14 10:58:14)
                                                                                                                   Date added (2008-04-14 10:53:19)

Summary
If you want to find all the sql statements stored in the Library Cache that used a specific table execute the following. For example for table GL.GL_INTERFACE
SELECT /*+ ORDERED USE_HASH(D) USE_HASH(C) */
  SUM(C.KGLOBT13)  DISK_READS,
  SUM(C.KGLHDEXC)  EXECUTIONS,
  C.KGLNAOBJ  SQL_TEXT
FROM SYS.X$KGLOB O, SYS.X$KGLDP D, SYS.X_$KGLCURSOR C
WHERE
  O.INST_ID = USERENV('Instance') AND
  D.INST_ID = USERENV('Instance') AND
  C.INST_ID = USERENV('Instance') AND
  O.KGLNAOWN = UPPER('GL') AND
  O.KGLNAOBJ = UPPER('GL_INTERFACE') AND
  D.KGLRFHDL = O.KGLHDADR AND
  C.KGLHDADR = D.KGLHDADR
GROUP BY C.KGLNAOBJ ORDER BY 1 DESC;
Tip: As you can see the first column of the query is DISK_READS. You can start tuning statements which have the big number of disk reads and number of executions.
Reviews
Categories
Oracle DBA-> (147)
  Alertlog (3)
  Archivelog (5)
  Auditing (1)
  Backup - Recovery (19)
  Database files (6)
  Database options (2)
  DB links (2)
  Dependencies (1)
  Dictionary (2)
  Exp-Imp Datapump (6)
  Jobs (2)
  Mview (2)
  Networking (3)
  Objects (7)
  Parameters (2)
  Redologs (6)
  Roles - Grants (2)
  Rollback - Undo (8)
  Segments (3)
  Sequences (2)
  Sessions (14)
  SGA (14)
  Tables (10)
  Tablespaces (10)
  Temp (4)
  Toad (5)
  Transactions (1)
  Upgrade (2)
  Users (3)
Oracle APPS DBA-> (66)
Exadata (1)
Performance Tuning-> (59)
Oracle Real Cases (24)
Oracle Errors (23)
Oracle SQL tricks (32)
Oracle RAC (3)
Oracle Security (8)
Filters
Search