ORA-06502:(when create AWR Report )
Using the report name awrrpt_1_53975_53977.html
select output from table(dbms_workload_repository.awr_report_html( :dbid,
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_SWRF_REPORT_INTERNAL", line 3489
ORA-06512: at "SYS.DBMS_SWRF_REPORT_INTERNAL", line 677
ORA-06512: at "SYS.DBMS_SWRF_REPORT_INTERNAL", line 537
ORA-06512: at "SYS.DBMS_SWRF_REPORT_INTERNAL", line 387
ORA-06512: at "SYS.DBMS_SWRF_REPORT_INTERNAL", line 339
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 222
解决:
16:20:16 SQL> select owner,object_name,object_type,status from dba_objects where wner='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.
还是不行:
最后在网上找到如下的描述:
()
This issue is resolved in 10.2 and 10.1.0.4.
It is due to bug: 3697914
Details: The "awrrpt" script. fails (ORA-6502) for over 4000 characters long.
Workaround:
update WRH$_SQLTEXT set sql_text = SUBSTR(sql_text, 1, 1000);
commit;
终于解决!