I currently have a
DROP USER SAMPLE_USER CASCADE;
statement to drop the user SAMPLE_USER
and all child tables/object/etc.
SAMPLE_USER
contains approx 1200 tables and, using SQLDeveloper, can take several minutes to drop the user and all associated tables. Is there an alteration to this statement that can be used to speed up dropping user SAMPLE_USER
?
Answer by Shaun 2 ·
Jonah is correct. But oddly, there are some bugs on Tablespace Quotas that slow down drop user. If you remove any tablespace quotas first then quite often the drop user is faster. This is particularly evident if dropping many users. So you could try that.
Answer by Jonah H. Harris ·
In addition to handling the normal UNDO transactional semantics of the DROP, I don't believe there's much you can do, because Oracle has to internally perform removal of all dependency information and invalidate any/all objects that reference ones you are dropping.
Some people say you can cheat by dropping/truncating tables/tablespaces/data files first, but the sum of time spent is generally equivalent and it's more complex and error-prone.
Answer by oakesgr ·
Ok - it's a longshot, but trying REALLY hard to think outside the box...
If your db in question has only the 1 major schema, shutdown your database remove the files and create a new one. It's pretty drastic I know, but otherwise I can't think of anything to add to Jonah's answer.