如何使用 Oracle SQL Developer 生成实体关系 (ER) 图

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6580529/
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 03:24:23  来源:igfitidea点击:

How to generate an entity-relationship (ER) diagram using Oracle SQL Developer

oracleoracle-sqldeveloperentity-relationshiperd

提问by Breezescut

I want to use Oracle SQL Developer to generate an ER diagram for my DB tables but I am new to Oracle and this tool.

我想使用 Oracle SQL Developer 为我的数据库表生成一个 ER 图,但我是 Oracle 和这个工具的新手。

What is the process for creating an ER diagram in SQL Developer?

在 SQL Developer 中创建 ER 图的过程是什么?

回答by Sergei Mardiyants

Create a diagram for existing database schema or its subset as follows:

为现有数据库架构或其子集创建图表,如下所示:

  1. Click File → Data Modeler → Import → Data Dictionary.
  2. Select a DB connection (add one if none).
  3. Click Next.
  4. Check one or more schema names.
  5. Click Next.
  6. Check one or more objects to import.
  7. Click Next.
  8. Click Finish.
  1. 单击文件 → 数据建模器 → 导入 → 数据字典
  2. 选择一个数据库连接(如果没有则添加一个)。
  3. 单击下一步
  4. 检查一个或多个模式名称。
  5. 单击下一步
  6. 选中一个或多个要导入的对象。
  7. 单击下一步
  8. 单击完成

The ERD is displayed.

显示 ERD。

Export the diagram as follows:

导出图表如下:

  1. Click File → Data Modeler → Print Diagram → To Image File.
  2. Browse to and select the export file location.
  3. Click Save.
  1. 单击文件 → 数据建模器 → 打印图表 → 到图像文件
  2. 浏览并选择导出文件位置。
  3. 点击保存

The diagram is exported. To export in a vector format, use To PDF File, instead. This allows for simplified editing using Inkscape(or other vector image editor).

图表已导出。要以矢量格式导出,请改用To PDF File。这允许使用Inkscape(或其他矢量图像编辑器)简化编辑。

These instructions may work for SQL Developer 3.2.09.23 to 4.1.3.20.

这些说明可能适用于 SQL Developer 3.2.09.23 到 4.1.3.20。

回答by lintmouse

Since SQL Developer 3, it's pretty straightforward (they could've made it easier).

从 SQL Developer 3 开始,它就变得非常简单(他们本来可以更容易)。

  1. Go to «View → Data Modeler → Browser». The browser will show up as one of the tabs along the left-hand side.
  2. Click on the «Browser»tab, expand the design (probably called Untitled_1), right-click «Relational Models»and select «New Relational Model».
  3. Right click on the newly created relational model (probably Relational_1) and select «Show».
  4. Then just drag the tables you want (from e.g. the «Connections»tab) onto the model.  Note when you click on the first table in the Connections tab, SQLDeveloper opens that table in the right: select all the tables from the left, then ensure the Relational_1tab (or whatever name) is the active one in the rhs before you drag them over, because it has probably switched to one of the tables you clicked in the lhs.
  1. 转到“查看 → 数据建模器 → 浏览器”。浏览器将显示为左侧的选项卡之一。
  2. 单击“浏览器”选项卡,展开设计(可能称为Untitled_1),右键单击“关系模型”并选择“新建关系模型”
  3. 右键单击新创建的关系模型(可能Relational_1)并选择«Show»
  4. 然后只需将您想要的表(例如从«Connections»选项卡)拖到模型上。请注意,当您单击 Connections 选项卡中的第一个表时,SQLDeveloper 在右侧打开该表:从左侧选择所有表,然后确保该Relational_1选项卡(或任何名称)在 rhs 中处于活动状态,然后再将它们拖过去,因为它可能已切换到您在 lhs 中单击的表之一。

回答by Dariusz Wo?niak

The process of generating Entity-Relationship diagram in Oracle SQL Developer has been described in Oracle Magazine by Jeff Smith(link).

Jeff SmithOracle Magazine 中描述了在 Oracle SQL Developer 中生成实体关系图的过程(链接)。

Excerpt:

摘抄:

Entity relationship diagram

Entity relationship diagram

Getting Started

To work through the example, you need an Oracle Database instance with the sample HR schema that's available in the default database installation. You also need version 4.0 of Oracle SQL Developer, in which you access Oracle SQL Developer Data Modeler through the Data Modeler submenu [...] Alternatively, you can use the standalone Oracle SQL Developer Data Modeler. The modeling functionality is identical in the two implementations, and both are available as free downloads from Oracle Technology Network.

In Oracle SQL Developer, select View -> Data Modeler –> Browser. In the Browser panel, select the Relational Models node, right-click, and select New Relational Model to open a blank model diagram panel. You're now starting at the same place as someone who's using the standalone Oracle SQL Developer Data Modeler. Importing Your Data Dictionary

Importing Your Data Dictionary

A design in Oracle SQL Developer Data Modeler consists of one logical model and one or more relational and physical models. To begin the process of creating your design, you must import the schema information from your existing database. Select File -> Data Modeler -> Import -> Data Dictionary to open the Data Dictionary Import wizard.

Click Add to open the New -> Select Database Connection dialog box, and connect as the HR user. (For detailed information on creating a connection from Oracle SQL Developer, see “Making Database Connections,” in the May/June 2008 issue of Oracle Magazine.)

Select your connection, and click Next. You see a list of schemas from which you can import. Type HR in the Filter box to narrow the selection list. Select the checkbox next to HR, and click Next.

Read more...

实体关系图

实体关系图

入门

要完成该示例,您需要一个带有示例 HR 模式的 Oracle 数据库实例,该模式在默认数据库安装中可用。您还需要 Oracle SQL Developer 4.0 版,在该版本中您可以通过 Data Modeler 子菜单访问 Oracle SQL Developer Data Modeler [...] 或者,您可以使用独立的 Oracle SQL Developer Data Modeler。这两种实现的建模功能是相同的,并且都可以从 Oracle 技术网免费下载。

在 Oracle SQL Developer 中,选择 View -> Data Modeler -> Browser。在 Browser 面板中,选择 Relational Models 节点,右键单击并选择 New Relational Model 打开一个空白的模型图面板。您现在的起点与使用独立 Oracle SQL Developer Data Modeler 的人相同。导入数据字典

导入数据字典

Oracle SQL Developer Data Modeler 中的设计由一个逻辑模型和一个或多个关系模型和物理模型组成。要开始创建设计的过程,您必须从现有数据库导入模式信息。选择 File -> Data Modeler -> Import -> Data Dictionary 打开数据字典导入向导。

单击“添加”打开“新建”->“选择数据库连接”对话框,并以 HR 用户身份进行连接。(有关从 Oracle SQL Developer 创建连接的详细信息,请参阅 Oracle Magazine 2008 年 5 月/6 月号中的“建立数据库连接”。)

选择您的连接,然后单击下一步。您会看到可以从中导入的模式列表。在过滤器框中键入 HR 以缩小选择列表的范围。选中 HR 旁边的复选框,然后单击下一步。

阅读更多...

回答by Swati Pisal

For a class diagram using Oracle database, use the following steps:

对于使用 Oracle 数据库的类图,使用以下步骤:

File → Data Modeler → Import → Data Dictionary → select DB connection → Next → select database->select tabels -> Finish

文件→数据建模器→导入→数据字典→选择数据库连接→下一步→选择数据库->选择标签->完成

回答by DCookie

There is a companion tool called Oracle Data Modelerthat you could take a look at. There are online demos availableat the site that will get you started. It used to be an added cost item, but I noticed that once again it's free.

您可以查看一个名为Oracle Data Modeler的配套工具。有可用的在线演示的,将让你开始的网站。它曾经是一个额外的成本项目,但我注意到它又一次是免费的。

From the Data Modeler overview page:

从数据建模器概述页面:

SQL Developer Data Modeler is a free data modeling and design tool, proving a full spectrum of data and database modeling tools and utilities, including modeling for Entity Relationship Diagrams (ERD), Relational (database design), Data Type and Multi-dimensional modeling, with forward and reverse engineering and DDL code generation. The Data Modeler imports from and exports to a variety of sources and targets, provides a variety of formatting options and validates the models through a predefined set of design rules.

SQL Developer Data Modeler 是一个免费的数据建模和设计工具,提供了全方位的数据和数据库建模工具和实用程序,包括实体关系图 (ERD)、关系(数据库设计)、数据类型和多维建模的建模,具有正向和逆向工程以及 DDL 代码生成。数据建模器从各种源和目标导入和导出,提供各种格式选项并通过一组预定义的设计规则验证模型。

回答by BIBD

Oracle used to have a component in SQL Developer called Data Modeler. It no longer exists in the product since at least 3.2.20.10.

Oracle 曾经在 SQL Developer 中有一个名为Data Modeler. 至少从 3.2.20.10 开始,它不再存在于产品中。

It's now a separate download that you can find here:

它现在是一个单独的下载,您可以在此处找到:

http://www.oracle.com/technetwork/developer-tools/datamodeler/overview/index.html

http://www.oracle.com/technetwork/developer-tools/datamodeler/overview/index.html

回答by J Slick

I'm running SQL Developer 17.2.0.188 build 188.1159 which does indeed contain data modeling capability. I just created a relational model diagram via the menu: File->Data Modeler->Import->Data Dictionary....

我正在运行 SQL Developer 17.2.0.188 build 188.1159,它确实包含数据建模功能。我刚刚通过菜单创建了一个关系模型图: File->Data Modeler->Import->Data Dictionary...

I also have the stand-alone Data Modeler, which does the same thing.

我也有独立的 Data Modeler,它做同样的事情。

As the Data Modeler tutorialstates:

正如Data Modeler 教程所述:

Figure 4: Relational model and diagram for HR

图 4:HR 的关系模型和图表

The diagram you've generated is not an ERD. Logical models are higher abstractions. An ERD represents entities and their attributes and relations, whereas a relational or physical model represents tables, columns, and foreign keys."

您生成的图表不是 ERD。逻辑模型是更高的抽象。ERD 表示实体及其属性和关系,而关系或物理模型表示表、列和外键。

回答by Douglas Marques

Its easy go to File - Data Modeler - Import - Data Dictionary - DB connection - OK

它很容易转到文件 - 数据建模器 - 导入 - 数据字典 - 数据库连接 - 确定