Oracle 2个登录用户 一个复制到另一个表中,复制其中的数据

解决方案 »

  1.   

    建立数据链。insert into B select * from A@db_link
      

  2.   

    一个库两个用户而已,要什么数据连接啊?
    直接将表赋权给另一用户,就可以直接 inser into select
      

  3.   

    insert into user_b.tab_x 
    select * 
      from user_a.tab_x
    ;
      

  4.   

    在sqlplus里用copy命令可以实现
    SQL> conn scott_test/tiger@orcl;
    Connected.
    SQL> select * from emp;no rows selectedSQL> copy from scott/tiger@orcl to scott_test/tiger@orcl insert emp using select
     * from emp;Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
       14 rows selected from scott@orcl.
       14 rows inserted into EMP.
       14 rows committed into EMP at [email protected]> select count(*) from emp;  COUNT(*)
    ----------
            14