手机版
你好,游客 登录 注册
背景:
阅读新闻

Oracle如何通过dataLink复制远程数据库的CLOB\BLOB字段数据到本地数据库

[日期:2011-12-03] 来源:Linux社区  作者:yx5131421 [字体:大 中 小]

我们都知道,Oracle不支持直接通过Database Link复制远程数据库表的CLOB/BLOB字段数据到本地数据库。

像如下的SQL是不能执行的。(ipop_topic表有一个CLOB的字段)

insert into ipop_topic
select * from ipop_topic@prod.us.oracle.com where application_id=1000

但是,我们可以借助全局临时表,先把数据复制到临时表,再从临时表转移到你的目的表。

create global temporary table ipop_topic_temp
as select * from ipop_topic@prod.us.oracle.com where rownum=1

insert into ipop_topic_temp

select * from ipop_topic@prod.us.oracle.com where application_id=1000

insert into ipop_topic
select * from ipop_topic_temp

commit

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款