Error
=====
BEGIN
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [qosdExpStatRead: expcnt mismatch], [], [], [], [], [], [], [], [], [], [], []
ORA-06512: at “SYS.DBMS_STATS”, line 1976
ORA-06512: at “SYS.DBMS_STATS”, line 37879
ORA-06512: at “SYS.DBMS_STATS”, line 38209
ORA-06512: at “SYS.DBMS_STATS”, line 38287
ORA-06512: at line 2
As per oracle support It is a bug
workaround
==========
1. Ensure that you have taken a backup of your system before applying the recommended solution.
2. fix issue data.
sqlplus / as sysdba
alter session set container=<container_name>; — use this command in case your database is using CDB & PDB architecture, otherwise move directly to the next command
With b as ( select count(*) cnt,objn,snapshot_id from sys.exp_stat$ es group by objn,snapshot_id) select * from sys.exp_obj$ a, b where a.objn=b.objn and a.snapshot_id=b.snapshot_id and a.EXP_CNT<>b.CNT;
update sys.exp_obj$ a set exp_cnt=(select count(*) from sys.exp_stat$ b where a.objn=b.objn and a.snapshot_id=b.snapshot_id ) where a.objn=<objn>; commit;
3. Once the scripts complete, confirm that the data is corrected. (no issue data return)
You can use the same SQL to confirm:
With b as ( select count(*) cnt,objn,snapshot_id from sys.exp_stat$ es group by objn,snapshot_id) select * from sys.exp_obj$ a, b where a.objn=b.objn and a.snapshot_id=b.snapshot_id and a.EXP_CNT<>b.CNT;