Powerdesigner experience from http://blog.csdn.net/zclzzz/article/details/5915779

Source: Internet
Author: User
Tags sybase powerdesigner

It is really convenient to use powerdesigner for database design. The following are some common settings:

Additional: the toolbar is missing.

The palette (palette) shortcut toolbar is missing

The powerdesigner shortcut toolbar palette is gone. How can I open it again and find it?

I searched "powerdesigner graphic toolbar" online and found the way to retrieve the powerdesigner toolbar palette.
Tools (toolbar)
Customsize toolbars (custom toolbar)
Select the palette (color palette) check box

 

 

Modify foreign key naming rules

Choose database> edit current DBMS.
Select scripts-> objects-> reference-> constname
The value on the right is:

FK _ %. u8: child % _ %. U9: refr % _ %. u8: parent %

It can be seen that the naming method is: 'fk _ '+ 8-seat table name + 9-digit reference name + 8-digit parent table name. You can customize the following mode:

FK _ %. u7: child % _ relations _ %. u7: parent %,

You can change the FK name to fk_table_2_relations_table_1.
After mastering this method, you can modify it according to your own ideas.

The header comment in the SQL file of the database creation script is annoying. You can select the options card in the Databse-> Generate database (CTRL + G) window and remove the usage title hook option.

Add foreign key
Model-> references: Create a foreign key and double-click it to enter the foreign key attribute. In the "joins" card, select the foreign key field of the sub-table.

 

How to achieve non-automatic equality of name and code
When you create an entity in CDM, the name and Code do not automatically match

Set tools -- gerneral options ---> dialog ----> name to code signing ing

-------------------------------------

How to display the name column in scrip

Modify the field generation rule. To add a comment for each field, expand the value of script-> Object-> column-> Add in the same window:

% 20: column % [% compute %? As (% compute %): % 20: datatype % [% identity %? % Identity %: [% null %] [% notnull %] [Default % default %]
[[Constraint % constname %] Check (% constraint %)]

% Colnname % indicates the column name value (which can be Chinese)

---------------------------------------------------------------------------------

Settings of powerdesigen auto-increment Columns

In PDM, view the table attributes. On the columns tab, select the entire column and view the column attributes. Click the properties icon in the upper-left corner (the one with a hand-shaped pattern). A setting window is displayed, in the General tab.
On the General tab of the column attribute, there is an identity check box. Just click it.

--------------------------------------
1. How to create an index under powerdesigner
2. How to create an auto-increment column under powerdesigner
3. How to check the design model under powerdesigner

1. How to create an index under powerdesigner
1. Double-click the table design drawing and click "Table properties". On the tab page, select "indexes ".

2. Click the attribute of the new index. indexex properties is displayed.

3. Add an index Field

2. How to create an auto-increment column under powerdesigner
2. Use the following statements in the sqlserver database to complete
In the table creation statement, add the following
Identity (1, 1)
You can also use the following statement to reset the auto-incrementing seed.
DBCC checkident (configsys, reseed, 0 );
3. How to check the design model under powerdesigner
1. Select Tools-? In the menu bar -? Check model, as shown in figure

2. Select each setting to be checked.

3. Confirm and check the summary of the results.

1. Set error check when CDM generates PDM

Tools --> check Model

 

2. How to Prevent one-to-one relationship from generating two references (Foreign keys)
To define the dominant direction of the link, the dominant entity (with the d sign) becomes the parent table.
Double-click the one-to-one relationship in CDM-> detail-> dominant role to select the dominant relationship

 

3. Foreign keys designed by CDM in powerdesigner8 as primary keys
There is a one-to-one relationship between two entities. The identifiers of the two entities are "the same"-but it seems that the same entity is not allowed in CDM. How can this problem be solved?
There seems to be no foreign key in CDM. I mean, after the data is converted to PDM, the foreign key is used as the primary key of the table. How is it set in the corresponding CDM?
Double-click the link, select the detail option in the displayed relationship Properties window, and select the dependent check box.

 

4. Disable Automatic code input based on name

Tools --> General options --> dialog --> deselect name to code encoding ing

During this time, I used PD to create a database model. I felt very good. I would like to share my experience with you. I still have a lot of features and I don't have time to summarize them. If I have time, continue to make up for them.
1. How to create an index under powerdesigner
2. How to create an auto-increment column under powerdesigner
3. How to check the design model under powerdesigner

1. How to create an index under powerdesigner
1. Double-click the table design drawing and click "Table properties". On the tab page, select "indexes ".

2. Click the attribute of the new index. indexex properties is displayed.

3. Add an index Field

2. How to create an auto-increment column under powerdesigner
2. Use the following statements in the sqlserver database to complete
In the table creation statement, add the following
Identity (1, 1)
You can also use the following statement to reset the auto-incrementing seed.
DBCC checkident (configsys, reseed, 0 );
3. How to check the design model under powerdesigner
1. Select Tools-? In the menu bar -? Check model, as shown in figure

2. Select each setting to be checked.

3. Confirm and check the summary of the results.

Setting auto-increment indexes in powerdesigner does not require much trouble. In fact, you only need to set the columns field type to serial in the conceptual model!

 

1. Use powerdesigner to check database design errors ~

Powerdesigner can also be used to quickly detect database design errors in the new model.

Check the New Mode:

Select [Check model] from the [tools] menu.

The [Check model parameters] dialog box appears. You can use the default parameters.

You can also right-click the blank space and select Check model.

Click [OK].

The result of [Check model] is displayed in [result list.

2. How to convert conceptual data model (CDM) to physical data model (PDM )?

 

Converts a conceptual data model to a physical data model.

The difference between the two is that CDM is purely a conceptual model, and PDM is related to a specific database type, such as SQL Server 2000 or Oracle. To generate an SQL statement, you must also generate it from PDM.

 

Choose tools> Generate phisical data model from the menu.

 

Finally, select your database type.

 

3. Use powerdesigner to generate SQL statements ~

 

You can use powerdesigner to generate an SQL script that is used to implement all components of the model. Then, use an SQL script to generate a database.

Make sure that you are using PDM.

Generate an SQL script to create a database:

Select [generate database] from the [database] menu.

The [database generation] dialog box appears.

In the [Directory] field, type C: temp and newdemo. SQL in the [file name] field.

Make sure that [generation] is selected.

Click the [database] tab and make sure that [Create Database] is selected.

Browse other tabs to view options that control many other attributes of the script generated.

Click [OK].

After the script is created, the [Result] dialog box is displayed.

4. Why is the warning: Table existence of index table name?

 

The table is not indexed. However, this is a warning, not an error. Ignore it.

 

5. How do I create a federated primary key?

 

A federated primary key has multiple primary keys in a table. For example, in a table selected by a student, both the student ID and the course Id are primary keys.

 

When attributes is set, the p items of the two fields are checked. P indicates the primary key of the primary key.

 

6. How do I create a foreign key?

 

In powerdesigner, foreign keys can be automatically created by establishing relationship. You do not need to manually add them.

 

There are two ways to create a relationship: You can choose model-> relationships... from the menu, or drag the relationship control in the toolbar on the right.

 

7. How to generate a data dictionary?

 

You can use the report-> Report Wizard... menu to generate

Note that you can select template. Because it is generated through PDM, standard physical template ~ is selected ~

1. Install PD v11.0

2.PDMWhen a table creation script is generated, an error occurs when the field exceeds 15 characters (Oracle)
Unknown cause. The solution is to open the PDM, And the menu bar of the database appears. Go to database-edit current DBMS-script-objects-column-maxlen and increase the value (Originally 30 ), for example, change to 60. If the length of a table or other objects is incorrect, you can select the corresponding objects and change it accordingly!
Or use the following method:
When the table creation script is generated, the database generation prompt box will pop up: remove the options-check model, that is, do not check (not recommended )!
Alternatively, you can modify the C:/program files/Sybase/powerdesigner trial 11/resource files/DBMS/oracl9i2. XDB file.
After modification, when CDM is converted to PDM, select "copy the DBMS definition in Model" to copy the resource file to the model.

3. How do I remove the double quotation marks of an object from the generated table creation script?
When CDM is enabled, go to tools-model options-naming convention and set the charcter case option of the name and code labels to uppercase or lowercase, as long as it is not a mixed case!
Alternatively, choose database-> edit current database-> script-> SQL-> Format. There is a casesensitivityusingquote, its comment is "determines if the case sensitivity for identifiers is managed using double quotes", which indicates whether double quotation marks are used to specify the case sensitivity of the identifier. You can see that the default value of values on the right is "yes ", change to "no!
Alternatively, when PDM is enabled, go to tools-model options-naming convention and set the charcter case option of the name and code labels to uppercase!

4. After creating a table, why does the warning of existence of index appear?
A table shoshould contain at least one column, one index, one key, and one reference.
This warning error does not occur if you do not check the existence of index!
This means that no index is created for the table, and at least one index is required for a table. This is a warning and it doesn't matter if you don't care!

5. When creating a table to modify a field, the code of the table changes as soon as the name is changed. How can I keep the code unchanged?
There is a button "=" on the right side of the name and code. If you do not need to synchronize, you can just pop up the button.
Tools-> General options-> dialog-> name to code sorting (remove)

6. When PDM is generated by CDM, the automatically generated foreign key is renamed.
PDM generation options-> detail-> FK index names is % refr % _ FK by default, changed to fk _ % refrcode %, where % refrcode % refers to the relationship code in CDM! In addition, the automatically generated parent field is set in PDM Generation Options> detail-> FK column name template. The default value is %. 3: parent % _ % column %. You can change it to PAR % column %, which indicates the parent field is used!

7. How to Prevent one-to-one relationship from generating two references (Foreign keys)
To define the dominant direction of the link, the dominant entity (with the d sign) becomes the parent table.
Double-click the one-to-one relationship in CDM-> detail-> dominant role to select the dominant relationship

8. modify the definition of some terms in the Report Template
File: C:/program files/Sybase/powerdesigner trial 11/resource files/report documents ages/Chinese. XRL
Tools-resources-Report languages ages-select Chinese-click Properties or double-click the target
Modify the names of some objects: Object Attributes/physical data model/column/
Foreignkey: foreign key
Mandatory: NULL
Primary: Primary Key
Table: Table
Replace "table" with "table" with "Search"
Modify the displayed content to another value: Values mapping/lists/standard. Add the true conversion column as yes, and the false conversion column as null.
In addition, you can set the title information in report-title page.

 

1. In PD, copying a column is actually a link. Changes to the source column are also reflected in the copy Column

2. General steps of Database Design: determining the main structure of CDM-generating PDM-modifying on PDM and generating CDM when necessary

3. If PDM generates CDM and then generates PDM, the foreign key modified in PDM will be changed back to the default value.

4. If necessary, you can change the script format by modifying the template (Database-edit current database. For example:
Add a line "-- % colnname %" in the value of script-objects-column-add to show the Chinese and English comparisons of columns in the script.

5. Remove the annoying name and code ing: Tools-General options-Clear the name to code sorting ing check box

6. For a database (such as Oracle) That is case insensitive, powerdesign automatically adds double quotation marks to the table name and field name when creating a script to obtain a case-sensitive string, this makes writing SQL statements a lot of trouble. Remove this additional feature:
Database-> edit current DBMS-> script.-> SQL-> Format-> casesensitivityusingquote
Select No for the right-side panel parameter value

7. PDM is generated by CDM, which can control whether to generate a reference for the link; a script is generated by PDM to control whether to generate a foreign key for the reference.

8. For Oracle, table setting options (such as tablespace gpssystem) can be used to create the correct tablespace. For the setting options for the primary key (using index tablespace gpsindex), the index is created to the correct tablespace.

 

1. Install PD v12.0

2. When the table creation script is generated by PDM, an error occurs when the field exceeds 15 characters (Oracle)

Unknown cause. The solution is to open the PDM, And the menu bar of the database appears. Go to database-edit current DBMS-script-objects-column-maxlen and increase the value (Originally 30 ), for example, change to 60. If the length of a table or other objects is incorrect, you can select the corresponding objects and change it accordingly!

Or use the following method:

When the table creation script is generated, the database generation prompt box will pop up: remove the options-check model, that is, do not check (not recommended )!

Alternatively, you can modify the C: Program filessybasepowerdesigner trial 11 Resource filesdbms1_l9i2. XDB file.

After modification, when CDM is converted to PDM, select "copy the DBMS definition in Model" to copy the resource file to the model.

3. How do I remove the double quotation marks of an object from the generated table creation script?

When CDM is enabled, go to tools-model options-naming convention and set the charcter case option of the name and code labels to uppercase or lowercase, as long as it is not a mixed case!

Alternatively, choose database-> edit current database-> script-> SQL-> Format. There is a casesensitivityusingquote, its comment is "determines if the case sensitivity for identifiers is managed using double quotes", which indicates whether double quotation marks are used to specify the case sensitivity of the identifier. You can see that the default value of values on the right is "yes ", change to "no!

Alternatively, when PDM is enabled, go to tools-model options-naming convention and set the charcter case option of the name and code labels to uppercase!

4. After creating a table, why does the warning of existence of index appear?

A table shoshould contain at least one column, one index, one key, and one reference.

This warning error does not occur if you do not check the existence of index!

This means that no index is created for the table, and at least one index is required for a table. This is a warning and it doesn't matter if you don't care!

5. When creating a table to modify a field, the code of the table changes as soon as the name is changed. How can I keep the code unchanged?

There is a button "=" on the right side of the name and code. If you do not need to synchronize, you can just pop up the button.

Tools-> General options-> dialog-> name to code sorting (remove)

6. When PDM is generated by CDM, the automatically generated foreign key is renamed.

PDM generation options-> detail-> FK index names is % refr % _ FK by default, changed to fk _ % refrcode %, where % refrcode % refers to the relationship code in CDM! In addition, the automatically generated parent field is set in PDM Generation Options> detail-> FK column name template. The default value is %. 3: parent % _ % column %. You can change it to PAR % column %, which indicates the parent field is used!

7. How to Prevent one-to-one relationship from generating two references (Foreign keys)

To define the dominant direction of the link, the dominant entity (with the d sign) becomes the parent table.

Double-click the one-to-one relationship in CDM-> detail-> dominant role to select the dominant relationship

8. modify the definition of some terms in the Report Template

That is, file: C: Program filessybasepowerdesigner trial 11 Resource filesreport extends ageschinese. XRL

Tools-resources-Report languages ages-select Chinese-click Properties or double-click the target

Modify the name of some objects: Object attributesphysical data modelcolumn

Foreignkey: foreign key

Mandatory: NULL

Primary: Primary Key

Table: Table

Replace "table" with "table" with "Search"

Modify the displayed content to another value: Values mappinglistsstandard. Add the true conversion column as yes, and the false conversion column as null.

In addition, you can set the title information in the report-title page.

 

Powerdesign is mainly used for DBMS configuration.

1. Modify the table creation script generation rules. If each table has the same field, you can modify it as follows:

Database-> edit current DBMS expand script-> Object-> table-> Create to see the value in the lower right corner. You can directly modify the value as follows:/* tablename: % tname % */

Create Table [% qualifier %] % table % (

% Tabldefn %

TS char (19) null default convert (char (19), getdate (), 20 ),

Dr smallint null default 0

)

[% Options %]

The Ts and Dr columns are automatically inserted into each table when an SQL script is generated, the % tname % variable adds a name value comment to the SQL statement of each table.

2. Modify the field generation rules. To add a comment for each field, expand the value of script-> Object-> column-> Add in the same window:

% 20: column % [% compute %? As (% compute %): % 20: datatype % [% identity %? % Identity %: [% null %] [% notnull %] [Default % default %]

[[Constraint % constname %] Check (% constraint %)]/* % colnname % */

% Colnname % indicates the column name value (which can be Chinese)

3. Modify the foreign key naming rules. Choose database> edit current DBMS.

Select scripts-> objects-> reference-> constname

The value on the right is:

FK _ %. u8: child % _ %. U9: refr % _ %. u8: parent %

It can be seen that the naming method is: 'fk _ '+ 8-seat table name + 9-digit reference name + 8-digit parent table name. You can customize the following mode:

FK _ %. u7: child % _ relations _ %. u7: parent %,

You can change the FK name to fk_table_2_relations_table_1.

After mastering this method, you can modify it according to your own ideas.

The header comment in the SQL file of the database creation script is annoying. You can select the options card in the Databse-> Generate database (CTRL + G) window and remove the usage title hook option.

4. Add a foreign key

Model-> references: Create a foreign key and double-click it to enter the foreign key attribute. In the "joins" card, select the foreign key field of the sub-table.

5. Remove the double quotation marks of the generated SQL Script: Oracle 8i2: script/SQL/format/casesensitivityusingquote to No. The default value is yes, so there will be double quotation marks.

When changing the name, the code value will change, which is inconvenient. Modification Method: Modify the Options menu in powerdesign. In [Tool] --> [General options]-> [Dialog]-> [operating modes]-> [name to code signing ing], by default, the name and code are synchronized. just remove the check box above.

6. solutions to the problem of the same name in the powerdesgner Data Model Design

By default, powerdesigner does not have entity attributes with the same name in CDM. This is also due to possible name conflicts such as primary key foreign keys. However, when we design the actual database, the same data item may be used multiple times to facilitate understanding of each object. Therefore, you need to change the settings of powerdesigner. By default, dataitem cannot be used repeatedly (with duplicate names). You need to perform the following operations:

Select Tools-> model options. In the model setting directory, deselect the unique code under data item. By default, unique code and allow reuse are selected.

At the same time, this setting is intended for a specific model, that is, it is valid for the current model. If you want this setting to be available in other models, you need to reset it. However, when checking the model, if you select Check all, the system will still report an error message with the same dataitem name. When we need to manually check that the data item is correct, we can choose not to check dataitem, matching of various data types (only common corresponding types in SQL Server are provided here, and other DBMS can use similar processing)

1. How to create an index under powerdesigner

2. How to create an auto-increment column under powerdesigner

3. How to check the design model under powerdesigner

1. How to create an index under powerdesigner

1. Double-click the table design drawing and click "Table properties". On the tab page, select "indexes ".

2. Click the attribute of the new index. indexex properties is displayed.

3. Add an index Field

2. How to create an auto-increment column under powerdesigner

Use the following statements in the SQL Server database to complete

In the table creation statement, add the following

Identity (1, 1)

You can also use the following statement to reset the auto-incrementing seed.

DBCC checkident (configsys, reseed, 0 );

3. How to check the design model under powerdesigner

1. Select Tools-? In the menu bar -? Check model, as shown in figure

2. Select each setting to be checked.

3. Confirm and check the summary of the results.

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.