Wednesday, November 07, 2007

SQL to find out indexes on a table

Quick reference to find out indexes on a table from the command prompt.
select * from user_indexes where table_name = 'MY_TABLE'
select * from user_ind_columns where index_name = 'PK_MY_INDEX'
To find out the triggers on a table:
select * from user_triggers where table_name = 'MY_TABLE'