Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get information about an index and table owner in Oracle?

Tags:

sql

oracle

I want to write a select statement to display the index_name, table_name, table_owner and uniqueness that exist in the data dictionary for the table user indexes. Any help would be great. My problem is I havent been able to find how to display an index_name, and table owner.

SELECT owner, table_name   FROM dba_tables; 

This gives most of it.

like image 368
Randy Avatar asked Oct 05 '11 23:10

Randy


People also ask

How do I find the owner of an index in Oracle?

SELECT owner, table_name FROM dba_tables; This gives most of it.

How do I find the owner of an Oracle Database?

Look for the file named "oratab", usually found in either /etc or /var/opt/oracle. In there you will find for each database the name of the home directory for that database. The owner of that directory should be the owner of the installation and of all databases running from the home.


1 Answers

According to the docs, you can just do:

select INDEX_NAME, TABLE_OWNER, TABLE_NAME, UNIQUENESS from USER_INDEXES 

or

select INDEX_NAME, TABLE_OWNER, TABLE_NAME, UNIQUENESS from ALL_INDEXES 

if you want all indexes...

like image 158
beny23 Avatar answered Oct 13 '22 03:10

beny23