DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: How to: Find out using Sql stats, whether a PK is an index/or part of a unique inde??

  1. #1
    Join Date
    Jan 2007
    Posts
    12

    How to: Find out using Sql stats, whether a PK is an index/or part of a unique inde??

    Im looking at the All_Indexes Table but i can only get info on indexes as a whole. and not what columns are contained within so i cannot determine if the column is an index

    also im looking to find also through sql code, to what columns, certain partitions apply to? Any help is highly appreciated. Thanks

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    you can try dba_ind_columns, dba_cons_columns and dba_constraints

    rgds

  3. #3
    Join Date
    Sep 2003
    Location
    over the hill and through the woods
    Posts
    995
    This will give you the column name and the order that they are being called within the table.

    Code:
    Select column_name, column_position,descend, table_name
    from    sys.DBA_IND_COLUMNS
    where   index_owner = &a
    and     index_name  = &b
    This will tell you what columns are patitioned in a table.
    Code:
    Select COLUMN_NAME, COLUMN_POSITION 
    FROM 
    sys.DBA_PART_KEY_COLUMNS 
    WHERE name=&tablename'
    and owner='&shcemaname'
    ORDER BY NAME, COLUMN_POSITION
    Hope this helps.
    Oracle it's not just a database it's a lifestyle!
    --------------
    BTW....You need to get a girlfriend who's last name isn't .jpg

  4. #4
    Join Date
    Jan 2007
    Posts
    12
    cool Thanks. that helps alot!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width