This discussion is archived
1 2 3 7 Previous Next 92 Replies Latest reply: Nov 27, 2009 12:11 AM by Hemant K Chitale RSS

corrupted indexes

ski123 Newbie
Currently Being Moderated
Oracle 9.2. We have a job running slow suddenly. Normal run time is 2 hours, now it is 6 hours. The data volume is the same. we are wondering if the indexes is corrupted. How to find corrupted indexes?
Thanks

S.
  • 1. Re: corrupted indexes
    Justin Cave Oracle ACE
    Currently Being Moderated
    Unless there is a pile of information that allowed you to conclude that a slow process was the result of a corrupt index, I would strongly suspect that you don't have a corrupt index. Or if you do, that it is unrelated to your performance problem.

    Let's start at the beginning-- why is the process slow?
    - Do you have a trace of the session or a statspack report from a good run and from a slow run? What are the differences?
    - What is the job doing?
    - Did any query plans change?
    - What is taking up most of the 6 hours the process is running?

    Justin
  • 2. Re: corrupted indexes
    Anurag Tibrewal Guru
    Currently Being Moderated
    Hi,


    Before doing this I would have always checked whether the explain plan it is taking is the best explain plain, and there are no waits for the session which has slowed down.

    Then only I would have followed Oracle MetaLink note 122008.1 to rebuild the index
    Regards
    Anurag Tibrewal
  • 3. Re: corrupted indexes
    ski123 Newbie
    Currently Being Moderated
    Thank you very much. I am looking at stats report.
    S.
  • 4. Re: corrupted indexes
    164995 Newbie
    Currently Being Moderated
    Run AWR and get the last AWR Report when it was good / bad.

    Look at top 5 events, identify the sql's during good / bad times. If SQL's are executing at the same speed then problem lies somewhere else.

    Such a drastic slowdown is probably external to the Database.

    Was there any change environmental or otherwise. Any stats change ?
  • 5. Re: corrupted indexes
    311441 Employee ACE
    Currently Being Moderated
    Hi Anurag

    Interestingly, I mention Metalink Note 122008 a number of times in my Index Seminar as a perfect example of how not+ to determine when to rebuild an index.

    Thankfully, Oracle have pulled the error filled note from Metalink and with a bit of luck, it will never resurface again to confuse folk.

    Cheers

    Richard Foote
    http://richardfoote.wordpress.com/
  • 6. Re: corrupted indexes
    mbobak Oracle ACE
    Currently Being Moderated
    Hi Richard,

    Speaking of index rebuilds and MetaLink notes, have you seen note #182699.1?

    I ask because you are quoted in that note....

    -Mark
  • 7. Re: corrupted indexes
    108476 Journeyer
    Currently Being Moderated
    Hi Richard,
    I mention Metalink Note 122008 a number of times in my Index Seminar as a perfect example of how not to determine when to rebuild an index.
    Why do you diss the Oracle documentation, and then fail to show the OP a method that does work?

    That's not very helpful!

    In many cases, evaluating an index for rebuilding is a waste of time.

    It can take more reources to evaluate whether an index needs rebuilding than to actually rebuild it! Done properly, index rebuilding is 100% safe, and recommended by Oracle Corporation. . . .

    http://www.dba-oracle.com/art_index1.htm

    Oracle's index rebuilding guidelines appear in Metalink note 77574.1 (dated April 2007) recommends that indexes be periodically examined to see if they are candidates for an index rebuild:

    “When an index is skewed, parts of an index are accessed more frequently than others. As a result, disk contention may occur, creating a bottleneck in performance.

    It is important to periodically examine your indexes to determine if they have become skewed and might need to be rebuilt.”

    Thankfully, Oracle have pulled the error filled note from Metalink
    Interestingly, Oracle DBA Jim Spath has shown that regular rebuilding of high DML indexes should be scheduled on a regular basis:

    https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8750%3Fpage%3Dlast

    “This index should be reorganized on a regular basis. . .

    What is happening here is the index is becoming unbalanced through constant inserts and deletes.

    Over time, the space the index occupies will continue to grow though there may be zero rows at the time the system starts and stops.

    Each deleted row continues to occupy space in the index segment until a rebuild is done.”
  • 8. Re: corrupted indexes
    sybrand_b Guru
    Currently Being Moderated
    Sorry.
    Oracle indices are B*-tree indices.
    By design they can not become unbalanced. EVER!

    --------------
    Sybrand Bakker
    Senior Oracle DBA
  • 9. Re: corrupted indexes
    108476 Journeyer
    Currently Being Moderated
    By design they can not become unbalanced. EVER!
    It depends on how you define "unbalanced"!

    When Oracle does a logical delete of a leaf node, the "logical" structire of the b-tree is out of balance.
  • 10. Re: corrupted indexes
    311441 Employee ACE
    Currently Being Moderated
    Hi Sybrand

    Suggesting that "Each deleted row continues to occupy space in the index segment until a rebuild is done” is of course not correct in most cases either as most deleted space is automatically reclaimed and reused by Oracle.

    You can only lead a horse to water ... ;)

    Cheers

    Richard Foote
    http://richardfoote.wordpress.com/
  • 11. Re: corrupted indexes
    sybrand_b Guru
    Currently Being Moderated
    The structure of the B*-tree is NEVER out of balance.
    It is simply impossible!!!

    -----------
    Sybrand Bakker
    Senior Oracle DBA
  • 12. Re: corrupted indexes
    mbobak Oracle ACE
    Currently Being Moderated
    burleson wrote:
    By design they can not become unbalanced. EVER!
    It depends on how you define "unbalanced"!

    When Oracle does a logical delete of a leaf node, the "logical" structire of the b-tree is out of balance.
    Don,

    You're absolutely right that we should define what we mean by "balanced". In my view, "balanced" means that the number of "hops" from the root block to any leaf block is always the same. In other words, it's not possible to do an index look up on "Burleson" and go root->branch-leaf containing "Bujrleson" but look up "Foote" and go root->branch->branch->leaf containing "Foote".

    Based on that definition of "balanced", Sybrand is correct.

    If you have an alternate definition of "balanced", please clarify it.

    Thanks,

    -Mark
  • 13. Re: corrupted indexes
    311441 Employee ACE
    Currently Being Moderated
    Hi Mark

    Yes, I was asked many years ago by Oracle Support to write a few words to try and clarify why most indexes don't actually need to be rebuilt as Oracle automatically manages things perfectly OK in most scenarios.

    Probably a note that could go as well :)

    Cheers

    Richard Foote
    http://richardfoote.wordpress.com/
  • 14. Re: corrupted indexes
    mbobak Oracle ACE
    Currently Being Moderated
    Heh...you know, I sort of had the same thought...."Hmm....nice that Richard wrote that note, he summarizes the issues very succinctly....problem is, I'm guessing people will skim right over them and get on with the script!" :-)

    -Mark
1 2 3 7 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points