The dml_lock_timeout Parameter in the DBMS_REDEFINITION Package

 As you know, during the execution of the FINISH_REDEF_TABLE procedure, the table must be locked exclusively for a short period so that the procedure can complete successfully. Otherwise, the procedure will wait until other transactions running on the table are finished, and it will remain in a waiting state:

SQL> EXEC DBMS_REDEFINITION.can_redef_table('VAHID', 'MYTBL');

PL/SQL procedure successfully completed

SQL> EXEC DBMS_REDEFINITION.start_redef_table('VAHID', 'MYTBL', 'MYTBL_TEMP');

PL/SQL procedure successfully completed

SQL> EXEC DBMS_REDEFINITION.sync_interim_table('VAHID', 'MYTBL', 'MYTBL_TEMP');

PL/SQL procedure successfully completed
SQL> delete MYTBL where rownum<=1;

1 row deleted
SQL> EXEC DBMS_REDEFINITION.finish_redef_table(‘USEF’, ‘MYTBL’, ‘MYTBL_TEMP’);

Executing…
SQL> EXEC DBMS_REDEFINITION.finish_redef_table(‘USEF’, ‘MYTBL’, ‘MYTBL_TEMP’,dml_lock_timeout => 10);

ORA-42012: error occurred while completing the redefinition

ORA-42042: time out in acquiring DML lock during online redefinition

Elapsed: 00:00:11.11
Vahid Yousefzadeh

Written by Vahid Yousefzadeh

I have been a DBA since 2011 and I work with Oracle technology. Linkdin: linkedin.com/in/vahidusefzadeh telegram channel ID:@oracledb vahidusefzadeh@gmail.com



Comments

Popular posts from this blog

Oracle 21c Enhancements for TTS Export/Import

Oracle 23ai — Speed up IMPDP Using NOVALIDATE Constraints

Staging Tables in Oracle 23ai