0

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

4
  • That looks right to me. Maybe it got dropped already? Check out this question and run the query to see if anything shows up. stackoverflow.com/questions/657803/… Commented Feb 2, 2018 at 20:48
  • You could also try this to see if it's under a different user. select * from all_objects where object_name = 'Util'; Commented Feb 2, 2018 at 20:49
  • Maybe the name is Util and not "Util"? Commented Feb 2, 2018 at 22:27
  • 1
    Joy of naming Oracle objects using mixed case with double quotes. Try to identify them by select * from all_objects where UPPER(object_name) = 'UTIL'; (i.e. convert both to uppercase). The result will be its actual name - then you should be able to drop it; if it is all uppercase - fine, you don't need any quotes. If it is anything else, enclose its name into double quotes, but following letter case EXACTLY as the previous SELECT returned it. Commented Feb 3, 2018 at 12:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.