如果要做这种操作,当初设计数据库时,我就会在table1中建好触发器,每当有数据插入时,将数据同时插入table2.

解决方案 »

  1.   

    insert into table2(column1,column2...) select column1,column2... from table1
      

  2.   

    方法一:使用oracle中包含在注释中的提示信息
    insert /*+append*/ into ...nologing
    select * from ...方法二:使用批量拷贝方法
    set arraysize 20
    set copycommit 5000
    copy from username/password@oracle_name append table_name1 
    using select * from table_name2;实际效果,方法一要比方法二速度还要快些
      

  3.   

    如果用
    insert into table2(column1,column2...) select column1,column2... from table1
    这个方法的话.
    首先要保证你的回滚段要足够大.
    建议你用游标.
      

  4.   

    不用会滚段吧?你把table2的事务日志停掉就可以了,呵呵,就是alter 和nologging阿。