oracle ORA-22992问题

create /*source only*/ table mingshuo.tmp_ms_19031403 as select * from  backupwt.tmp_ms_19031403@dblk_e1
在利用上面的通过dblink搬迁数据的时候,发生报错
ORA-22992: cannot use LOB locators selected from remote tables
SQL> !oerr ora 22992
22992, 00000, "cannot use LOB locators selected from remote tables"
// *Cause:  A remote LOB column cannot be referenced.
// *Action:  Remove references to LOBs in remote tables.
可以看到是因为源表中有lob字段导致的。
关于这个报错有两个简单的解决办法
1.全局临时表
2.物化视图

先来看第一个全局临时表的方法:
现在目标端建立目标表结构:
create /*source only*/ table mingshuo.tmp_ms_19031403 as select * from  backupwt.tmp_ms_19031403@dblk_e1 where 1=0;

目标端建立全局临时表:
-- Create table
create /*source only*/ global temporary table mingshuo.gb_temp_tab
(
  id             NUMBER(20) not null,
 。。。
) on commit delete rows;

insert into mingshuo.gb_temp_tab select * from backupwt.tmp_ms_19031403@dblk_e1;
注意将数据插入到临时表中后不要提交,否则数据没有了
将临时表中的数据插入到目标表中:
insert into mingshuo.tmp_ms_19031403 select * from mingshuo.gb_temp_tab;
commit;

第二种通过物化视图的方法
通过物化视图将数据传递到本地来。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31480688/viewspace-2638472/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31480688/viewspace-2638472/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值