I wanted to execute OS commands from Oracle, so I found this script (https://github.com/bunk3r/ora-exec-cmd/blob/master/ora_exec_cmd.pl) to execute via Java.
It worked, but on the middle of an execution it failed and doesn't work anymore. Now it get "paused" after setting java privs. I tried to delete the java class, function, procedure but it fails.
Using the same account that I used to run the script I'm able to revoke Java privs.
SQL> BEGIN
dbms_java.revoke_Permission('JUAN-SYS', 'java.io.FilePermission', '<<ALL FILES>>', 'read ,write, execute, delete');
dbms_java.revoke_Permission('JUAN-SYS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
dbms_java.revoke_Permission('JUAN-SYS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
END;
6 /
PL/SQL procedure successfully completed.
But trying to delete the procedure, java source, etc fails.
SQL> DROP JAVA SOURCE "Util";
* ERROR at line 1: ORA-04043: object Util does not exist
SQL> DROP FUNCTION "run_cmd";
* ERROR at line 1: ORA-04043: object run_cmd does not exist
SQL> DROP PROCEDURE "rc";
* ERROR at line 1: ORA-04043: object rc does not exist
What am I doing wrong? I would like to remove everything that this script did.
Thanks