I'm trying to call a Java function from Oracle database that does the following:
Process p = Runtime.getRuntime().exec("...");
When I try to run it, I get the following error:
ORA-29532: Java call terminated by uncaught Java exception:
java.security.AccessControlException: the Permission (java.io.FilePermission
<<ALL FILES>> execute) has not been granted to SCOTT. The PL/SQL to grant this
is dbms_java.grant_permission( 'SCOTT', 'SYS:java.io.FilePermission', '<<ALL
FILES>>', 'execute' )
How do I grant this permission?
UPDATE: When I run the following in SQL*Plus (as sysdba):
dbms_java.grant_permission( 'SCOTT',
'SYS:java.io.FilePermission',
'<<ALL FILES>>',
'execute' );
I get the error:
SP2-0734: unknown command beginning "/dbms_java..." - rest of line ignored.
SQL> SP2-0734: unknown command beginning "'SYS:java...." - rest of line ignored.
SQL> SP2-0734: unknown command beginning "'<<ALL FIL..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
EXEC
before the stored procedure in SQL*Plus or surround it in aBEGIN
andEND
block.