日期:2014-05-17  浏览次数:20715 次

请教高手,在Oracle中有2个结构和权限完全相同的用户,怎样将一个用户下的表复制到另个用户下,谢谢
There   are   some   tables   need   copy   from   one   oracle   user   User1     to   another   user   User2.
1.   The   structure   of   the   two   users   are   same;
2.   No   DB   Link   or   privilege   granted   between   those   two   users;  
3.   No   primary   key   or   unique   key   conflict   between   those   two   users '   data;
4.   The   records   number   is   not   very   much   (at   most   10000   for   one   table)

Study   the   solution,   and   write   another   copy   scripts   from   User1   to   User2   with   below   criteria   :
1.   The   structure   of   the   two   users   are   same;
2.   Can   create   DB   Link   or   grant   priv   between   those   two   users;

我刚接触Oracle   请高手指教,谢谢

------解决方案--------------------
insert into user1.table1 select * from user2.table2;

commit;

------解决方案--------------------
I think tgm78 is right!
------解决方案--------------------
是否还应加上存储空间等参数,因为LZ提到10000行
create table USER1.tab1
tablespace myspace
storage
(initial 1M
NEXT 1M
)
AS SELECT * FROM USER2.TAB2;

------解决方案--------------------
使用 exp imp
------解决方案--------------------
我不同意 tgm78.因为题目有明确的说, No DB Link or privilege granted between those two users;
能不能试着先导出一个.sql的文件.再在第2个用户那里,导入这个文件并执行.
这样的做不知道是否合乎题目的要求.