我们可以从Meta Dictionary中删除记录吗

时间:2019-01-29 07:33:09

标签: java oracle

我试图重新编译Oracle 11g中的.Java文件之一,但出现以下错误:

$ . /dboracle/orabase/product/11.2.0.BTSP8/bin/loadjava -verbose -resolve -synonym -user nm/nm -grant PUBLIC DeviceAttribParserConstants.java
arguments: '-user' 'nm/***' '-verbose' '-resolve' '-synonym' '-grant' 'PUBLIC' ' DeviceAttribParserConstants.java'
creating : source com/bt/nmsloader/model/DeviceAttribParserConstants
loading  : source com/bt/nmsloader/model/DeviceAttribParserConstants
Error while creating source com/bt/nmsloader/model/DeviceAttribParserConstants
    ORA-29542: class com/bt/nmsloader/model/DeviceAttribParserConstants already defined by source DeviceAttribParserConstants/java
ORA-06512: at line 1

The following operations failed
    source com/bt/nmsloader/model/DeviceAttribParserConstants: creation (createFailed)
exiting  : Failures occurred during processing

当我查看ALL_Objects元词典时,我没有找到JAVA源,但只能看到DeviceAttribParserConstants的JAVA CLASS。

现在,当我尝试重新编译时,我遇到了错误,如果我删除相同的JAVA类文件,那么我将得到如下错误:

ORA-29537: class or resource cannot be created or dropped directly. 
ORA-06512: at line1
* Cause: An attempt was made to create or drop JAVA class or resources that is a known result from compilation of an existing JAVA Source object.

我被困住了。有人可以帮助我解决此错误。

非常感谢。

关于, Himmy Chauhan

1 个答案:

答案 0 :(得分:0)

  

我们可以从Meta Dictionary中删除记录

您不应该这样做,因为它很可能破坏您的数据库。

  

现在,当我尝试重新编译时,我遇到了错误,如果我删除相同的JAVA类文件,那么我将得到如下错误:

ORA-29537: class or resource cannot be created or dropped directly. 
ORA-06512: at line1
* Cause: An attempt was made to create or drop JAVA class or resources that is a known result from compilation of an existing JAVA Source object.

loadjava utility有一个force选项:

-force      Forces files to be loaded, even if they match digest table entries.

因此您可以尝试:

loadjava -verbose -force -resolve -synonym -user nm/nm -grant PUBLIC DeviceAttribParserConstants.java

您也可以尝试drop the existing java object

SELECT OWNER, OBJECT_NAME
FROM   ALL_OBJECTS
WHERE  OWNER = 'NM'
AND    OBJECT_NAME LIKE '%DeviceAttribParserConstants';

DROP JAVA CLASS NM.<insert_object_name>

,然后尝试使用不带强制选项的loadjava

(您可能想尝试backing up the existing class file,然后再删除/覆盖它,以防万一您需要恢复到以前的版本。)