尝试从 Oracle 数据库导出 java 源代码
我正在尝试使用以下代码从 Oracle 数据库导出 java 对象的源代码。
DECLARE
blob1 BLOB;
BEGIN
DBMS_LOB.CREATETEMPORARY(blob1, FALSE);
DBMS_JAVA.EXPORT_SOURCE('OBJECTNAME', 'SCHEMANAME', blob1);
END;
每当我尝试运行它时,我都会收到此异常:
oracle.aurora.rdbms.ModifyPermissionException
即使我以 System.任何想法是什么导致了这个以及我如何让它发挥作用。
经过更多研究后,它在以 sysdba 身份运行以及以拥有对象的用户身份运行时有效。不幸的是,我正在编写一个程序来转储 Oracle 数据库中的 java 对象,并且我无法真正强制我的用户成为 sysdba 或对象的所有者。
有什么办法可以阻止这个错误吗?
I am trying to export the source for a java object from an oracle database using the following code.
DECLARE
blob1 BLOB;
BEGIN
DBMS_LOB.CREATETEMPORARY(blob1, FALSE);
DBMS_JAVA.EXPORT_SOURCE('OBJECTNAME', 'SCHEMANAME', blob1);
END;
Whenever I try to run it, I get this exception:
oracle.aurora.rdbms.ModifyPermissionException
even though I am running as System. Any ideas what is causing this and how I can get this to work.
Having investigated a bit more it worked when running as sysdba and also as the user that owns the objects. Unfortunately I am making a program to dump out the java objects in an Oracle database and I can't really force my users to be sysdba or the object's owner.
Is there any way I can stop this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
连接时使用“as sysdba”选项。当我以 sysdba 身份登录时,我没有收到 ModifyPermissionException。请参阅下面我的操作。我得到的 ORA-29532 是因为我的数据库中根本没有 Java 类。让我知道它是否对你有用。
When you connect use "as sysdba" option. I don't get ModifyPermissionException when I login as sysdba. See my actions below. The ORA-29532 I am getting is becuse I simply don;t have the Java class in my database. let me know if it worked for you.
我面临着同样的问题,但在谷歌上进行了一些搜索后我解决了它。可能会帮助某人。
I am facing the same problem, but after a few searches on google I solve it. Probably will help someone.