Hi all,
I have this script with the following flow
T1) create table newA1 from tableA where some condition;
....
T2) create table newA2 from tableA where some condition;
I need tableA to remain unchanged / there must be no transaction in tableA all the way from before T1 till after T2
=====================
I thought of adding
lock tableA in exclusive mode before T1, but right after the CREATE TABLE DDL at T1, the lock is release due to autocommit nature of the DDL.
-- lock tableA in exclusive modeĀ (add here)
T1) create table newA1 from tableA where some condition;
-- lock release automatically
-- lock tableA in exclusive mode again
T2) create table newA2 from tableA where some condition;
I would have to manually lock the table again before T2 which kindof leave a time gap (no matter how small it is) for chance/probability for DMLs on tableA .
q1) How do I overcome this problem ? such that tableA remains lock throughout the entire T1 to T2 duration ?
Regards,
Noob