Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Making an ERD from an existing db
Hi Dan,
you can use the datadictionary views dba_constraints,all_constraints and user_constraints
in the column constraint_type you see 'P' for Primary Keys 'U' for Unique Keys and 'R' for Foreign Keys. For the Constraint_type 'R' check out the column r_constraint_name for the Unique or Primary Key Constraint_Name for the referenced table
Hoppe this helps
Kalle
Dan Roberts schrieb:
> Hello All
>
> I have an existing Oracle rdbms for which I would like to draw up an ERD.
> How can I get PK and FK information from the DB in the process of
> determining the realtionships btw the tables as I do a desc on each
> table??
>
> Thanks!!.Dan
>
> --
> NOTE:REMOVE THE *.* in my address for direct replies
> Dan Roberts
> BRISTOL-MYERS SQUIBB PHARM. RES. CENTER "Nature is last at Bats"
> PRINCETON, NEW JERSEY U.S.A. PLANET EARTH, MILKY-WAY GALAXY
> <<<<INTERNET ADDRESS>>>>Roberts_Daniel_G.PriLVMS4_at_MSMAIL.BMS.COM
--
Karl-Heinz Schubert Tel. : +49 40 89091-255
Senior Consultant Fax : +49 40 89091-222
Notkestraße 15
22607 Hamburg e-mail: kschuber_at_de.oracle.com
Legal Disclaimer: The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation.