SELECT I.INDEX_NAME,I.INDEX_TYPE,I.NUM_ROWS,I.DEGREE, C.COLUMN_NAME,C.COLUMN_POSITION FROM DBA_INDEXES I JOIN DBA_IND_COLUMNS C ON (I.INDEX_NAME = C.INDEX_NAME) WHERE I.OWNER='MYSCHEMA' AND I.OWNER = C.INDEX_OWNER AND I.TABLE_NAME='MYTABLE' ORDER BY I.INDEX_NAME, C.COLUMN_POSITION;
Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.
Monday, January 31, 2022
Simple SQL to list
The following SQL lists the indexes defined on a table, along with the columns and their positioning:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment