insert into table1 select col1 as a ,col2 as b.....(100多个字段) from table2
如何插入会速度快一些,
现在table2中有10万多数据,插入速度太慢,
有没有更好的解决办法?各位兄弟帮忙

解决方案 »

  1.   

    insert /*+append */ into table1 select col1 as a ,col2 as b.....(100多个字段) from table2;
      

  2.   

    不懂hint不知道1楼的方法怎么样,你试试要不就分批插入
      

  3.   

     insert  /*+append */ into  emp nologging 
     select * from emp 
      

  4.   

    1、使用append本质:使用直接路径方式,直接在高水位后直接格式化空块,减少搜索空闲块的时间,并减少redo生成,提高插入速度。
    2、使用nologging本质:减少重做日志成生成,提高插入速度。但要注意数据是否处于归档模式的影响:
    1. 不管哪种模式下append要与nologging方式联用才能达到很好的效果。
    2. 非归档与归档方式,只用NOLOGGING是不起效果的。
    3. 非归档下append已达到不错的效果,但不及与nologging的联用方式。
    4. 归档下单append起不到效果。另外,如果情况允许的话,create table加上表重命名的方式也可以加快速度。
    create table table2 as select ...;
    rename table table1 to table3;
    rename table table2 to table1;
      

  5.   

    /*+append */
    子查询直接装载 效率高