Oracle Database Design

Quick start guide for creating ER diagrams for Oracle Database in Luna Modeler, a database design tool

1. New project

To create a new project, click New on the main toolbar and select the Oracle project type.

2. Add tables

Basic objects like tables and relationships can be added to your project/diagram by clicking the appropriate icon on the main toolbar.

Main toolbar and icons for adding new objects to Oracle data model.

Click the icon on the main toolbar and then click the diagram area. A new graphical object will appear on the diagram immediately.

Newly added table

Edit properties in Right Side panel:

Table properties in Luna Modeler- Oracle Database Design

Alternatively, you can double click the graphics or right-click the item and choose Edit to open a larger modal form.

How to edit table in ERD

Table properties

Basic settings can be specified in the section Details.

Columns

In section Columns, you can add new table columns. Specify new column name, datatype (basic datatype, available Oracle Types), param and click Add.

  • PK indicates primary key.
  • NN represents Not Null column.

Detailed column specifics can be defined in a collapsible/expandable area.

Table details - Oracle data model

Note: Sample data will appear in the diagram if the Sample data mode is activated.

3. Views, procedures, functions, types, packages, synonyms and other objects

All other supported objects can be added to the diagram either by clicking the Other icon on the main toolbar, selecting the object type and then clicking the diagram area or, by right-clicking the diagram area and selecting the desired object type.

Adding types to ERD for Oracle Databases using context menu in Luna Modeler database design tool.

After adding the object to the diagram you can double click it and edit properties or use the right side panel for making modifications.

Synonym created for table Vendor

Example: defined object type PRODUCT_TYPE can be selected from the data type drop-down list. This way you can easily reuse the same type for different columns.

Object type in Oracle data model

4. Relationships

Relationships can be created between parent and child tables (for other visual references you can use Lines and connect two graphical objects).

To add a new relationship to the diagram, click the Relationship icon, then click the parent table and then the child table. If the primary key is defined in the parent table, a new column will be added to the child table and marked as a foreign key.

Example: relationship drawn from table CUSTOMER to table CART. Foreign key column CUSTOMER_ID was added to the child table automatically.

New relationship created between two tables in an Oracle Database model.

Read more about one-to-many relationships and many-to-many relationships.

5. Code generation

To generate an SQL script, click the SQL Script icon on the main toolbar.

SQL Script generated for Oracle Database structure. The script was generated by Luna Modeler database design tool.

How to execute the script? Use a tool of your preference.

6. Other features and visual elements

Notes, lines and other information that can be displayed in a diagram will help you keep the structure well documented. You can also display descriptions below tables and other objects in the visualizations etc.

Descriptions displayed below table boxes.

7. Reverse engineering and visualization of existing database structures

You can establish a connection to your Oracle database and load the existing structure, incl. all supported Oracle database objects. To reverse engineer a database, create a new connection:

New connection to Oracle Database

Your new connection will appear in page Connections where you can also filter connections by name or platform.

A list of database connections, filter set to Oracle database

To load the structure click Connect and load existing database structure.

ERD - entity relationship diagram made for Oracle

Enjoy!

#

DATA MODELING TOOLS
DRAW Diagrams and
GENERATE Scripts
Download data modeling tools
Blog Categories
Blog by Platforms