Generating a Database from a PDM

PowerDesigner can generate sophisticated SQL scripts as files or for direct execution via a live database connection.

Note: To generate to a SAP HANA® database, use the HANA wizard (see Exporting Objects to the HANA Repository).
  1. Select Database > Generate Database to open the Database Generation dialog box.


    Note: To load a pre-configured selection or settings set (see Quick Launch Selection and Settings Sets), select it in the appropriate list in the Quick launch group box.
  2. Enter a destination Directory and File Name for the script file.
  3. Specify the type of generation (script or live database connection) to perform:
    • Script generation - generate a script to be executed on a DBMS at a later time. Optionally select One file only to create the generation script as a single file. By default, a separate script file is created for each table.

    • Direct generation – generate a script and execute it on a live database connection. Optionally select Edit generation script to open the script in an editor for review or editing before execution.

  4. [optional] Select the following options as appropriate:

    Option

    Description

    Check model

    Specifies that a model check is performed before script generation.

    Automatic archive

    Creates an archive version of the PDM after generation to use to determine changes during your next database modification (see Archive PDMs).

  5. [optional] To change the default generation options, click the Options tab (see Database Generation Dialog Options Tab).
  6. [optional] To change the format of your script, click the Format tab (see Database Generation Dialog Format Tab).
  7. [optional] To control which database objects will be generated, click the Selection tab:


    You can save your selection via the Selection bar at the bottom of the tab (see Quick Launch Selection and Settings Sets).

  8. [optional] Click the Summary tab to view the summary of your settings and selections. The summary is not editable, but you can search, save, print, and copy its contents.


  9. [optional] Click the Preview tab to preview the SQL script to be generated. The script is not editable, but you can search, save, print, and copy its contents.


  10. Click OK to begin the generation.

    If you are generating a database script, the Output window shows the progress of the generation process, and gives instructions for running the script. When generation is complete, the Generated Files dialog opens listing the paths to the generated script files. Click Edit to open the script in a text editor or Close to close the Result box.

    Note: For information about the additional steps required to generate for MS Access, see Generating a Microsoft Access Database).

    If you are generating a database directly, and are not currently connected to a database, a dialog box asks you to identify a data source and connection parameters (see Connecting to a Database).

Note: Advanced users can further customize database generation by, for example, changing the order in which objects are generated, adding scripts to run before or after generation, and generating additional objects. For information about these and other advanced topics, see Customizing and Extending PowerDesigner > DBMS Definition Files.