Oracle10g使用$ORACLE_HOME/rdbms/admin/awrrpt.sql報錯

kisslfcr發表於2015-08-18
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)
但是動作太大,無法在產品環境試驗

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29135257/viewspace-1775377/,如需轉載,請註明出處,否則將追究法律責任。

相關文章