首页 » ORACLE 9i-23ai » ORA-04063: package body “SYS.DBMS_SQLTUNE_INTERNAL” and compile body raise ORA-00904: “XMLAGG”
ORA-04063: package body “SYS.DBMS_SQLTUNE_INTERNAL” and compile body raise ORA-00904: “XMLAGG”
接手一套老库10.2.0.5 不知道以前做了什么,DBMS_SQLTUNE 包一直有无效对象不可用,今天手动建sql profile时,捡起来解决一下。下面是调用DBMS_SQLTUNE.IMPORT_SQL_PROFILE 时报的错误:
第 1 行出现错误:
ORA-04063: package body “SYS.DBMS_SQLTUNE_INTERNAL” 有错误
ORA-06508: PL/SQL: 无法找到正在调用 : “SYS.DBMS_SQLTUNE_INTERNAL” 的程序单元
ORA-06512: 在 “SYS.DBMS_SQLTUNE”, line 5664
ORA-06512: 在 line 55
Solution:
SQL> alter PACKAGE sys.DBMS_SQLTUNE_INTERNAL compile body; 警告: 更改的包体带有编译错误。 SQL> show error PACKAGE BODY SYS.DBMS_SQLTUNE_INTERNAL 出现错误: LINE/COL ERROR -------- ----------------------------------------------------------------- 8351/7 PL/SQL: SQL Statement ignored 8362/29 PL/SQL: ORA-00904: "XMLAGG": 标识符无效 SQL> @o %.XMLAGG 未选定行 # 找个正常同版本的库确认 SQL> @o %.XMLAGG owner object_name object_type status OID D_OID CREATED LAST_DDL_TIME ---------- -------------- ------------------ --------- ---------- ---------- ----------------- ----------------- PUBLIC XMLAGG SYNONYM VALID 5988 20101013 10:12:07 20101013 10:12:07 SQL> @syn2 xmlagg OWNER SYNONYM_NAME TABLE_OWNER TABLE_NAME DB_LINK -------------- ----------------------- --------------- ---------------- ------- PUBLIC XMLAGG SYS SYS_IXMLAGG SQL> @o SYS_IXMLAGG owner object_name object_type status OID D_OID CREATED LAST_DDL_TIME --------- --------------- ------------------ --------- ---------- ---------- ----------------- ----------------- SYS SYS_IXMLAGG FUNCTION VALID 5984 20101013 10:12:07 20101013 10:12:07
Note:
可以看到问题库DBMS_SQLTUNE_INTERNAL body 编译出错是因为少了XMLAGG同义词。
SQL> create public synonym XMLAGG for SYS_IXMLAGG; 同义词已创建。 SQL> alter PACKAGE sys.DBMS_SQLTUNE_INTERNAL compile body; 程序包体已变更。 SQL> show error 没有错误
对不起,这篇文章暂时关闭评论。