如果我建了一个足够大的表空间,如果在现有基础上提高Oracle的插入速度?比如:我现在向Oracle插入1W条数据用了0.23秒,如何在现有基础上提高之?一百万条呢?

解决方案 »

  1.   

    如果有相關的索引,先禁用索引,然後再insert,最後重建索引
      

  2.   


    1、alter table tb nologging  --若是归档模式下,将表设置为不记录日志
    2、drop index index_name.....--若表上有index,先删除表上的index
    3、insert /*+append*/ into tb ..... --执行插入
    4、create index index_name on .....--重建index
    5、alter table tb logging  --回复日志记录功能
      

  3.   

    把表设置为nologging 
    alter table tbname nologging  不写入日志 
    禁用索引 插入是要用到索引 alter index idx_name unusable
    insert /*+ append*/ into tbname ....
    完毕在
    重建索引
    alter index idx_name rebuild
      

  4.   


    关键是现在我在Hibernate中(或者Spring中)执行插入操作,那么您所说的那些操作好像不能在程序中进行吧?那应该如何做呢?非常感谢!
      

  5.   


    关键是现在我在Hibernate中(或者Spring中)执行插入操作,那么您所说的那些操作好像不能在程序中进行吧?那应该如何做呢?非常感谢!
      

  6.   

    你程序都会写insert语句,那么为什么不能写alter\drop 语句啊
    或者直接将其包装到一个过程中,hibernate直接执行过程就ok 了
      

  7.   

    insert /*+ APPEND NOLOGGING */  into ta
    select * from tb
      

  8.   


    insert /*+ APPEND NOLOGGING */ into ta
    select * from tb
    这句代码的作用是不是单纯的禁用日志?