Oracle10g使用$ORACLE_HOME/rdbms/admin/awrrpt.sql报错

Posted ClarkYu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle10g使用$ORACLE_HOME/rdbms/admin/awrrpt.sql报错相关的知识,希望对你有一定的参考价值。

Enter value for report_name: 
Using the report name awrrpt_1_591_593.html
select output from table(dbms_workload_repository.awr_report_html( :dbid,
*
ERROR at line 1:
ORA-04063: package body "SYS.DBMS_WORKLOAD_REPOSITORY" has errors
Report written to awrrpt_1_591_593.html

查看无效对象:
DBMS_SWRF_REPORT_INTERNAL和DBMS_WORKLOAD_REPOSITORY均无效
尝试编译DBMS_WORKLOAD_REPOSITORY,报错:对象DBMS_SWRF_REPORT_INTERNAL无效
尝试编译DBMS_SWRF_REPORT_INTERNAL报错:
PLS-00753:malformed or corrupted wrapped unit
DBMS_SWRF_REPORT_INTERNAL
使用如下命令,查看错误代码
$ sqlplus / as sysdba 
SQL>set serveroutput on 
SQL> alter package DBMS_SWRF_REPORT_INTERNAL compile; 
SQL>show error 
SQL> alter package DBMS_SWRF_REPORT_INTERNAL compile body; 
SQL>show error 
SQL> alter package DBMS_WORKLOAD_REPOSITORY compile; 
SQL> alter package DBMS_WORKLOAD_REPOSITORY compile body; 
SQL>show error 
查找相关资料,使用如下sql修复包
$sqlplus "/as sysdba" 
SQL> @?/rdbms/admin/catawrtb.sql 
SQL> @?/rdbms/admin/dbmsawr.sql 
SQL> @?/rdbms/admin/prvtawr.plb 
SQL> @?/rdbms/admin/utlrp.sql 
SQL> @?/rdbms/admin/awrrpt.sql 
--If error still exists, please restart the database and try again.... 
SQL> shutdown immediate 
SQL> startup 
SQL> @?/rdbms/admin/awrrpt.sql 

测试环境测试通过
正在正式环境也测试:
Using the report name awrrpt_1_52549_52550.html
select output from table(dbms_workload_repository.awr_report_html( :dbid,
                         *
ERROR at line 1:
ORA-04045: errors during recompilation/revalidation of SYS.DBMS_SWRF_REPORT_INTERNAL
ORA-04030: out of process memory when trying to allocate 4120 bytes (PLS non-lib hp,pdz2M87_Allocate_Permanent)
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_SWRF_REPORT_INTERNAL"
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 309
ORA-06512: at line 1
Report written to awrrpt_1_52549_52550.html

排查:
根据文档
Diagnosing and Resolving ORA-4030 Errors (文档 ID 233869.1)排查
Oracle建议重建awr库:
How to Recreate The AWR ( AUTOMATIC WORKLOAD ) Repository ? (文档 ID 782974.1)
但是动作太大,无法在产品环境试验
 
 






















































以上是关于Oracle10g使用$ORACLE_HOME/rdbms/admin/awrrpt.sql报错的主要内容,如果未能解决你的问题,请参考以下文章

Oracle 10g,和 Oracle 11g 能互相兼容吗?还是向下兼容?

oracle10g安装,卸载

oracle10g 中的还原点

使用 oracle 11g 客户端和 10g 服务器可以吗?

关于oracle 10g中嵌套表扩展的困惑

oracle10g创建数据库