sys 账号密码 oracleOracle创建索引策略

  学习Oracle时,经常会遇到Oracle索引问题,这里将介绍Oracle索引问题的解决方法。Ororacle账号acle索引和对应的表应该位于不同的表空间中,Oracle能够并行读取位于不同硬盘上的数据,可以避免产生I/O冲突B树索引:在B树的叶节点中存储索引字段的值与ROWID.唯一索引和不唯一索引都只是针对B树索引而言。Oracle最多允许包含32个字段的复合索引
    Oracle索引创建策略
    1.导入数据后再创建索引
    2.不需要为很小的表创建索引
    3.对于取值范围很小的字段(比如性别字段)应当建立位图索引
    4.限制表中的索引的数目
    5.为索引设置合适的PCTFREE值
    6.存储索引的表空间最好单独设定
    创建不唯一索引
    1. create index emp_ename on employees(ename)
    2. tablespace users
    3. storage(……)
    4. pctfree 0;
    创建唯一索引
    1. create unique index emp_email on employees(email)
    2. tablespace users;
    创建位图索引
    1. create bitmap index emp_sex on employees(sex)
    2. tablespace users;
    创建反序索引
    1. create unique index order_reinx on orders(order_num,order_date)
    2. tablespace users
    3. reverse;
    创建函数索引(函数索引即可以是普通的B树索引,也可以是位图索引)
    1. create index emp_substr_empno
    2. on employees(substr(empno,1,2))
    3. tablespace users;
    以上介绍Oracle索引创建策略。

此条目发表在oracle metalink账号分类目录,贴了标签。将固定链接加入收藏夹。