oracle中使用函数索引FBI
作者:罗代均 http://hi.baidu.com/luodaijun/
使用基于函数的索引(FBI)时,需要先设置初始化参数query_rewrite_enabled=TRUE(默认为false)
该参数在init.ora里设置,以oracle 9i2为例,init.ora文件路径为D:\oracle\admin\mydb\pfile,我这里把oracle装在D盘,mydb是我的数据库.
--顺便说说,创建函数索引的方法
有表employee,包含3个字段 id, op-date, qty , 这里我们需要汇总op_date每个月的数据
select to-char(op_date,'YYYY-MM') mon,sum(qty)
from employee
group by to-char(op_date,'YYYY-MM')
由于在op_date上使用了to_char函数,所以不能使用索引
下面创建FBI基于函数的索引
create index idx_employee_opdate on employee(to_char(op_date,'YYYY-MM'))
ok,现在就可以使用索引
顺便说句,使用索引,在很多情况下不是查询数据最快的方法,
索引查找,每次读一个数据块,而全表扫描,每次读多个数据块,这样可以减少磁盘i/o
相信CBO,慎用索引
相关文档:
oracle表空间操作详解
1
2
3作者: 来源: 更新日期:2006-01-04
5
6
7建立表空间
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
今天复习第三章,本来算起来应该是第二章的,但是第二章的内容是介绍数据库的管理工具,而对于我们而言,这些相对来说没有多大的必要,所以,现在步入复习Oracle实例的管理。这章的内容包括初始化参数文件的维护和管理,以各种不同的方式启动和概念比数据库Oracle Instance,以及对Oracle I ......
1. Read the Data Block.
2. Read the Row Header.
3. Check the Lock Byte to determine whether there's an ITL entry.
4. Read the ITL entry to determine the Transaction ID (Xid).
5. Read the Transaction Table using the Transaction ID. If the transaction has been committed and has a System Commit ......
如何远程判断Oracle数据库的安装平台
select * from v$version;
查看表空间的使用情况
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_name;
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
(B.BYTES*100)/A.BYTES "% USED",(C.BYTES ......
原文地址:http://blog.csdn.net/fengyun14/archive/2007/03/25/1540433.aspx
关于Linux 下kernel.shmmax 的设置问题
下面是Oracle 文档上的解释, http://download-west.oracle.com/doc...e.htm#sthref107
SHMMAX Available physical memory Defines the maximum allowable size of one shared memory segment.
The ......