Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Views dropped

user545194Jan 25 2021

Env: Oracle 11g SE on Windows Server.
We dropped a number of views in a specific schema:
drop view schema_name.view_name;
So far, so good. We noticed that the views were dropped in another schema as well.
How could this have happened?

This post has been answered by user545194 on Jan 25 2021
Jump to Answer

Comments

John Stegeman

Rarely, if ever.

Sachin Thapa

below two are the conditions when we rebuild indexes

1)     If the index has height greater than four, rebuild the index.

2)     The deleted leaf rows should be less than 20%.



cheers,

Sachin

AndrewSayer

934697aa-8735-4679-af67-dc6ad208430a wrote:

when should i rebuild db indexes.. we do it on a scheduled intervals. i would like some recommendations for when to rebuild db indexes

When it rains on the first Monday of the month.(is that when you flush the shared pool?)

But seriously most indexes will NEVER benefit from rebuilding. If you find rebuilding an index on a schedule is benefiting you then you probably have a design problem.

read about the truth in Richard Foote's presentation https://richardfoote.wordpress.com/2007/12/11/index-internals-rebuilding-the-truth/ Richard Foote is widely considered the expert in this field.

Jonathan Lewis

Sachin,

Please resist the temptation to recite this piece of stupidity in the future; and if you can't resist the temptation, kindly justify the claim and don't forget to highlight when your suggestions might be particularly counter-productive.

Regards

Jonathan Lewis

top.gun

As almost everyone has said - the short answer is no.

3218565

Hi, If your table frequently dml transaction happening mean you can do rebuild index

example -deletion once you rebuild your index you get back deleted record space.

John Stegeman

... until you insert and delete more rows, and you're right back where you started, after having done lots of extra work.

Sachin Thapa

Hi Jonathan,

Kindly forgive me if I am wrong,  that is what I read , could you please correct me, i'll be highly thankful to you,

Identifying which Oracle Indexes to Rebuild

I mean no disrespect I just want you to correct me as I am an entry level DBA, so that I can learn from your experience

Regards,

Sachin

John Stegeman

Sachin, a lot of people disagree violently with many things on that site.

As others have said in this thread - there is rarely a benefit to rebuilding indexes, certainly I would NEVER be rebuilding indexes on a schedule. About the only instance I can think of where I might consider rebuilding an index is if I had a situation where a table grew to have lots and lots of rows and then lots and lots of rows were PERMANENTLY deleted - say if you had a table that you were supposed to be purging every month and you forgot to for 10 years. In such a case, you are permanently and forever shrinking the table and the index, so there may be a benefit to shrinking the space.

Sachin Thapa

Thanks John,

I'll go through the link that you have provided.

https://richardfoote.files.wordpress.com/2007/12/index-internals-rebuilding-the-truth.pdf

Regards,

Sachin

John Stegeman

I didn't provide a link.

dthrashtaconecom

Here's a note on MOS that echos the advice given by the high ranking experts above:  Index Rebuild, the Need vs the Implications (Doc ID 989093.1).


And here's another note on MOS that supports Mr. Foote's expertise on this subject: bde_rebuild.sql - Validates and rebuilds indexes occupying more space than needed (Doc ID 182699.1).  Be sure to read the comments in the script starting with "Before you proceed to rebuild your indexes, please read the following extract from feedback provided by Richard Foote on October 2003:"

Good luck,

David R. Thrash

Jonathan Lewis

Sachin,

It's been several years since I went through the process of highlighting the errors in answers (which often were little more than links to his multiple websites) that Don Burleson supplied to this forum, and I really can't face the thought of dissecting the stuff he writes any more. I did, however, look at the link you supplied - and the only thing I'll say about it is that it reference 4 Doc IDs from Metalink (MoS):

77574.1     This doesn't exist anymore, because in the feedback box I suggested to Oracle that it be withdrawn because the advice was so bad (I explained what was wrong with it at the time)

122008.1     I also suggested to Oracle that they withdraw this one too for the same reasons - it did disappear temporarily, then reappeared and if you read it you will find that it says "The advice we used to give is no longer valid, and generally you don't need to rebuild indexes. It also links to the other two notes referenced by the Burleson page.  Here's a link to a comment I made on OTN in 2008 where I pointed out that these two notes had been withdrawn:

989186.1    This is basically a script that does some arithmetic based on the current stats on b-tree indexes to give you an idea of how big your indexes would be if you rebuilt them so that you can get an idea of (a) how much space you could reclaim in the database and (b) whether an index might be so much larger than it needs to be that you should investigate why it has got so large and (probably) rebuild it at least once.  (The code is largely some stuff I wrotre a few years ago with some wrapping to capture the results to a table, see: https://jonathanlewis.wordpress.com/index-efficiency-3/ and https://jonathanlewis.wordpress.com/index-sizing/ )

989093.1     This is a note that explains why you rarely need to rebuild B-tree indexes - when it first appeared I think it was part of the "new" 122008.1 with an acknowledgment to Richard Foote who wasn't an employee at the time.

Bottom line - whatever the article may have said, the (surviving) MoS notes in the links don't agree with it.

Regards

Jonathan Lewis

Martin Preiss

personally I tend to rebuild indexes if they are in an unusable state.

I heard that in some situations it may be useful to tell the end users that you did a rebuild without actually doing something. This approach is known as "Faith-based Tuning" - https://richardfoote.wordpress.com/2011/04/20/blks_gets_per_access-index-rebuild-criteria-twisted-logic/#comment-12417.

1 - 15

Post Details

Added on Jan 25 2021
10 comments
126 views