< Previous | Next >

Analyzing the SAMP schema in the physical data model

In the exercise, you will analyze the SAMP schema in the physical data model to check for compliance with foreign key index rules. You can use the model analysis feature in the workbench to check for compliance with various rules and rule categories, including naming standards and SQL syntax.

You can analyze the following data objects for compliance:
  • A database or schema in a physical data model
  • A package in a logical data model
  • A database or schema in a database connection in the Database Explorer

To analyze the SAMP schema in the physical data model:

  1. Right-click the schema SAMP in the Data Project Explorer and select Analyze Model.
  2. In the window that opens, clear all check boxes in the Rule categories list except Index and storage.
  3. In the Rules list, clear all check boxes except Foreign key index check.
    Screen capture showing the window with the rules and rule categories selected, as described.
  4. Click Finish. In the Problems view, warnings are displayed. For example, "Foreign key EMPLOYEE_DEPARTMENT_FK in table EMPLOYEE does not have an index". You can navigate from problems in the Problems view to the corresponding object in a diagram or the Data Project Explorer. For example, you can navigate to the EMPLOYEE_DEPARTMENT_FK column to fix the problem by adding an index to this column.
  5. Double-click the warning message in the Problems view. The EMPLOYEE_DEPARTMENT_FK column is highlighted in the Data Project Explorer.
  6. Right-click the EMPLOYEE_DEPARTMENT_FK column, and select Add Data Object > Index. A new index named EMPLOYEE_WORKDEPT_IDX is created and displayed in the Data Project Explorer.
  7. Highlight EMPLOYEE_WORKDEPT_IDX in the Data Project Explorer, click the Details tab in the Properties view, and verify that the index is using the WORKDEPT column.
    Screen capture showing the Details tab in the Properties view, as described.
    You can repeat the steps for each foreign key that does not have an index. Now, save the sample_model physical data model file to save your changes.
  8. Click File > Save All from the main menu bar.
Your changes are saved to the model file.
< Previous | Next >