0

So I recently updated an Oracle Database 10g from 10.2.0.3.0 to 10.2.0.4.0, as advised by Oracle Support, due to stability issues (a known issue under some systems where the instance would freeze randomly under high load).

After applying the patch, stability problems are gone, but queries are A LOT slower because there are constant FULL SCANS on tables, even though I recalculated statistics for all tables in all schemas and the indexes are apparently OK. I also set the optimizer version value to the previous one (this was advised by Oracle Support too), but it hasn't improved so far.

Any ideas on this?

3
  • What does Oracle support have to say about this issue?
    – jscott
    Apr 26, 2012 at 23:40
  • They made me drop & recalculate statistics of two tables (not the only ones, but as an example) that are affected by this issue. I also rebuilt the indexes. However, the execution plan is still the same. It just skips the index and proceeds to a full scan, as if it had less cost. I updated the ticked and I am waiting for an answer now.
    – Joan Serra
    Apr 27, 2012 at 15:49
  • I have also set optimizer_features_enable value back to 10.2.0.3.0
    – Joan Serra
    Apr 30, 2012 at 15:35

2 Answers 2

0

Finally it looks like the problem was caused by poorly optimized SQL. Also it seems like the instance only did full scans only when the cost of these was inferior to the cost of an index scan, so everything is apparently OK.

0

I run the following sql to schedule a job to run stats on stale tables every 2 hours. This prevents a lot of sql queries from going bad in 10g and 11g. If the table has not had more than 10% of the rows modified, then the runnning of stats will be skipped until 10% or more of the rows have been modified.

-- YOu must commit when you are finished to add the line to sys.job$/dba_jobs
-- You must run this as sys to get the jobs to run as sys to get the correct path to run the job
variable jobno number;
variable instno number;
begin
  select max(job)+1 into :jobno from dba_jobs;
  select instance_number into :instno from v$instance;
  dbms_job.submit(:jobno,
'dbms_stats.gather_database_stats(options=>''gather stale'',estimate_percent=>100,degree=>4,cascade=>true);',
trunc(sysdate)+15/24, 'sysdate+2/24',
 TRUE, :instno);
end;
/
commit;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .