Snippet Name: Tab Indexes
Description: Returns all indexes and the position of index.
Comment: (none)
Language:
Highlight Mode: PLSQL
Last Modified: March 01st, 2009
|
SET linesize 132;
SET verify off;
--col tblsp format a20 heading 'Tablespace';
col index_owner format a8 heading 'Owner';
col table_name format a20 heading 'Table Name';
col column_name format a20 heading 'Column';
col pos format 999 heading 'Pos';
col unqnss format a5 heading 'Unique';
break ON table_name skip 1;
SELECT sys.dba_ind_columns.index_owner index_owner,
sys.dba_indexes.index_name index_name,
DECODE(sys.dba_indexes.uniqueness,'UNIQUE','YES','NO') unqnss,
sys.dba_ind_columns.column_name column_name,
sys.dba_ind_columns.column_position pos
-- sys.dba_indexes.tablespace_name tblsp
FROM sys.dba_ind_columns, sys.dba_indexes
WHERE sys.dba_indexes.index_name = sys.dba_ind_columns.index_name AND
sys.dba_indexes.table_owner = sys.dba_ind_columns.table_owner AND
sys.dba_indexes.table_name LIKE UPPER('&1')
ORDER BY sys.dba_ind_columns.index_owner, sys.dba_indexes.index_name,
sys.dba_ind_columns.column_position; |