oracle ORA-22992问题

来源:这里教程网 时间:2026-03-03 13:04:02 作者:

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; 第二种通过物化视图的方法 通过物化视图将数据传递到本地来。

相关推荐