Generating Database Change Script
In order to patch existing database to newer version, database administrator need to prepare DDL (Data Definition Language) scripts with commands of updates. Visual Paradigm is capable in updating database, or just to generate the DDL required, by comparing differences between the design, which is the ERD(s), and the database, and to generate the DDL scripts accordingly. In addition to generating update scripts, Visual Paradigm can also generate scripts for creating and dropping database. In this tutorial, we will focus on generating the update scripts.
Topics
1. Update database design - the ERD
2. Generate database scripts for "Update Database"
3. Execute scripts in Oracle
The original database design for the Computer Sales project:

- Let's update the design. Rename the entity Addresses to Customer_Addresses.

- Add a new column to the entity Computer_Part by right-clicking on it and selecting New Column from the popup menu.

- Enter discount : numeric(8, 2) as the column definition, press Enter, and then press Esc to confirm editing.

- Move the mouse cursor over Computer_Part, click on the One-to-Many Relationship -> Entity icon in the resource-centric interface, and drag to the empty region to create a new entity. Enter Part_Usage as the entity name.
- Rename the automatically created FK (foreign key) column to part_id.
- Repeat the previous steps to add the following columns to Part_Usage.
- +usage_id : number(10)
- description : varchar2(1024)

- The design is now updated. To generate the scripts of changes, select Tools > Database > Generate Database... from the main menu.
- In the Database Code Generation dialog box, specify the output path of the DDL script file.

- Select Update Database as the type of generation.

- Uncheck Export to database to generate only the scripts file.

- Click OK to start generation.
- The script is generated to the given path.

- Let's take a look at the generated scripts.

- To execute the scripts, open the Oracle Web client, select SQL > SQL Scripts, and click Upload to upload the generated DDL file.

- Once the file is uploaded, click the script icon.

- Click Run to execute the scripts to the database.

- Click Run again to confirm.

- Click the file icon to check the result.

- The scripts are executed successfully. The database is updated.

- You can see the changes in the Object Browser.

Trademark Disclaimer
Oracle is a U.S. registered trademark of Oracle Corporation