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;
第二種通過物化視圖的方法
通過物化視圖將數據傳遞到本地來。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。