Re: Oracle system table
From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Wed, 28 Jul 2010 08:38:34 +0200
Message-ID: <4c4fd067$0$6891$9b4e6d93_at_newsspool2.arcor-online.net>
On 28.07.2010 07:16, Mounilk wrote:
> Hi,
> I am working on oracle database which has a few tables that do not
> have any primary keys. Unfortunately, I cannot modify the table
> designs.
>
> I need to find out the fields in the table that make the record
> unique.
>
> I am not very familiar with Oracle and its system tables, but am
> pretty sure I should be able to get this information from some system
> table.
>
> Any help is greatly appreciated.
>
> Regards,
> MounilK
Date: Wed, 28 Jul 2010 08:38:34 +0200
Message-ID: <4c4fd067$0$6891$9b4e6d93_at_newsspool2.arcor-online.net>
On 28.07.2010 07:16, Mounilk wrote:
> Hi,
> I am working on oracle database which has a few tables that do not
> have any primary keys. Unfortunately, I cannot modify the table
> designs.
>
> I need to find out the fields in the table that make the record
> unique.
>
> I am not very familiar with Oracle and its system tables, but am
> pretty sure I should be able to get this information from some system
> table.
>
> Any help is greatly appreciated.
>
> Regards,
> MounilK
You can achieve uniqueness in oracle by utilization of unique indexes or
unique constraints. To find them you can query
select * from user_indexes where uniqueness='UNIQUE'
resp.
select * from user_constraints where constraint_type = 'U'
After you have the names, you can drill down to columns - there are
user_ind_columns and user_cons_columns.
For all user_ views there are as well all_/dba_ which may be less/more
sutitable for your needs.
Best regards
Maxim Received on Wed Jul 28 2010 - 01:38:34 CDT