Use the reverse engineering of powerdesigner to generate PDM

Source: Internet
Author: User
Tags powerdesigner
Use the reverse engineering of powerdesigner to generate PDM
Source: 51cmm. com Author: Xu yixiao

In the data modeling process, we establish a conceptual data model, generate a physical data model through a forward project, generate a database creation script, and finally generate a relational database from the physical data model. System database designers hope to seamlessly integrate database design and relational database generation. How to ensure two-way synchronization between physical data models and their corresponding databases becomes a key aspect of data modeling.

As a powerful case tool, powerdesigner provides us with convenient reverse engineering features. You can add the structure information of all popular backend databases (including Sybase, DB2, and Oracle) to the physical data model and conceptual data model of powerdesigner through reverse engineering, including tables, indexes, triggers, and views.

This document describes only the reverse engineering of PDM (physical data model.

Reverse Engineering in PDM refers to the process of generating PDM from the user database of the existing DBMS or the SQL script of the existing database. There are two types of reverse engineering objects: 1) connecting to the database through the ODBC data source 2) existing database SQL scripts.

The system environment in this example is as follows:

1. The database has been created, and the access user and password settings are complete. The database is Oracle9i.

2. the ODBC data source has been created by Oracle's net configuration assistant. The local network Naming Service "Database" is used ".

3. SQL script example crebas. SQL.

4. powerdesigner9.5 has been installed successfully. 1. Use the data source to connect to the database and reverse engineer to generate PDM
1. Configure user database connection Parameters

Select database-> Configure connections to go to the system DSN tag,

Click Add, select oracle as the database type, and click Finish. Enter datasource name "pdmtest" and servername "Database". The configuration is complete.

Click "test connect" and enter servername "Database", user name and password. If the connection is successful, the following information is displayed:

Choose database? Connect, select the ODBC data source, and enter servername "Database", user name, and password. If no prompt is displayed, the connection is successful. At the same time, you can use the database? View the connection information.

2. Set reverse engineering options to generate PDM

Create a PDM file and select the matched Database Type "Oracle9i ".

Select database? Reverse Engineer database. The database reverse engineering dialog box is displayed. Select using an ODBC data source and select ODBC Data Source "pdmtest"

Click OK to display all tables, views, and users in the database. Select as needed and convert to PDM.

3. View data

For the generated PDM, right-click a table graphical symbol and select View data to access the data in the table.

Ii. Generate PDM through SQL script Reverse Engineering

1. Database SQL script file crebas. SQL. The following is a script instance:
/* ===================================================== ======================================= */
/* Database Name: physicaldatamodel_1 */
/* DBMS name: Oracle version 9i */
/* Created on: 10:49:08 */
/* ===================================================== ======================================= */
/* ===================================================== ======================================= */
/* Table: "class "*/
/* ===================================================== ======================================= */
Create Table "class "(
"Classid" number (2) not null,
"Classname" varchar2 (24 ),
Constraint pk_class primary key ("classid ")
)
/
/* ===================================================== ======================================= */
/* Table: "student "*/
/* ===================================================== ======================================= */
Create Table "student "(
"Studentid" number (10) Not null,
"Studentname" varchar2 (4 ),
"Classid" number (2 ),
Constraint pk_student primary key ("studentid ")
)
/
Alter table "student"
Add constraint fk_student_reference_class foreign key ("classid ")
References "class" ("classid ")
/

2. Create a PDM and select database? Reverse Engineer database, select using script files.

3. See the PDM generated automatically by the script as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.