Monday, February 8, 2010

Oracle PL/SQL queries 1 - How to see the indexes created in your Database

Assuming that you are given the user role - 'whatever' and your database is called 'arschloch', if you want to see what indexes are created on which tables in the 'arschloch' database, use:

USER_IND_COLUMNS - COLUMNs comprising user's INDEXes and INDEXes on user's TABLES (user being 'whatever' in this context):
INDEX_NAME
Index name
TABLE_NAME
Table or cluster name
COLUMN_NAME
Column name or attribute of object column
COLUMN_POSITION
Position of column or attribute within index
COLUMN_LENGTH
Maximum length of the column or attribute,in bytes
CHAR_LENGTH
Maximum length of the column or attribute,in characters
DESCEND
DESC if this column is sorted descending on disk,otherwise ASC

i.e. select index_name, table_name, column_name from user_ind_column where rownum <5;

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails