ORA-22992: cannot use&…
2017-05-02 11:01
525 查看
创建DBLINK后查询表数据返回错误ORA-22992,需要使用CHAR或RAW变量接收LOB对象 to receive the LOB objects into variables defined as CHAR or RAW. 参考文档: Ora-22992 workaround (文档 ID 436707.1) | 转到底部 |
In this Document
Applies to:Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.4[Release 10.2 to 11.2] Information in this document applies to any platform. SymptomsWhen trying to select from a remote table,getting 'ORA-22992: cannot use LOB locators selected from remote tables.' as following: 1. From the remote database: create 4000 user cris identified by cris; grant connect, resource to cris; conn cris/cris create table test(id number, obj clob); insert into test values(1,'sdfsdfsfd'); insert into test values(2, 'sdfsdfsfdvfgdfvgdfvdf'); commit; 2 From the local database: create user cris identified by cris; grant connect, resource, create database link to cris; conn cris/cris create database link torem using 'identification of the remote database in the tnsnames.ora'; set serveroutput on declare my_ad clob; BEGIN SELECT obj INTO my_ad FROM test@torem where id=1; dbms_output.put_line(my_ad); END; / * ERROR at line 1: ORA-22992: cannot use LOB locators selected from remote tables ORA-06512: at line 4 ChangesCauseTrying to select LOB column from a table at aremote site using dblink. SolutionThe following link to documentation states that you cansuccessfully select form lob objects through dblink All what you have to do is to receive the LOB objects into variables defined as CHAR or RAW. Oracle� Database Application Developer's Guide - Large Objects 10g Release 2 (10.2) Part Number B14249-01 Restrictions Removed inOracleDatabase 10g Release 2 http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/adlob_what.htm#CHDGGBCG http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/adlob_data_interface.htm#CACIFCJF Here are the steps of how to do that: 1. Selecting a CLOB object through the dblink: 1.1 From the remote database: create user cris identified by cris; grant connect, resource to cris; conn cris/cris create table test(id number, obj clob); insert into test values(1,'sdfsdfsfd'); insert into test values(2, 'sdfsdfsfdvfgdfvgdfvdf'); commit; 1.2 From the local database: create user cris identified by cris; grant connect, resource, create database link to cris; conn cris/cris create database link torem using 'identification of the remote database in the tnsnames.ora'; set serveroutput on declare my_ad varchar(6000); BEGIN SELECT obj INTO my_ad FROM test@torem where id=1; dbms_output.put_line(my_ad); END; / 2. Selecting a BLOB object through the dblink: 2.1 From the remote database: create user cris identified by cris; grant connect, resource to cris; conn cris/cris create table test2(id number, obj blob); insert into test2 values(1,empty_blob()); insert into test2 values(2,empty_blob()); commit; 2.2 From the local database: create user cris identified by cris; grant connect, resource, create database link to cris; conn cris/cris create database link torem using 'identification of the remote database in the tnsnames.ora'; declare my_ad raw(50); BEGIN SELECT obj INTO my_ad FROM test2@torem where id=1; END; / |
参考:http://www.linuxidc.com/Linux/2011-12/48581.htm
另外,我们可以借助全局临时表,先把数据复制到临时表,再从临时表转移到你的目的表。
create global temporary table ipop_topic_temp
as select * from ipop_topic@prod.us.oracle.com
where rownum=1
insert into ipop_topic_temp
select * from ipop_topic@prod.us.oracle.com
where application_id=1000
insert into ipop_topic
select * from ipop_topic_temp
commit
相关文章推荐
- Oracle ORA-22992 cannot use LOB locators selected from remote tables解决
- ORA-19573 cannot obtain string e…
- ORA-12032: cannot use rowid column from materialized view log on "DCS_BIZ"."TMP_12"
- ORA-22992: cannot use LOB locators selected from remote tables
- ORA-01081: cannot start already-…
- ORA-22992 cannot use LOB locators selected from remote tables(转)
- Oracle TTS ORA-39322: Cannot use transportable tablespace with different timezone version 说明
- ORA-01081: "cannot start already-running ORACLE - shut it down first"
- Interop type 'Microsoft.Office.Interop.Outlook.ApplicationClass' cannot be embedded. Use the applica
- Message 'You cannot use the EurekaLog package in other packages'.
- 1577 – Cannot proceed beca…
- Oracle TTS ORA-39322: Cannot use transportable tablespace with different timezone version 说明
- How to use virtual path providers to dynamically load and compile content from virtual paths in
- Cannot send session cache limite…
- ORA-16019: cannot use LOG_ARCHIVE_DEST_1 with LOG_ARCHIVE_DEST
- orainstroot.sh 脚本
- Server Error in '/' Application. Cannot use a leading .. to exit above the top directory
- ORA-16019: cannot use LOG_ARCHIVE_DEST_1在ASM下的救赎
- Use Windows Authentication in ASP.NET 2.0/ASP.NET 2.0 中的 Windows 身份验证
- Oracle TTS ORA-39322: Cannot use transportable tablespace with different timezone version 说明