DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Relational Database

  1. #1
    Join Date
    Jun 2001
    Posts
    1

    Unhappy

    I have a system installed on Sun solaris platform.
    wanted to do some reverse engineering..
    does anyone know that by any chance i can retrieve the Entity Relationship between tables from the database itself?

  2. #2
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    1,185
    You can download Oracle Designer from Technet and try.

    The reverse engineering functionality may not come with the trial copy.

    If you have an Enterprise license, you might have a CD with Designer floating around your workplace. Otherwise, you might be able to get a free copy with your license from Oracle.

    Good luck.

    David Knight
    OCP DBA 8i, 9i, 10g

  3. #3
    Join Date
    Aug 2000
    Posts
    462
    select
    b.constraint_name "CHILD CONSTRAINT", e.constraint_name "PARENT CONSTRAINT",
    b.table_name "CHILD TABLE", e.table_name "PARENT TABLE",
    b.column_name "CHILD COLUMN", e.column_name "PARENT COLUMN",
    c.data_type "CHILD DATATYPE", f.data_type "PARENT DATATYPE",
    c.data_length "CHILD DATA LENGTH", f.data_length "PARENT DATA LENGTH",
    c.data_precision "CHILD PRECISION", f.data_precision "PARENT PRECISION",
    c.data_scale "CHILD SCALE", f.data_scale "PARENT SCALE"
    from
    dba_constraints a,
    dba_cons_columns b,
    dba_tab_columns c,
    dba_constraints d,
    dba_cons_columns e,
    dba_tab_columns f
    where
    a.constraint_name= b.constraint_name
    and a.constraint_type = 'R'
    and b.column_name = c.column_name
    and b.table_name = c.table_name
    and b.owner = '&&owner'
    and d.constraint_name= e.constraint_name
    and d.constraint_name = a.r_constraint_name
    and e.column_name = f.column_name
    and e.table_name = f.table_name
    and e.owner = '&&owner'
    /


    This query will take a few minutes, and eats resources, so try it first somewhere besides production if you can . . .
    Oracle DBA and Developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width