Tuesday, February 10, 2015

SQL: How to view information of the indexes of a table (INDEX_OWNER, COLUMN_NAME, UNIQUENESS)

The Following sql would return these information of the indexes of a table.

SELECT
      col.index_owner,
      ind.index_name,
      DECODE(ind.uniqueness, 'UNIQUE', 'YES', 'NO') UNIQUENESS,
      col.column_name,
      col.column_position,
      ind.tablespace_name
FROM dba_ind_columns col, dba_indexes ind
WHERE ind.index_name = col.index_name
      AND ind.table_name='<table_name>'
      AND ind.table_owner = col.table_owner
ORDER BY col.index_owner, ind.index_name, col.column_position;

-------------------------------------------------------------------------------------------------

                        
If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book free here.

No comments:

Post a Comment