Oracle DBLink access Lob field ORA-22992 Solution

Source: Internet
Author: User

This test shows how to access a table containing Blob fields through DBLink.

I. Simulated Problems

1.1In the instance1Operation on:

Create a test table containing blob:

  1. /* FormattedOn10:18:05 (QP5 v5.185.11230.41888 )*/
  2. CREATE TABLELob1
  3. (
  4. Line NUMBERPrimary Key,
  5. Text CLOB
  6. );
  7. INSERT INTOLob1
  8. SELECT DistinctLine, textFROMAll_sourceWhereRownum: <500;
  9. SELECTSegment_name,
  10. Segment_type,
  11. Tablespace_name,
  12. SUM(Bytes)/1024/1024 |'M' AS "SIZE"
  13. FROMUser_segments
  14. WHERESegment_name ='Lob1'
  15. GROUP BYSegment_name, segment_type, tablespace_name;

The LOB table information is as follows:

  1. SEGMENT_NAME SEGMENT_TYPE TABLESPACE_NAMESIZE
  2. -------------------------------------------------------------------------
  3. LOB1TABLESYSTEM 9 M
  4. SQL>SetWrapOff;
  5. SQL>Select*FromLob1WhereRownum = 1;
  6. LINE TEXT
  7. -------------------------------------------------------------------------------
  8. 1 package STANDARD AUTHIDCURRENT_USER Is-- Care

1.2In the instance2On

Create DBLINK:

  1. CREATE PUBLIC DATABASELINK lob_linkCONNECT TODave IDENTIFIEDBYDave
  2. USING '(DESCRIPTION =
  3. (ADDRESS_LIST =
  4. (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.2.222) (PORT = 1521 ))
  5. )
  6. (CONNECT_DATA =
  7. (SERVICE_NAME = dave)
  8. )
  9. )';
  10. SQL>Select*FromV $ version;
  11. BANNER
  12. ----------------------------------------------------------------
  13. OracleDatabase10g Enterprise Edition Release 10.2.0.1.0-Prod
  14. PL/SQL Release 10.2.0.1.0-Production
  15. CORE 10.2.0.1.0 Production
  16. TNSForLinux: Version 10.2.0.1.0-Production
  17. NLSRTL Version 10.2.0.1.0-Production
  18. SQL>Select Count(*)FromLob1 @ lob_link;
  19. COUNT(*)
  20. ----------
  21. 58228

The total number of records queried here is normal. However, when we query the content in a specific LOB field, an error is reported as follows:

  1. SQL>Select*FromLob1 @ lob_linkWhereRownum = 1;
  2. ERROR:
  3. ORA-22992: cannot use LOB locators selectedFromRemote tables
  4. No RowsSelected
  5. [Oracle @ localhost ~] $ Oerr ora 1, 22992
  6. 22992,000 00,"Cannot use LOB locators selected from remote tables"
  7. // * Cause: A remote LOBColumnCannot be referenced.
  8. //*Action: RemoveReferences ToLOBsInRemote tables.
  • 1
  • 2
  • 3
  • 4
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.