0

I just imported data into an oracle database from a dump file. But I want to know constraints to enable me to make an Entity Relationship diagram and its links.

I used

select * from cat;

to get the description of each table. But this is not showing constraints and looks cumbersome to explore all tables like this.

  • 1
    Possible duplicate of [Display names of all constraints for a table in Oracle SQL](https://stackoverflow.com/questions/11879217/display-names-of-all-constraints-for-a-table-in-oracle-sql) – Kaushik Nayak Jan 26 '18 at 11:47
  • 1
    SQLDeveloper has a data modelling tool built-in and it's free. I would suggest giving that or Toad (not free) a try before attempting it manually. – BriteSponge Jan 26 '18 at 12:50

1 Answers1

0

You should query USER_CONSTRAINTS and USER_CONS_COLUMNS to find such a data.

Also, if you use DBMS_METADATA.GET_DDL (see documentation), you'll be able to extract DDL used to create tables & constraints.

However, consider using a GUI tool which enables you to "draw" tables and automatically queries metadata in order to graphically display information you're interested in. One of these is TOAD which, in its "Database - Report" menu offers the "ER diagram". I believe some other tools have it as well.

Littlefoot
  • 131,892
  • 15
  • 35
  • 57