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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.