[bbk2863] 第54集 - Chapter 13-Using Oracle Blokcs Efficeintly[03]
2013-05-08 18:37
429 查看
Index Reorganization
Indexes on volatile tables are a performance problem.Only entirely empty index blocks go to the free list.
If a block contains only one entry,it must be maintained.
You may need to rebuild indexes.
Monitoring Indexes Space
To collect usage statistics regarding an index:(搜集索引的相关数据)SQL>EXECUTE dbms_stats.gather_index_stats('OE','CUSTOMER_PK');
To view statistics collected:
SQL> select name,(del_lf_rows_len/lf_rows_len) * 100 as wastage from index_stats;
Rebuild indexes with wastage greater than 20%:(推到重建)
SQL>ALTER INDEX oe.customers_pk REBUILD;
To coalesce indexes(alternative to REBUILD):(小修小补)
SQL>ALTER INDEX oe.customers_pk COALESCE;
何时需要重新构建索引?
假如有一列主键索引,自动增长的,100多万条数据,其中20多万被删除了,索引也就无效了,这个时候可以判定这被删除的20多万条索引,以后将永远不会被使用了,此时就可以进行重新rebuild;如果某些情况下的索引,即使记录被删除了,索引部分任然可以重复利用,则就不需要再重新构建.
Index Coalesce
![](http://images.cnitblog.com/blog/110033/201305/08180115-f5eaac549f3c443f932bad7f7c4cb150.jpg)
Guidelines
![](http://images.cnitblog.com/blog/110033/201305/08180817-963a3f6ae99748dd8f397972d4531828.jpg)
rebuild index 加速方法
1、通过并行方式处理,来增加几个进程,加快rebuild index 的速度.
2、nologing方式,增加rebuild index 的速度.
Monitoring Index usage
Gathering statistics using an Oracle supplied package:关于监控索引的使用情况,我们主要使用到的方法:
SQL>EXECUTE dbms_stats.gather_index_stats('HR','LOC_COUNTRY_IX');
SQL>ANALYZE TABLE HR.Employees COMPUTE STATISTICS;
Gathering statistics at index creation:
在创建Index时,添加COMPUTE STATISTICS已经基本过时了,现在的Oracle版本基本上都是默认支持;
SQL>CREATE INDEX hr.loc_country_ix ............................ COMPUTE STATISTICS;
Gathering statistics when rebuilding an index:
在创建Index时,添加COMPUTE STATISTICS已经基本过时了,现在的Oracle版本基本上都是默认支持;
SQL>ALTER INDEX hr.loc_country_ix REBUILD COMPUTE STATISTICS;
Identifying Unused Indexes
To start monitoring the usage of an index:SQL>ALTER INDEX hr.emp_name_ix MONITORING USAGE;
To query the usage of the index:
SQL>SELECT index_name,used FROM v$object_usage;
To stop monitoring the usage of an index:
SQL>ALTER INDEX hr.emp_name_ix NOMONITORING USAGE;
Summary
In this lesson,you should have learned to do the following:Use automatic segment space management
Use manual segment space management
-Manage extents and Oracle blocks
-Ensuring effective use of space
-Determine the high-water mark
Describe the use of Oracle Block parameters
Recover space from sparsely populated segments
Describe and detect chaining and migration of Oracle blocks
Perform index reorganization
相关文章推荐
- [bbk2668] 第53集 - Chapter 13-Using Oracle Blokcs Efficeintly[02]
- [bbk2515] 第51集 - Chapter 13-Using Oracle Blokcs Efficeintly[00]
- [bbk2516] 第52集 - Chapter 13-Using Oracle Blokcs Efficeintly[01]
- [bbk2863] 第54集 - Chapter 14-Using Oracle Dasta Storage Structures Efficiently(00)
- [bbk2901] 第57集 - Chapter 14-Using Oracle Dasta Storage Structures Efficiently(03)
- Expert One-on-One Oracle Chapter 13 物化视图 读书笔记(1)
- [bbk3016] 第59集 - Chapter 14-Using Oracle Dasta Storage Structures Efficiently(05)
- [using_microsoft_infopath_2010]Chapter13 SharePoint视图和控制板
- Expert One-on-One Oracle Chapter 13 物化视图 读书笔记(3)
- [bbk2864] 第55集 - Chapter 14-Using Oracle Dasta Storage Structures Efficiently(01)
- Expert One-on-One Oracle Chapter 13 物化视图 读书笔记(2)
- Expert One-on-One Oracle Chapter 13 物化视图 读书笔记(4)
- 第06讲:Chapter 03--Managing an Oracle Instance
- ORACLE学习笔记:Chapter 03--Oracle Architectural Components
- 第08、09讲:Chapter 03--Managing an Oracle Instance.swf
- 第10讲:Chapter 03--Managing an Oracle Instance
- 第11、12讲:Chapter 03--Managing an Oracle Instance
- [bbk2900] 第56集 - Chapter 14-Using Oracle Dasta Storage Structures Efficiently(02)
- [bbk2902] 第58集 - Chapter 14-Using Oracle Dasta Storage Structures Efficiently(04)
- Tuning 13 Using oracle blocks Efficiently