--the script finds the missing indexes on FK SELECT * FROM ( SELECT c.table_name, cc.column_name, cc.position column_position FROM user_constraints c, user_cons_columns cc WHERE c.constraint_name = cc.constraint_name AND c.constraint_type = 'R' MINUS SELECT i.table_name, ic.column_name, ic.column_position FROM user_indexes i, user_ind_columns ic WHERE i.index_name = ic.index_name ) ORDER BY table_name, column_position;
this blog is intended to be a place to store code snippets, examples, notes... in order to have them handy and to quickly find during the everyday work
Search This Blog
Friday, 18 November 2011
foreign keys without indexes
In Oracle database a foreign keys without an index defined on it could lead to contention problems (enq: TM – contention wait event).
The following script retrieves foreign keys not having indexes
Etichette:
Oracle
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment