Oracle Table Indexes Viewer

Displays index and index-column details for a specified table, including index name, column name, and column position. Useful for understanding indexing structure and supporting query optimization analysis.

oraclesqlindexing-statisticsv1.0.0
0 stars0 downloads16 views0 comments
By OracleDba • Created

Code

(26 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- -----------------------------------------------------------------------------------
-- File Name    : https://oracle-base.com/dba/monitoring/table_indexes.sql
-- Author       : Tim Hall
-- Description  : Displays index-column information for the specified table.
-- Requirements : Access to the DBA views.
-- Call Syntax  : @table_indexes (schema-name) (table-name)
-- Last Modified: 15/07/2000
-- -----------------------------------------------------------------------------------
SET LINESIZE 500 PAGESIZE 1000 VERIFY OFF

COLUMN index_name      FORMAT A30
COLUMN column_name     FORMAT A30
COLUMN column_position FORMAT 99999

SELECT a.index_name,
       a.column_name,
       a.column_position
FROM   all_ind_columns a,
       all_indexes b
WHERE  b.owner      = UPPER('&1')
AND    b.table_name = UPPER('&2')
AND    b.index_name = a.index_name
AND    b.owner      = a.index_owner
ORDER BY 1,3;

SET PAGESIZE 18 VERIFY ON

General Comments(0)

Tip: Click on a line number in the code to add a line-specific comment

No general comments yet. Be the first to comment!