温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

oracle ORA-22992问题

发布时间:2020-08-06 21:26:05 来源:ITPUB博客 阅读:186 作者:水逸冰 栏目:关系型数据库

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;

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

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI