Rational Data Architect and DB2 9: The Rest of the Database Explorer View - Page 2
June 12, 2007
Compare With Shows the differences between two objects of the same type from within a database. You select an object first and then this option. However, you cannot compare databases. (Rational DA gives you an error if you select this option when a database is selected.)
For example, to compare the EMPLOYEEDJ and EMPLOYEE tables within the SAMPLE database, perform the following steps:
1. Expand the SAMPLE database and locate the EMPLOYEEDJ table within the Tables folder, right-click, and select Compare With->Another Data Object:
2. Rational DA automatically displays a list of the same type of objects within the database. For this example, since I selected a table for the base comparison, Rational DA opens a window that lets me select another table within the database to compare it to, as shown below:
Notice in the previous figure that the table EMPLOYEEDJ, which serves as the basis for this comparison, isnt available for selection.
3. Click OK. The Compare editor opens:
Using this editor, you can browse through all the differences and copy highlighted differences between the compared artifacts. For example, in the previous comparison, you can see that a primary key exists on the EMPLOYEE table but not on the EMPLOYEEDJ table. To make a primary key on the EMPLOYEEDJ table, select the EMPLOYEE tables primary key, and click Copy from Right to Left ():
Of course, you can copy changes in either direction. If you wanted to copy a change from the EMPLOYEEDJ table to the EMPLOYEE table, you would select Copy from Left to Right ().
Its important to note that none of these changes affects the actual objects in other words you are merely working in a designer. To make the changes permanent, you need to generate the corresponding DDL. The good news is that Rational DA makes this very simple. When you have made your changes, you can generate the corresponding DDL in the same way that you used to copy the changes only this time select the appropriate Generate Left Delta DDL () or Generate Right Delta DDL () buttons, depending on what you want to script. When you select either of these options, Rational DA opens a window thats very similar to the Generate DDL option detailed earlier in this article.
In this example, the Generate Left Delta DDL button generates the DDL for the changes to the left side of the comparison, as shown below:
Analyze Model Analyzes a data model to ensure that it meets certain specifications laid out by rules youve set up for your projects. Model analysis helps to ensure model integrity and helps to improve model quality by providing design suggestions and best practices.
From the Database Explorer view, you can analyze a database or schema from a database connection. This option is also available from the Data Project Explorer view on a selected project; there you can analyze a package in a logical data model in addition to a database or schema in a database connection.
An example of the window that opens when you select this option is shown below:
Its outside the scope of this article to go into more details about this feature; however, in a future article, Ill show you how to use this feature to analyze a glossary and business rules with respect to table names.
Analyze Impact - Helps you find dependencies and analyze the impact of changes to your database. For example, if you want to copy a schema from the Database Explorer to the Data Project Explorer, you can find dependencies on that schema to ensure that all references are resolved. In addition, if you want to modify an object, you can view the list of objects that might be impacted by such a change. This option is available from the Data Project Explorer and the Database Explorer views. The Impact Analysis window looks like this:
You use the Impact Analysis window to specify impact analysis direction and expansion options. Dependent objects finds objects that the selected object depends on. Impacted objects finds objects that the selected object impacts. Both perform the impact analysis with both dependent and impacted objects. This window also allows you to include recursive objects and those within the containment hierarchy in the analysis.
The result of an impact analysis is shown in the Model Report tab and in the designer canvas. Here is an example:
You can perform an impact analysis from the Compare window associated with the Compare With option. You can invoke this feature using the Analyze Left Impact () or Analyze Right Impact () buttons.
Wrapping it all up
In this article, I took you on a whirlwind tour of the rest of the features available in the Database Explorer view. As you can see, Rational DA is a very feature-rich and extensive product. You can explore for yourself the features Ive presented in this series by selecting various options and playing around in the tool.
In subsequent articles, I will move on to more business-related solutions that are possible with a tool such as Rational DA. In the next article, Ill show you how you can enforce naming standards in your database based on business rules that you define.
» See All Articles by Columnist Paul C. Zikopoulos
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 ten years of experience with DB2 and has written more than one hundred articles and several books about it. Paul has co-authored the books: Information on DB2 9 New Features, Demand: Introduction DB2 9 New Features, 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). In his spare time, he enjoys all sorts of sporting activities, running with his dog Chachi, and trying to figure out the world according to Chloë his new daughter. You can reach him at: mailto:firstname.lastname@example.org.
IBM, DB2, and Rational are registered trademarks of International Business Machines Corporation in the United States, other countries, or both.
Microsoft is a trademark of Microsoft Corporation in the United States, other countries, or both.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Other company, product, and service names may be trademarks or service marks of others.
Copyright International Business Machines Corporation, 2007. All rights reserved.
The opinions, solutions, and advice in this article are from the authors experiences and are not intended to represent official communication from IBM or an endorsement of any products listed within. Neither the author nor IBM is liable for any of the contents in this article. The accuracy of the information in this article is based on the authors knowledge at the time of writing.