简体   繁体   English

无法在Oracle上加载Java并且dbms_java.grant_permission无法正常工作

[英]fail to loadjava on Oracle and dbms_java.grant_permission not working

I was trying to loadjava on Oracle using this: 我正在尝试使用以下方法在Oracle上加载java:

loadjava -u testdb/user123@TEST -r -v -f -genmissing -s -grant public ojdbc6.jar

and i got lots of errors like this: 而且我有很多这样的错误:

[20:07:47]genmissing: oracle/jdbc/NotificationRegistration [20:07:47]creating : class oracle/jdbc/NotificationRegistration [20:07:47]loading : class oracle/jdbc/NotificationRegistration [20:07:47]Error while creating class oracle/jdbc/NotificationRegistration [20:07:47] ORA-29545: 类格式错误: User has attempted to load a class (oracle.jdbc.NotificationRegistration) into a restricted package. [20:07:47]遗失:oracle / jdbc / NotificationRegistration [20:07:47]正在创建:类oracle / jdbc / NotificationRegistration [20:07:47]正在加载:类oracle / jdbc / NotificationRegistration [20:07:47 ]创建类oracle / jdbc / NotificationRegistration时出错[20:07:47] ORA-29545:类格式错误:用户试图将类(oracle.jdbc.NotificationRegistration)加载到受限制的程序包中。 Permission can be granted using dbms_java.grant_permission(, LoadClassInPackage... [20:07:47]ORA-06512: 在 line 1 可以使用dbms_java.grant_permission(,LoadClassInPackage ...,[20:07:47] ORA-06512:在第1行

it seems that 'testdb' need more permissions,so i use 'sys' to grant permission in Oracle: 似乎'testdb'需要更多权限,因此我使用'sys'在Oracle中授予权限:

exec dbms_java.grant_permission('TESTDB','SYS:oracle.aurora.security.JServerPermission','LoadClassInPackage.*', null);

However,when i tried to load the jar again,i got the same error as before. 但是,当我尝试再次加载jar时,却遇到了与以前相同的错误。

What should I do? 我该怎么办? Please help me. 请帮我。

Use the normal user called x and give all the required permission as below, then try it again. 使用名为x的普通用户并按以下方式授予所有必需的权限,然后重试。

CONNECT
RESOURCE
CREATE ANY PROCEDURE
CREATE PROCEDURE
CREATE ANY TABLE
CREATE TABLE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM