You run a referential integrity analysis job to evaluate
whether a relationship between the foreign keys and the primary keys
is valid. Foreign key values that do not match a primary key value
are identified as violations.
About this task
Referential integrity analysis calculates the total number
of foreign key values and primary key values that are not common.
Procedure
- Run a column analysis. See Running a column
analysis job.
- Select a primary key. You must select a primary key before
attempting to run a referential integrity analysis. See Identifying
a single-column primary key.
- Run a key and cross-domain analysis.
- Click Key and Cross-Domain Analysis > Run
a Key and Cross-Domain Analysis at the bottom of the Select
Data Source to Work With window.
- Optional: To find foreign key candidates
for the selected primary key only, click Filter Settings
and check the Include only Primary Keys check
box.
- Select tables to pair with the base table for the cross-domain
analysis. Select a table to add by selecting it in the Available
Tables section and clicking Add to Pair List.
By default, the table that contains the primary key is specified
as the base table. Columns within the paired tables will be evaluated
for compatibility with the selected primary key in the base table.
By default, all available pairs are automatically designated as selected
pairs for evaluation.
- Click Next.
- Select scheduling options (or use the Run
Now default), then click Submit and Close.
You can use the status bar to monitor the progress of the job.
- Run the referential integrity analysis.
- Click the column that was selected as the primary key
(in step 2), then select Key and Cross-Domain Analysis > View
Foreign Key Candidates.
- From the Select Base Column list,
select the primary key column. This causes the columns that are paired
with the selected primary key column to be displayed. If the Paired
to Base percentage exceeds the Flag Percentages Above threshold, the
paired column is flagged as a foreign key candidate (green flag icon).
- Click the flagged foreign key candidate in the Paired
Columns table.
- Select Referential Integrity >
Run Referential Integrity.
Note: If
the selected base column is not selected as the primary key column,
the Run Referential Integrity menu item is
disabled.
- Click Submit > Submit
and Close.
- To view the referential integrity analysis results, click Referential
Integrity > View Referential Integrity
at the bottom of the View Foreign Key Candidates window.
Results
Referential integrity analysis shows the common domain percentages
of the primary key-foreign key relationship including a graphical
representation of the overlap.
What to do next
After you have viewed the results of the referential integrity
analysis job, you can mark foreign key candidates as foreign keys.
To specify that the candidate foreign key is the foreign key, click Foreign
Key Status > Accept Foreign Key Status at
the bottom of the View Referential Integrity window.