本文主要是介绍删除包时,报ORA-04043: object SYS_PLSQL×× dose not exists,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
环境
OS: SunOS HOSTNAME 5.10 Generic_127111-11 sun4u sparc SUNW,Sun-Fire-V890
DB:Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
问题:一个包处于无效状态,通常直接用命令编译一下,就行了,但这个简单的操作,却碰到:
SQL> alter package SCHEMA.PACKAGENAME compile;
alter package SCHEMA.PACKAGENAME compile
*
ERROR at line 1:
ORA-04043: object SYS_PLSQL_6459_DUMMY_2 does not exist
这个错误,其实在9i里这是比较常见的错误,在SP里定义:TYPE和TABLE OF TYPE的数据对象时.Oracle就会自动的在系统内生成SYS_PLSQL_<ID of SP>%对象,好象Pipeline也会产生.当找到不这些SYS_PLSQL对象时,这个SP就无法通过编译了.
SQL> select 'drop type SCHEMA.'||object_name||' force;' from dba_objects where object_name like 'SYS_PLSQL_6459%';
drop type SCHEMA.SYS_PLSQL_6459_15_1 force;
drop type SCHEMA.SYS_PLSQL_6459_DUMMY_1 force;
这里确实没有错误提示里所指的对象。
解决办法,把这个SP对应的SYS_PLSQL对象全删除:
SQL> drop type SCHEMA.SYS_PLSQL_6459_15_1 force;
Type dropped.
SQL> drop type SCHEMA.SYS_PLSQL_6459_DUMMY_1 force;
Type dropped.
SQL> alter package SCHEMA.PACKAGENAME compile;
Package altered.
确认一下,有没有重新生成SYS_PLSQL:
SQL> select 'drop type SCHEMA.'||object_name||' force;' from dba_objects where object_name like 'SYS_PLSQL_6459%';
drop type SCHEMA.SYS_PLSQL_6459_DUMMY_2 force;
drop type SCHEMA.SYS_PLSQL_6459_15_2 force;
drop type SCHEMA.SYS_PLSQL_6459_DUMMY_2 force;
这就对应Package header里定义了三个TYPE:
TYPE invcur_t IS REF CURSOR RETURN trinvoicemaster%ROWTYPE;
TYPE inv_lines IS TABLE OF trinvoicemaster%ROWTYPE;
FUNCTION split_invoice ( cur_invoicemast in invcur_t ) RETURN inv_lines pipelined;
要删除这些SYS_PLSQL有时比较难的,记得有次用命令死活也删除不了,最后借助TOAD,在图形里把它删除了。Package所引用的SYS_PLSQL对象怎么会不见了,我记得这是一个BUG. 10G之后,就没有碰到这个问题了。
这篇关于删除包时,报ORA-04043: object SYS_PLSQL×× dose not exists的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!