DDL_LOCK_TIMEOUT Parameter Usage to Avoid ORA-00054: resource busy error

I will explain the DDL_LOCK_TIMEOUT Parameter Usage to Avoid ORA-00054: resource busy error in this post. let’s review the DDL_LOCK_TIMEOUT Parameter | ORA-00054: resource busy error.

 

 

DDL_LOCK_TIMEOUT Parameter | ORA-00054: resource busy error

You can get the ORA-00054: resource busy error during DDL Operation as follows.

SQL>truncate table test_table;
truncate table test_table
*
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
Elapsed: 00:00:00.12

 

 

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

If you don’t want to get the ORA-00054: resource busy error, then you need to use DDL_LOCK_TIMEOUT Parameter Usage to Avoid ORA-00054: resource busy error as follows.

 

SQL> show parameter ddl_lock

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
ddl_lock_timeout integer 0
SQL>




SQL> alter session set ddl_lock_timeout=600;

Session altered.

 

When you use the DDL_LOCK_TIMEOUT parameter, then DDL statements will wait for a DML lock.

If you set DDL_LOCK_TIMEOUT parameter, then Oracle will wait until DDL_LOCK_TIMEOUT value ( seconds ), then will perform the same operation.

 

You can set this parameter both System based and Session based as follows.

Session based

SQL> alter session set ddl_lock_timeout=600;

Session altered.

 

System based

SQL> alter system set ddl_lock_timeout=600 scope=both sid='*';

Session altered.

 

 

Do you want to learn Oracle Database Performance Tuning detailed, then Click this link.

Performance Tuning and SQL Tuning Tutorial in the Oracle Database

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

Leave a Reply

Your email address will not be published. Required fields are marked *