Thursday, April 26, 2007

Drop all Java Classes and Resources from Oracle

Note: I had some bad times after doing this... couldn't use loadjava anymore, so I'll have to update this entry when I figure out how to properly drop all java classes...

Log in as sys and execute:

delete from sys.obj$ o where o.type# = 29; -- classes

delete from sys.obj$ o where o.type# = 30; -- resources

Then check that they're all gone:

SELECT object_name, object_type, status

FROM user_objects WHERE object_type LIKE 'JAVA%';

1 comment:

Anonymous said...

better solution:

BEGIN
FOR c IN ( SELECT object_name FROM user_objects WHERE object_type LIKE 'JAVA%' and OBJECT_TYPE = 'JAVA CLASS' )
LOOP
EXECUTE IMMEDIATE 'DROP JAVA CLASS "' || c.object_name || '"';
END LOOP;
END;

Labels

Blog Archive

Contributors