The methods for deleting all objects under an Oracle user may not be available to everyone. The following describes two common methods for deleting all objects under an Oracle user, we hope this will help you learn how to delete Oracle users.
Method 1:
Drop user XXXX cascade;
Drop tablespace xxxx including contents;
Method 2:
Write Stored Procedure Implementation
DECLARE
TYPE name_list is table of VARCHAR2 (40 );
TYPE type_list is table of VARCHAR2 (20 );
Tab_name name_list: = name_list ();
Tab_type type_list: = type_list ();
SQL _str VARCHAR2 (500 );
BEGIN
SQL _str: = select uo. object_name, uo. object_type from user_objects uo where uo. object_type not in (INDEX, LOB) order by uo. object_type desc;
Execute immediate SQL _str BULK COLLECT INTO tab_name, tab_type;
FOR I IN Tab_name.FIRST .. Tab_name.LAST LOOP
SQL _str: = DROP | Tab_type (I) | Tab_name (I );
Execute immediate SQL _str;
End loop;
END;