When to manually set constraint checking for a table

Typically, you need to manually set constraint checking for a table in two situations: after loading data into a table and when altering a table by adding constraints on the table.

The load operation causes a table to be put into check pending state automatically if the table has check or foreign key constraints defined on it. When the load operation is completed, you can turn on constraint checking for the table.

If you are altering a table by adding a foreign key, you need to turn off constraint checking before you alter the table. After you add the foreign key, you need to turn constraint checking back on.