欢迎光临
我们一直在努力

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;

第二种通过物化视图的方法

通过物化视图将数据传递到本地来。

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。