Synchronizing the database and the data model
Let's assume that the DBA group has transferred a data model
to the application development group and the application development group
added an object (such as a view). The Rational XDE allows you to compare and sync
the data model, (or vice versa). In other words, if the database or data model
has changed, it can compare and generate the DDL to ensure they remain synchronized.
To synchronize a data model and an associated database, right-click your database
in the Model Explorer, and select Data Modeler->Compare and Sync. A wizard (similar
to the forward and reverse engineering wizards) will guide you through the process.
For example, the BANKDB database contained no views in the
PAULZ schema, as shown below:
This database was reversed engineered (detailed above) and a
view was added (it was built over another table in the database). To get the
changes to the model back into the database, I used the wizard to synchronize
the changes between the data model and the database.
The wizard generated a DDL script that would produce these
changes:
In addition to this, I asked the wizard to execute this
script for me, thereby creating the view shown below:
Putting it all together
As you can see, the DB2 UDB integration into the Rational
XDE provides enterprises with a powerful unification tool that can bridge the
gap between all components of the application and the underlying database schema.
When combined with the RUP methodology and a unifying modeling language such as
UML, the process, efficiency, and quality of your code steps up into a whole
new world. Interested? Learn more at: www.ibm.com/software/awdtools/developer/datamodeler/.
About the author
Paul C. Zikopoulos, BA,
MBA, is
an award-winning writer and speaker with the IBM Database Competitive Technology team. He has more than
nine years of experience with DB2 UDB and has written numerous magazine
articles and books about it. Paul has co-authored the books: DB2
Version 8: The Official Guide, DB2:
The Complete Reference, DB2
Fundamentals Certification for Dummies, DB2 for Dummies, and A DBA's
Guide to Databases on Linux. Paul is a DB2 Certified Advanced Technical
Expert (DRDA and Cluster/EEE) and a DB2 Certified Solutions Expert (Business Intelligence and
Database Administration). You can reach him at: paulz_ibm@msn.com.