Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: What columns are in the Primary Key
> -----Original Message-----
> From: Helmut Daiminger [mailto:hdaiminger_at_vivonet.com]
>
> Is there a data dictionary view that gives me all the columns
> in a primary
> key of a table?
Try user_cons_columns.
It would probably be of interest to you to take a peek at the DBA_ views that are present in Oracle. See the Oracle Reference Manual. To get a list of those views, you can say
select view_name from dba_views where owner = 'SYS' ;
or to get a list of DBA_, ALL_, USER_ views you could do something like this select
decode (substr (view_name, 1, 4), 'USER', view_name, ' ' || view_name) as view_name from dba_views where owner = 'SYS' and (view_name like 'DBA\_%' escape '\' or view_name like 'ALL\_%' escape '\' or view_name like 'USER\_%' escape '\' )
Typicall the DBA_ views show you information on all objects in the database, the ALL_ views show you information on all objects to which your logon user has access, and the USER_ views show you information on all objects owned by your logon user.
Once you're familiar with the DBA_ views, then you want to graduate to the V$ views. Finally, for dessert, you can look at X$ "tables", but only if you're good.