2个用户有相同的表结构,相同的权限等等,只把USER1的表的数据导入USER2,急急急不可待,在线等啊 ~~

解决方案 »

  1.   

    insert into user1.tb(c1,c2)
    select c1,c2 from user2.tb
      

  2.   

    insert into user1.tb(c1,c2) select c1,c2 from user2.tb;commit;
      

  3.   

    要是把USER1的所有的表的数据都导入USER2呢? 上面的语句写完整了吗?
      

  4.   

    上面的语句可以把表里的数据都拷过去了啊,可能要在user2的用户下先grant一下:
    grant select on t2 to user1;
      

  5.   

    用imp 命令可以实现不同用户之间导入,imp 用户名/密码@实例名 file=导出用户1的文件 fromuser=user1 touser=user2
      

  6.   

    IMP 不行,要DBA才能导出,现在是问普通用户的数据复制
      

  7.   

    insert into user1.tb(c1,c2)
    select c1,c2 from user2.tb这个不行啊
      

  8.   

    insert into User1.TB 
    Select * From User2.TB他们的表不会超过20个吧???
      

  9.   

    现在USER2登陆,怎么把USER1的A表的数据导到USER2的A表内?
    或者说USER3登陆,怎么把把USER1的A表的数据导到USER2的A表内?
    我指的是在SQL PLUS下的语句 啊~
      

  10.   

    以user2登录:
    select 'insert into ' || table_name || ' select * from user1.' || table_name || ';'
    from user_tables;将查出来的这些语句copy至执行窗口运行.
    但是前提是user2用户能查询user1的表数据.
      

  11.   

    如何在USER2的登陆下看USER1的A表数据呢?SQL怎么写?
      要是USER3的状态下,怎么复制到USER2下?
      

  12.   

    以user1登录授权:
    select 'grant select on ' || table_name || ' to user2;' from user_tables;将查出来的语句copy至执行窗口运行;对于将user3的数据复制到user2的操作同user1复制到user2。步骤已经很具体了,你照着操作就行了。
      

  13.   

    --脚本main.txt
    --以user1登录连接数据库,并生成授权脚本;
    conn user1/password@service_name;
    set heading off;
    set feedback off;
    spool c:\grant.txt;
    select 'grant select on ' || table_name || ' to user2;' from user_tables;
    spool off;
    --运行授权脚本;
    @c:\grant.txt;
    --生成插入表数据脚本;
    spool c:\instab.txt;
    select 'insert into ' || table_name || ' select * from user1.' || table_name || ';'
    from user_tables;
    spool off;
    --以user2登录运行插入数据脚本;
    conn user2/password@service_name;
    @c:\instab.txt;
    set heading on;
    set feedback on;将以上脚本保存为c:\main.txt;
    在pl/sql的command windows运行main.txt:
    sql>@c:\main.txt;
    或者直接粘贴以上脚本至pl/sql的command windows运行也行.
      

  14.   

    上面的脚本就是将user1下所有的表数据复制到user2下,你还想得到什么结果呢
      

  15.   

    应该是
    select 'insert into ' || USER2.table_name || ' select * from user1.' || table_name || 谢谢了~