By specifying an ALTER definition in the
ALTER TABLE statement, you can change a CONSTRAINT definition or a key definition .Syntax
<alter_definition> ::=
ALTER CONSTRAINT <constraint_name> CHECK <search_condition>
| ALTER <key_definition>
Explanation
CONSTRAINT <constraint_name>
The constraint name must identify a CONSTRAINT definition in the table. If the specified search condition is not violated by any row in the table, it replaces the existing search condition of the CONSTRAINT definition. Otherwise, the ALTER TABLE statement fails.
<key_definition>
The key specified by the key definition replaces the current key in the table. The columns specified in the key definition must identify columns in the table and must have the key property (
key definition).If a column of the key to be replaced is a referenced column of a referential CONSTRAINT definition, the ALTER TABLE statement will fail.
With large tables, in particular, this may take more time, since extensive copy operations have to be carried out.