Multiple CHECK constraints are allowed on a column. All the CHECK constraints must evaluate
to TRUE to allow a value to be entered in the column. For example, we could modify the preceding
CHECK constraint to ensure that Order_Line_Item_Qty is greater than 0 in addition to being less
than 100.
Trigger-Based Integrity
If the business rules are too complex to implement using unique constraints, a database trigger
can be created on a table using the create trigger command along with a block of PL/SQL code
to enforce the business rule.
Triggers are required to enforce referential integrity constraints when the referenced table
exists in a different database. Triggers are also useful for many things outside the realm of
constraint checking (auditing access to a table, for example).I cover database triggers in-depth
in Chapter 17.
Indexes
An Oracle index allows faster access to rows in a table when a small subset of the rows will be
retrieved from the table. An index stores the value of the column or columns being indexed, along
with the physical RowID of the row containing the indexed value, except for index-organized
tables (IOTs), which use the primary key as a logical RowID. Once a match is found in the index,
the RowID in the index points to the exact location of the table row: which file, which block
within the file, and which row within the block.
18 Oracle Database 11g DBA Handbook
Indexes are created on a single column or multiple columns.
Pages:
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81