Using the report name awrrpt_1_50619_50623.html

select output from table(dbms_workload_repository.awr_report_html( :dbid,
                         *
ERROR at line 1:
ORA-04063: package body "SYS.DBMS_SWRF_REPORT_INTERNAL" has errors
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 222
ORA-06512: at line 1


Report written to awrrpt_1_50619_50623.html

 

 

解决:

16:20:16 SQL> select owner,object_name,object_type,status from dba_objects where owner='SYS' AND status='INVALID';

OWNER                                    OBJECT_NAME                                        OBJECT_TYPE                            STATUS
---------------------------------------- -------------------------------------------------- -------------------------------------- ----------------------------------------
SYS                                      DBA_HIST_FILESTATXS                                VIEW                                   INVALID
SYS                                      DBA_HIST_SQLBIND                                   VIEW                                   INVALID
SYS                                      DBA_HIST_LATCH_MISSES_SUMMARY                      VIEW                                   INVALID
SYS                                      DBA_HIST_DB_CACHE_ADVICE                           VIEW                                   INVALID
SYS                                      DBA_HIST_ROWCACHE_SUMMARY                          VIEW                                   INVALID
SYS                                      DBA_HIST_OSSTAT                                    VIEW                                   INVALID
SYS                                      DBA_HIST_SEG_STAT                                  VIEW                                   INVALID
SYS                                      DBA_HIST_ACTIVE_SESS_HISTORY                       VIEW                                   INVALID
SYS                                      DBA_HIST_TABLESPACE_STAT                           VIEW                                   INVALID
SYS                                      DBA_HIST_SERVICE_STAT                              VIEW                                   INVALID
SYS                                      DBA_HIST_SERVICE_WAIT_CLASS                        VIEW                                   INVALID
SYS                                      DBMS_SWRF_REPORT_INTERNAL                          PACKAGE BODY                           INVALID
SYS                                      WRI$_ADV_SQLTUNE                                   TYPE BODY                              INVALID
SYS                                      DBMS_SQLTUNE                                       PACKAGE BODY                           INVALID

 

16:27:30 SQL> alter package DBMS_SWRF_REPORT_INTERNAL  compile;

Package altered.

16:29:05 SQL> alter package DBMS_WORKLOAD_REPOSITORY   compile;

Package altered.

 

 

参考:http://forums.oracle.com/forums/thread.jspa?threadID=1077096