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?
Printable View
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?
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.
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 . . .