I have a big table and i want my script to rename its constraints, with script below.
Can this operation somehow "lock" my database objects or other way corrupt them? Maybe constraint is in use in datatabse by some DML-operation at that time when i execute the alter-statement, and i can recieve error ala "constraint is locked you cannot rename it!"? Or is it possible that when i run the rename-statement then i other sessions trying to do a DML operation on the table will recieve error ala "the table's constraint is being renamed you cannot do DML at this time"? Or is there any other bad thing that can happen when i try to rename constraints?
DECLARE
CURSOR c_data IS SELECT * FROM All_Constraints WHERE Table_Name = 'T1';
BEGIN
FOR cur_rec IN c_data LOOP
EXECUTE IMMEDIATE 'ALTER TABLE T1 RENAME CONSTRAINT ' || cur_rec.constraint_name || ' TO OLD_' || cur_rec.constraint_name;
END LOOP;
END;