作者iamnotfat (我不肥)
看板Database
标题Re: [Oracle] oracle 10g不同电脑资料库资料表复制 …
时间Tue Aug 10 00:03:22 2010
※ 引述《charleshu (Analog Engineer)》之铭言:
: ※ 引述《ienchen227 (..)》之铭言:
: : 请问一下,
: : 我有A,B两台 Oracle Database10g Server,里面有相同的资料表。
: : 我想使用JAVA撰写程式,
: : 使使用者可选择A资料库部分资料表将资料复制到B资料库的资料表。
: : 我原来的作法是,开两个Connect将A资料库资料表资料读出暂存,
: : 再将其写入到B资料库资料表。
: : 不过效能很差。
: : 请问版上大大是否有更好的方法?
: : 谢谢!!
: 可以从B建一个connection到A
: 然後以 create table xxx as select xxx from yyy@A
: 或是 insert into xxx select xxx from yyy@A where ...
At A :
create user oracle identified by oracle;
grant select any table to oracle;
grant connect to oracle;
At B:
create public database link test connect to oracle identified by oracle
using 'A';
'A'这个定义 记得要写入tnsnames.ora
At B:
--verify
select * from dual@test;
复制表格:
create table table_name as select * from table_name@test;
--
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.166.193.13
※ 编辑: iamnotfat 来自: 118.166.193.13 (08/10 00:04)