重建索引 oracle 10G
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/391618/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
rebuild indexes oracle 10G
提问by Onegin
When i need run process for rebuild indexes and how i can know what indexes i need to rebuild ?
当我需要运行重建索引的过程时,我如何知道我需要重建哪些索引?
回答by tuinstoel
Read here http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2913600659112about rebuilding indexes. Rebuilding bitmap indexes is ok, but btree indexes not so.
在此处阅读有关重建索引的http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2913600659112。重建位图索引是可以的,但 btree 索引不是这样。
回答by zendar
In general, indexes and tables should be rebuilt when they become too fragmented.
In practice, you probably will not have need to do it with Oracle 10g. Fragmentation occurs on tables and indexes with lots of changes to structure (adding/removing columns) and lots of data changes (insert, update, delete).
From v10, Oracle have number of automated processes that take care about database performance. One of them is "Segment advisor" that runs automatically.
If this is full version of Oracle 10g (not express), then you have database manager dashboard.
There you will find "Advisor central" where you can find maintenance information for each part of Oracle.
Among other, there is "Segment advisor" report where you can find recommendations for performance improvement. There you can select recommended actions and tell Oracle to do it.
一般来说,当索引和表变得过于碎片化时,应该重建它们。
在实践中,您可能不需要使用 Oracle 10g 执行此操作。碎片发生在表和索引上,对结构进行了大量更改(添加/删除列)和大量数据更改(插入、更新、删除)。
从 v10 开始,Oracle 拥有许多关注数据库性能的自动化进程。其中之一是自动运行的“段顾问”。
如果这是 Oracle 10g 的完整版本(不是 express),那么您就有了数据库管理器仪表板。
在那里您会找到“顾问中心”,您可以在其中找到 Oracle 各个部分的维护信息。
其中,有“Segment advisor”报告,您可以在其中找到性能改进的建议。在那里您可以选择推荐的操作并告诉 Oracle 执行此操作。
If you are suspicious about performance on some table or index, you can execute analysis on demand and you will get recommendation if table or indexes should be rebuilt.
如果您对某些表或索引的性能存疑,您可以按需执行分析,您将获得是否应重建表或索引的建议。
You can check it daily if you have large databases with lots of users and lots of changes.
如果您有包含大量用户和大量更改的大型数据库,您可以每天检查它。
回答by David Aldridge
Regular rebuilding of indexes is a religion that many adhere to but which few can justify. Almost every case made for it is faulty, generally because it has unintended side-effects such as increasing the subsequent system load due to block splits as the index returns to it's natural state of sparsity.
定期重建索引是许多人信奉的宗教,但很少有人能证明这一点。几乎所有针对它的案例都是错误的,通常是因为它具有意想不到的副作用,例如随着索引恢复到自然的稀疏状态,由于块拆分而增加了后续系统负载。
Before even thinking about rebuilding indexes you should first research how indexes work, how entries are made and removed, and the effect on performance of having compact or sparse indexes -- it is not hard to find this information through Google.
在考虑重建索引之前,您应该首先研究索引是如何工作的,如何创建和删除条目,以及拥有紧凑或稀疏索引对性能的影响——通过谷歌不难找到这些信息。
Also consider a coalesce operation instead of a rebuild.
还要考虑合并操作而不是重建。