ORA-00069: cannot acquire lock — table locks disabled for TEST1

ORA-00069: cannot acquire lock — table locks disabled for TEST1

Error:
Lock is disable for the table, it will protect from accidental deletion of table.

SQL> truncate table test1;
truncate table test1
*
ERROR at line 1:
ORA-00069: cannot acquire lock -- table locks disabled for TEST1

SQL> drop table test1;
drop table test1
*
ERROR at line 1:
ORA-00069: cannot acquire lock -- table locks disabled for TEST1

Cause:
You are not able to acquire the lock for DDL statements because it’s disable table lock.
But you and add column in table during disable locks

ALTER TABLE test1 ADD name varchar2(50);
Table altered.

Solution
Note: It is effective in Production Environment which disable the DDL command like TRUNCATE or DROP for table for protection of accidental deletion.

1. Check the table lock

-- As show in example , it disabled for TEST1 table
SQL> select table_lock from user_tables where table_name = 'TEST1';

TABLE_LO
--------
DISABLED

2. For Enable and disable the locks status for table

-- Enable lock for table
SQL> alter table test1 enable table lock;
Table altered.

--Disable lock for table
SQL> alter table test1 disable table lock;
Table altered.

3. After enable it will fixed the issue.

SQL> alter table test1 enable table lock;
Table altered.

SQL> truncate table test1;
Table truncated.

This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply