SQL Statements Performed Across Database Links run Slowly. Explain Plan Shows Function SYS_OP_C2C has been Applied to Predicates, and Query uses a Full Table Scan.
(Doc ID 2010872.1)
Last updated on FEBRUARY 21, 2024
Applies to:
Oracle Database - Enterprise Edition - Version 10.2.0.4 to 12.1.0.2 [Release 10.2 to 12.1]Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.
Symptoms
- Insert using dblink is slow. The insert inserts to remote table, selecting from local tables with subselect referencing remote table:
INSERT INTO Test@DBLINK
(SELECT ...
FROM
(LOCAL TABLES)
WHERE ...
AND NOT EXISTS (select 'X'
from Test@DBLINK ...
where TIME.EMPLID = JOB.EMPLID
and TIME.DUR = '27-APR-15'))
- The recursive sql for the insert statement (which sends back recursive select statement from remote table which pulls data from local) is taking most time using function SYS_OP_C2C which uses a full table scan:
SELECT "EMPLID","STATUS"..."LASTUPDDTTM"
FROM
"Test" "A1" WHERE "EMPLID"=:1...call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 39 0.01 0.01 0 1 0 0
Fetch 78 185.01 1000.40 7158599 7629332 0 39
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 118 185.02 1000.41 7158599 7629333 0 39Plan hash value: 1862217533
-----------------------------------------------------------------------------------
| Id | Operation | Name | E-Rows |E-Bytes| Cost (%CPU)| E-Time |
-----------------------------------------------------------------------------------
|* 1 | TABLE ACCESS FULL| Test | 1 | 41 | 14635 (1)| 00:01:34 |
-----------------------------------------------------------------------------------
...
1 - filter((SYS_OP_C2C("EMPLID")=:1<======filter operation occurring
AND SYS_OP_C2C("STATUS")=:5)
- The local and remote databases have different NLS setting
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Cause |
Solution |
References |