lock_table is session specific and once session is closed lock will also be released and other users will be able to perform DMLs.
Making the table read-only before using the DDL commands (ALTER table) and making it read-write if the DDLs are successful would be preferable (even session is closed)
BEGIN executeimmediate'alter table table_name read only';--Perform Your DDL Commands here.executeimmediate'alter table table_name read write';END;/
Note that users can still choose data from tables despite this.
lock_table is session specific and once session is closed lock will also be released and other users will be able to perform DMLs.
Making the table read-only before using the DDL commands (ALTER table) and making it read-write if the DDLs are successful would be preferable (even session is closed)
BEGIN execute immediate 'alter table table_name read only'; --Perform Your DDL Commands here.execute immediate 'alter table table_name read write'; END; /
Note that users can still choose data from tables despite this.