If PLS-00201: identifier 'DBMS_LOCK' must be declared is thrown, connect as sysdba, then
PLS-00201: identifier 'DBMS_LOCK' must be declared
as sysdba
grant execute on dbms_lock to user;