Statspack ORA-00001 Bug

本文记录了一次在Oracle 9.2.0.8版本中遇到的性能统计错误,包括详细的错误日志与解决步骤。文章指出,在特定条件下,如设置cursor_sharing为similar或force时,可能会触发此错误,并提供了禁用约束、创建视图等解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

From alert log :

< ORA-12012: error on auto execute of job 1 < ORA-00001: unique constraint (PERFSTAT.STATS$SQL_SUMMARY_PK) violated < ORA-06512: at "PERFSTAT.STATSPACK", line 1361 < ORA-06512: at "PERFSTAT.STATSPACK", line 2471 < ORA-06512: at "PERFSTAT.STATSPACK", line 91 < ORA-06512: at line 1

environment : Redhat AS4 , oracle9208

Bug number : 2784796

1.ALTER TABLE PERFSTAT.STATS$SQL_SUMMARY MODIFY CONSTRAINT STATS$SQL_SUMMARY_PK DISABLE NOVALIDATE;

or

2.sqlplus " / as sysdba"
SQL> spool run_statspack.txt

SQL> create or replace view STATS$V_$SQLXS as
select max(sql_text) sql_text
, sum(sharable_mem) sharable_mem
, sum(sorts) sorts
, min(module) module
, sum(loaded_versions) loaded_versions
, sum(fetches) fetches
, sum(executions) executions
, sum(loads) loads
, sum(invalidations) invalidations
, sum(parse_calls) parse_calls
, sum(disk_reads) disk_reads
, sum(buffer_gets) buffer_gets
, sum(rows_processed) rows_processed
, max(command_type) command_type
, address address
, hash_value hash_value
, count(1) version_count
, sum(cpu_time) cpu_time
, sum(elapsed_time) elapsed_time
, max(outline_sid) outline_sid
, max(outline_category) outline_category
, max(is_obsolete) is_obsolete
, max(child_latch) child_latch
from v$sql
where ( plan_hash_value > 0 or executions > 0 or parse_calls > 0 or disk_reads > 0 or buffer_gets > 0)
group by hash_value, address;
SQL> select owner,object_name from dba_objects where status ='INVALID';
SQL> @?/rdbms/admin/utlrp.sql
SQL> select owner,object_name from dba_objects where status ='INVALID';
conn perfstat/perfstat_password execute
SQL> statspack.snap(i_snap_level=>5); spool off;

If cursor_sharing = similar or force, may cause the bug ,will be fixed in 10g.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10897379/viewspace-989158/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10897379/viewspace-989158/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值