Tech and travel

Removing all objects for a user

2007-05-03

From this post, here’s a way to purge all the objects for a user. You can use this if you don’t have SYS access.

select 'drop '||object_type||' '|| object_name||
       DECODE(OBJECT_TYPE,'TABLE',' CASCADE CONSTRAINTS;',';')
from user_objects

You should spool this to a file and then run that file. Then to really remove them, use :

purge recyclebin;

This works on Oracle 10g2.

Copyright (c) 2024 Michel Hollands