数据迁移10.数据库优化

  1. alter 表 truncate 分区 要加上update indexes
    不然会丢失索引.
    2,如果索引丢失 需要rebuild重建索引
    先查询未被使用的索引unusable, 也就是失效索引,再重建
select * from user_indexes where status='UNUSABLE';
alter index 索引名 rebuild;

3,创建索引& 删除索引

create index 所有者名称.索引名 on 表名(项目1名称,项目2名称)  tablespace 表空间名称
        ----表空间名称可以参考其他的索引所使用的名称
        ----如果所有者名称也就是用户只有一个,可以直接写索引名
drop index 索引名

4.查询时用parelle,并行查询,加快速度

猜你喜欢

转载自blog.csdn.net/ademen/article/details/84647852