Imagine the database change management process as a set of interlocking puzzle pieces. One puzzle piece is data modeling and another is database change. This article shows you IBM's solution for how those two pieces fit together. IBM Optim Database Administrator is a database administration tool that can be used on its own as well as with IBM InfoSphere Data Architect, a tool for enterprise data modeling and integration design. Both tools speak the same language when it comes to physical data models, thus integrating processes from design and modeling to database change management. Instead of translating changes between individuals and groups, physical data models put data architects, developers, and database administrators stay on the same page.
Both Optim Database Administrator and InfoSphere Data Architect use the Eclipse framework. Teams that use both products in their shops can also leverage Eclipse Team components to control the flow of information. Furthermore, both InfoSphere Data Architect and Optim Database Administrator can appear in the same Eclipse framework at once (that is, via a "shared shell" installation). In shops where one user wears many hats, the shared shell arrangement allows for a single user interface.
This article illustrates how a customer might use both products with a scenario. We will use a hypothetical company, JK Enterprises, as our example customer. JK Enterprises has begun to use Optim Database Administrator and InfoSphere Data Architect. Tom, the data modeler at JK Enterprises, is using InfoSphere Data Architect, while Eric, the DBA, is using Optim Database Administrator. Note though, in some smaller shops, one person might use both tools. Assume that JK Enterprises determines that they need to add completion codes to their projects. They need to make a change to a database to add a completion code table, and they would also like it to be reflected in their logical model as well. The teams are not sure their logical models are up to date, so they choose to create a physical model from the production database first. Tom will create the physical model within InfoSphere Data Architect. He will convert that physical model to a logical model and specify the completion code entity, the required relationships, and the appropriate attributes. Then, in consultation with Eric, he will convert the logical model to a physical model within InfoSphere Data Architect. Eric will then create a new database change using that updated physical model within Optim Database Administrator to migrate the change to a test database. Figure 1 shows how this will work.
Figure 1. Scenario overview
This scenario is broken down into the following three major tasks:
- Tom uses InfoSphere Data Architect to create a physical model of the HR database.
- Tom uses InfoSphere Data Architect to transform the physical model into a logical model. He makes changes to the logical model, and then transforms that model back into a physical data model.
- Eric uses Optim Database Administrator to migrate the changes that Tom made to the HR database.
You can try out this scenario by ensuring that you have the following prerequisites and then by completing the steps in the sections below.
This scenario uses Optim Database Administrator Version 2.2.3 and InfoSphere Data Architect 7.5.3. For simplicity, it is assumed that Optim Database Administrator, InfoSphere Data Architect, and the database instance are all on the same machine.
In addition, the HR database for JK Enterprises must be created in a DB2 Universal Database™ DB2 V9.1 database or higher. You can use Optim Database Administrator to create the database. Complete the following steps to create the database and populate it with data.
- Using Optim Database Administrator, create the
JKENTdatabase, and then switch to the Database Administration perspective. - At the top of the Administration Explorer view, from the tool bar menu, click New.
- Select New Database to launch the New Database wizard.
- Click Next. On windows the default instance is
DB2 and the default port is
50000. - Click Finish after you have finished filling in
the fields.
Figure 2. New Database
- The New Database editor opens, name the database
JKENTand fill in the location (on Windows the default location is c:\). Click Run. - Once the database is successfully created, in the Administration Explorer, you will see localhost under the All databases folder. Under localhost will be the DB2 instance, under the instance you'll find the JKENT database.
- Download the ODAIDADemo.zip package to a temporary directory. Unzip the package.
- In the Administration Explorer toolbar click on the
New tool menu again and this time select
New SQL Script to open the SQL and XQuery Editor.
There's a tool bar at the top of the editor. If you see No Connection
in the editor tool bar, click it and select the
JKENTdatabase. - In the editor tool bar click the Import action
and select the
createODAIDADemo.sqlscript from the temporary directory and click Open. - Again in the editor tool bar click the Run SQL tool action.
- You may need to enable the Change Management capability. From the File
menu, click New. If you don't see
Change Management Script, you must first enable change management by doing the following: - From the Windows menu, click Preferences, then expand General and click Capabilities.
- Click the Advanced button.
- Expand Data, and click the Change Management Capability check box.
Part A. Creating a physical
model of the HR database
In this first part Tom (the Data Architect) will transform a database into a physical data.
To perform the same tasks Tom did, do the following tasks:
- In the main toolbar, click on the down arrow next to the Task Navigator and select Data Modeling.
- In the Task Launcher, click the Design tab. If the Task Launcher is not already open, launch it by choosing Optim Task Launcher from the main Help menu.
- From the Design tab, select the Reverse engineer a database to
a model use case. Follow the instructions on the
right-hand side to create a data design project called
ARCH_JKENT. - Create a new physical data model inside the
ARCH_JKENTproject calledARCH_JKENT_HRby reverse engineering theJKENTdatabase. Reverse engineer the HR schema, and then click Finish.
Part B. Transforming the physical model into a logical model, and then changing the logical model
In the second part of the scenario, Tom transforms the physical model into a logical model, and then makes the following changes to the logical model using a data diagram:
- Adds a new entity,
COMPLETION_CODES, which has two attributes:COMP_CODEandDESCRIPTION. - Adds a new attribute,
COMP_CODE, to thePROJECTentity. - Creates a foreign key relationship between the
COMPLETION_CODESandPROJECTentities, withCOMPLETION_CODESas the parent entity. - Deletes the attribute,
DEPTNAME, from theORGANIZATIONentity becauseDEPTNAMEin theORGANIZATIONentity is a duplicate of DEPTNAME in theDEPARTMENTentity.
After the changes are made to the logical model, Tom transforms the logical model into a physical model and sends the physical model with the changes to Eric.
If you were in Tom's position, you would complete the following steps:
- Start InfoSphere Data Architect.
- Verify that the preferences are set so that the data mapping between
ROWIDas a logical data type andCHARas the physical data type during model transformation is removed. To check the preferences, complete the following steps:- From the Windows menu, click Preferences.
- Click Data Management, Transform, and then Data Type Map to display the Data Type Map.
- If a row exists where the Logical Data Type is
ROWID, then delete the row. - Click OK.
- Transform the physical data model into a logical model by completing
the following steps:
- To start the Transform to Logical Data Model wizard, from the Data Project Explorer click the Data Models folder in the data design project, select the physical data model ARCH_JKENT_HR.dbm, and then from the main menu bar, click Data, Transform, and then Logical Data Model.
- Complete the steps in the wizard:
- From the Target Logical Model page, click Create new model, and then click Next.
- From the Logical Data Model File page, accept the defaults for the data design project for the logical model, and for the name of the logical model. Click Next.
- From the Options page, specify HR as the package name, then click Next.
- From the Output page, which indicates that the physical model has been transformed to a logical model, click Finish to save the logical model.
The Logical Data Model Editor is opened and displays information about the logical model. The logical model,
ARCH_JKENT_HR.ldmis created and displayed in the Data Models folder, as shown in Figure 3.
Figure 3. Data Project Explorer
- Create a data diagram for the logical model. You will use the data
diagram to make changes to the logical model.
- Expand the logical model
ARCH_JKENT_HR.ldmin the Data Models folder. - Right-click Diagrams (under HR), and click New Overview Diagram.
- Select the HR schema to include all of the corresponding elements, and then click OK. The diagram opens in the Data Diagram Editor, as shown in Figure 4.
Figure 4. Entity diagram of the HR schema
- Expand the logical model
- Add an entity for the completion codes that is named
COMPLETION_CODESto the model.- Right-click in the background of the Data Diagram Editor, and click Add Data Object, and then Entity to add an entity to the diagram.
- In the Properties view, click the General
tab. Rename the entity to
COMPLETION_CODES. - Click the Attributes tab, and click
New to add two new attributes. Rename the
first attribute to
COMP_CODE, specify that it is the primary key, and ensure its data type isCHAR(5). Rename the second attribute toDESCRIPTIONand change its data type toVARCHAR(1024).
Figure 5 shows how the Data Diagram Editor and Properties view looks after these changes.
Figure 5. Entity diagram of the HR Schema
- Create a foreign key relationship between
COMPLETION_CODESandPROJECT, whereCOMPLETION_CODESis the parent entity andPROJECTis the child entity.- From the Palette in the Data Diagram Editor, click Data, and then click Non-Identifying Optional.
- Select the
COMPLETION_CODESentity and the parent with the primary key, and then drag them to thePROJECTentity, which is the child.
A foreign key attribute, is automatically created in
PROJECT. - Remove the
DEPTNAMEattribute from theORGANIZATIONentity.- Select the
ORGANIZATIONentity. - In the Properties view, click the Attributes
tab. Select
DEPTNAME, and click Delete.
- Select the
- Save all of the changes to the model.
- Transform the logical model
ARCH_JKENT_HR.ldminto a physical model namedARCH_JKENT_HR_changes.dbm.- In the Data Project Explorer, go to the Data Models folder where the logical model resides.
- To start The Transform to Physical Data Model wizard, select
the logical model
ARCH_JKENT_HR.ldm, click Data, Transform, and then click Physical Data Model. - Complete the following steps in the Transform to Physical
Data Model wizard:
- Click Create New Model, and then click Next.
- From the Physical Data Model File page, accept the
default value for the data design project, specify
ARCH_JKENT_HR_changesfor the name for the physical model, and specify the database type. Click Next. - From the Options page, verify the options for the
transformation. Ensure that
HRis specified as the schema name. Click Next. - Click Finish to save the physical data model.
- At this point, send the physical model with the changes via email back to Eric, the database administrator. Alternatively you could check it into your version control system where Eric can check it out from Optim Database Administrator.
Part C. Applying the changes to the HR database
In this last part of the scenario, Eric migrates the changes from the
physical data model that Tom sent to the JKENT
database. Eric (the Database Administrator) creates a new change
management script, which is an Optim Database Administrator resource that
keeps track of the change management process.
Eric then generates the change commands that are necessary to apply these
changes to the JKENT database. He deploys the
change commands to the database.
If you were in Eric's position, you would complete the following steps.
- Start Optim Database Administrator.
- From the main menu bar, click Help and then select Optim Task Launcher.
- Click the Administration Tab and then select Migrate using the compare editor.
- Click Yes if you are asked to change the Database Administration perspective.
- Follow the instructions in the help view.
- At this point, you may need to enable the Change Management capability.
- From the File menu, click New. If you don't see the Change Management Script, then you must first enable change management.
- To enable change management, from the Windows menu, click Preferences.
- From the Preferences wizard, expand General and click Capabilities.
- Click the Advanced button. Expand Data and check Change Management Capability.
- In the Administration Explorer expand the
JKENTdatabase. Select the Change Management folder, and click New Database Change. - Copy the physical data model that Tom sent
(
ARCH_JKENT_HR_changes.dbm), and paste it into theData Modelsfolder of theJKENTdata design project in the Data Project Explorer. - Open the change management script by double-clicking
JKENT.changexmlin the SQL Scripts folder. The change management script is displayed in the Change Management Script Editor as shown in Figure 6.
Figure 6. Change Management Script Editor
- Migrate the changes in the physical data model that Tom sent
(
ARCH_JKENT_HR_changes.dbm) over toHR.- From the Change Management menu of the
JKENT.changexmleditor, select Compare and Migrate Objects. If it isn't enabled, make sure the change management script editor has focus. - From the Migrate Objects to Target Model wizard, located the
Migration Sourcepage and select Physical data model. In the selection dialog, drill down to find the model with the changes, for example,ARCH_JKENT_HR_changes.dbm, and click Next. - From the Choose Source Objects page, select the schemas
folder, check the
HRschema, and click Add.
Figure 7. Choose Source Objects page of the Migrate Objects to Target Model wizard.
- Click Next until the
Comparison Editor is displayed in a dialog window with the
changed model on the left, and the
HRtarget model on the right. - Use the up and down arrows in the tool bar to tab through the
differences in the two models.
In this demo, the Comparison Editor shows that the differences that you want to move are the deletion of the
DEPTNAMEcolumn from theORGANIZATIONtable, the new foreign keyCOMPLETION_CODE_PROJ_FKin thePROJECTtable, and the newCOMPLETION_CODEStable.When you move the foreign key over, the foreign key column
COMP_CODEwill be moved automatically. If you move the foreign key inPROJECTbefore you move theCOMPLETION_CODEStable, theCOMPLETION_CODEStable is moved over automatically. - Move or apply these changes to the target
HRmodel by clicking the right arrow when the difference is selected. - Once the changes have been incorporated, click Finish.
- From the Change Management menu of the
- Generate the change commands to implement these changes. From the Change Management Script Editor, click the Overview tab, and then click Preview Commands to start the Generate Change Command dialog to view the generated change commands.
- Deploy the changes to the
HRdatabase. From theCommandssection of the Change Management Script Editor, click Run to start the Run Change Commands wizard. - Click Finish to deploy the commands.
The SQL Results view contains the status of the changes that you made to the
HRdatabase.
This article demonstrates one way that you can use Optim Database Administrator and InfoSphere Data Architect together. The same physical data models can be shared between both tools, allowing for an integrated process from design and modeling, to database change management. The step-by-step instructions in the article should help new users get started with using these tools together.
| Description | Name | Size | Download method |
|---|---|---|---|
| Create the sample database used in this article | ODAIDADemo.zip | 5KB | HTTP |
Information about download methods
Learn
- Learn more about Optim Database Administrator.
- Learn more about InfoSphere Data Architect.
- Visit the developerWorks resource page for
Information Management and Rational application development to
read articles and tutorials and connect to other resources to expand your
RDA skills.
- Browse the technology bookstore for books
on these and other technical topics.
Get products and technologies
- Download a free
version of Optim Database
Administrator.
- Download a free
trial version of InfoSphere Data Architect.
- Download IBM product evaluation
versions and get your hands on application development tools and
middleware products from DB2®, Lotus®, Rational®,
Tivoli®, and WebSphere®.
Discuss
- Check out developerWorks
blogs and get involved in the developerWorks community.
- Data Studio Forum on
developerWorks.
- Data Studio Community Space on
developerWorks.
- Data Studio Team Blog on
developerWorks.

Carolyn Henry is an Information Developer in the DB2 and IMS Tools group at IBM Silicon Valley Laboratory in San Jose, CA. She has worked on the DB2 Change Management Expert team since 2004

Leila Johannesen is a usability engineer at IBM Silicon Valley Lab in San Jose, CA. She works on the ease of use of the DB2 Tools family

Don Langworthy is a Software Engineer in the Silicon Valley Lab in San Jose, CA. He has been working on DB2 Change Management Expert since 2004. When Don isn't working on DB2 Change Management Expert, he's calling balls and strikes in high school baseball games.






