本帖最后由 houyizhinv 于 2012-01-11 12:04:53 编辑

解决方案 »

  1.   

    建议调整语法为:
    inset into tb_a
    select b.m,c.n
    from tb_b b,tb_c
    where b.id=c.id
    查询时左连是不会影响速度,但是插入时就会明显的降低效率
      

  2.   

    是很奇怪,400条数据写入要几分钟,如果只是IO问题,那IO得多慢啊。
      

  3.   

    可是 这个用别的机器DBLINK的话 只需要10秒
    =======================================
    在02机器上运行
    insert into tb_a
    select b.m,c.n
    tb_b@dblink01 b
    left join 
    tb_c@dblink01 c
    ......
    where
    .....
      

  4.   

    看下表tb_a所在的表空间是不是满了,自动扩展很慢造成的呢?
      

  5.   

    问题补充:
    将查询出来的结果COPY出来放到另外一张TB_TEMP表
    然后
    insert into tb_a 
    select * from TB_TEMP;
    commit;
    时间不到1秒。
      

  6.   

    确认一下你的table_a 是不是被别人锁定了select * from v$session t1,v$locked_object t2,user_objects t3
    where t1.sid=t2.session_id
      and t2.object_id = t3.object_id;--因为 当表A被人锁定后,别人是不能插入数据的,除非那人解锁
    --你可以试试
    --1、加锁 排他锁 和 共享锁 都可以
    lock table table_a in Exclusive mode; --排他锁
    lock table table_a in share mode; --共享锁--2、新打开一个窗口执行插入,这个窗口会挂住,除非你在第一个窗口 commit 和 rollback 解锁。
      

  7.   

    实在是没办法了,请问,这个跟ORACLE的配置有没有关系,因为这个语句之前一致都没有出过问题,今天突然出现的。
      

  8.   

    insert into/*APPEND*/ tb_a NOLOGGING
    select b.m,c.n
    tb_b b
    left join 
    tb_c c
    ......
    where
    .....
      

  9.   

    insert into/*APPEND*/ tb_a NOLOGGING
    select b.m,c.n
    tb_b b
    left join 
    tb_c c
    ......
    where
    .....
      

  10.   


    insert /*+APPEND*/ into tb_a 
    select b.m,c.n
    tb_b b
    left join
    tb_c c
    ......
    where
    .....