Below are the statements that I run to remove and recreate a USER and TABLESPACE on my local machine in oracle.
DROP TABLESPACE X INCLUDING CONTENTS AND DATAFILES ;
DROP USER X CASCADE;
CREATE TABLESPACE X DATAFILE '$ORACLE_PATH/X.dbf' SIZE 128M AUTOEXTEND ON EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO;
CREATE USER X IDENTIFIED BY xxxxxxx DEFAULT TABLESPACE X TEMPORARY TABLESPACE temp;
GRANT exp_full_database TO X;
GRANT CONNECT,RESOURCE,DBA TO X;
We recently added a condition to disable the lock on a table in this TABLESPACE and the above DROP command now issues:
Error report:
SQL Error: ORA-00604: error occurred at recursive SQL level 1
ORA-00069: cannot acquire lock -- table locks disabled for TABLE
00604. 00000 - "error occurred at recursive SQL level %s"
Does anyone know of a way to DROP the USER and TABLESPACE without enabling the LOCKs or a better method to recreate a local TABLESPACE and USER with locks disabled?
Cheers
The purpose of the DISABLE TABLE LOCK command is to prevent DDL. If you could drop the table without re-enabling the table lock first that would be a bug to me.
In your case you will have to enable table locks with a script such as this one:
Unfortunately it may take a very long time to execute or even fail unexpectedly: