oracle 如何在ORACLE中查看表关系

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9533045/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 04:00:36  来源:igfitidea点击:

How to see the table relationships in ORACLE

oracletable-relationships

提问by Arjun Babu

I had an Access database.

我有一个 Access 数据库。

Now I have created a connection with this Access DB and copied it to ORACLE.

现在我已经创建了与此 Access DB 的连接并将其复制到 ORACLE。

I hope the keys and constraints must be recreated in Oracle.

我希望必须在 Oracle 中重新创建键和约束。

I couldn't find out how to create the relationships between the tables.

我不知道如何创建表之间的关系。

And also visualizing them.

并且还可视化它们。

回答by Korhan Ozturk

First of all your db keys and constraints should be maintained if you have completed migration from Access DB to Oracle successfully.

首先,如果您已成功完成从 Access DB 到 Oracle 的迁移,则应维护您的 db 键和约束。

Having said that, there are products for Oracle database that will help you to visualize table relationships. There is a product called "PL/SQL Developer by Allround Automations", which we use as company, that includes this in their GUI interface - they have both "foreign keys" and "foreign key references" branches in their navigation tree for a table node (The product is not free though..). You can check herefor detailed information about the 'Diagram Window' feature of PL/SQL Developer.

话虽如此,有一些适用于 Oracle 数据库的产品可以帮助您可视化表关系。有一个名为“Allround Automations 的 PL/SQL Developer”的产品,我们作为公司使用,它在他们的 GUI 界面中包含了这个——他们的导航树中有一个表的“外键”和“外键引用”分支节点(虽然该产品不是免费的..)。您可以在此处查看有关 PL/SQL Developer 的“图表窗口”功能的详细信息。

Secondly Oracle's SQL Developer (which is free) has a feature called 'Data Modeling' for visual representation of displaying the Relational. Check herefor Oracle SQL Developer's Data Modeling.

其次,Oracle 的 SQL Developer(免费)有一个称为“数据建模”的功能,用于显示关系的可视化表示。请在这里为Oracle SQL Developer的数据建模。

Furthermore if you want to find out the tables that have references to a specific table you can also use the following query:

此外,如果您想找出引用特定表的表,您还可以使用以下查询:

select table_name from user_constraints
where r_constraint_name in
  (select constraint_name 
     from user_constraints
     where constraint_type in ('P','U')
     and table_name = upper('&tableOfInterest')
  )

回答by jle

I recommend getting Oracle SQL Developer. It is a free tool from Oracle that allows you to view and modify your database within a GUI. It also has a data modeler built in. It is also free (you just need to have Oracle first)

我建议获取Oracle SQL Developer。它是 Oracle 提供的免费工具,允许您在 GUI 中查看和修改数据库。它还有一个内置的数据建模器。它也是免费的(你只需要先有 Oracle)