In one ALTER TABLE statement, all ADD column-name, DROP column-name, and MODIFY column-name with data type functions are done first and as one group. Processing this group is done in the following sequence:
Primary and unique constraints are validated as rows are added back in step 9. If a duplicate is found, the entire ALTER statement is backed out.
Foreign keys and domain constraints are added after all rows have been added back. After adding the constraint definition(s), the rows of the table are read in Native Key sequence to validate the constraints. If a row violates one or more domain constraints, the table is placed in check pending status and an SQL return code 170 is returned. You must use the CONFIRM function of DBUTLTY to remove the check pending status before the table can be used. If a row violates foreign keys, the ALTER TABLE statement fails with an SQL return code -176.
If the ALTER TABLE statement cannot complete, it is rolled back to its beginning. If the ALTER TABLE process is force checkpointed (because of the size of the Log Area (LXX) and the concurrent activity), the rollback is incomplete. Therefore, before altering large tables, ensure that the Log Area (LXX) is large enough and take a backup of the data area.
|
Copyright © 2014 CA.
All rights reserved.
|
|