<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>《使用dblink导致的/*+ OPAQUE_TRANSFORM */》的评论</title>
	<atom:link href="https://www.xifenfei.com/2012/05/%e4%bd%bf%e7%94%a8dblink%e5%af%bc%e8%87%b4%e7%9a%84-opaque_transform.html/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com/2012/05/%e4%bd%bf%e7%94%a8dblink%e5%af%bc%e8%87%b4%e7%9a%84-opaque_transform.html</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Thu, 11 Dec 2025 02:46:14 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>作者：惜分飞</title>
		<link>https://www.xifenfei.com/2012/05/%e4%bd%bf%e7%94%a8dblink%e5%af%bc%e8%87%b4%e7%9a%84-opaque_transform.html/comment-page-1#comment-812</link>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
		<pubDate>Mon, 07 May 2012 12:55:38 +0000</pubDate>
		<guid isPermaLink="false">https://www.xifenfei.com/?p=3081#comment-812</guid>
		<description><![CDATA[&lt;strong&gt;What is OPAQUE_TRANSFORM Hint and how to Control it [ID 780503.1]&lt;/strong&gt;
[shell]
Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.3 and later
Information in this document applies to any platform.
Oracle Server Enterprise Edition - Version: 10.2.0.3
***Checked for relevance on 02-MAR-2012***
Goal

What is OPAQUE_TRANSFORM usage :

The OPAQUE_TRANSFORM hint is to help with the transformation of datatype when certain 
type of operations are done within the database.  For example object types .
It is also used for a insert-as-remote-select operation on a remote database 

 

Example : insert into emp (select * from emp@rep102b)   ;

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.50          0          0          0           0
Execute      1      0.00       0.51          0          1         44          12
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       1.01          0          1         44          12

Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 57  (SCOTT)

Rows     Row Source Operation
-------  ---------------------------------------------------
     12  REMOTE  EMP (cr=0 pr=0 pw=0 time=508808 us)


Rows     Execution Plan
-------  ---------------------------------------------------
      0  INSERT STATEMENT   MODE: ALL_ROWS
     12   REMOTE OF &#039;EMP&#039; (REMOTE) [REP102B]
             SELECT /*+ OPAQUE_TRANSFORM */ &quot;EMPNO&quot;,&quot;ENAME&quot;,&quot;JOB&quot;,&quot;MGR&quot;,
               &quot;HIREDATE&quot;,&quot;SAL&quot;,&quot;COMM&quot;,&quot;DEPTNO&quot; FROM &quot;EMP&quot; &quot;EMP&quot;


Note :  This hint should not interfere with the query optimizer plan.

Solution

The below event can be set on the client (local) in order to turn the opaque_transform hint on and off..
- To switch on :

alter session set events &#039;22825 trace name context off&#039; ;

- To switch off :

1) alter session set events &#039;22825 trace name context forever, level 1&#039; ;

2)  or using the following hint : /*+ NO_QUERY_TRANSFORMATION */ 
3)  using  RULE hint.

 

-Note that if local site is 11g and remote is  11g server, this opens 2 sessions 
   on the remote database and OPAQUE_TRANSFORM hint gives DX LOCK deadlock.

- If  the local is 10g client and remote is 11g server, this opens 1 session on 
   the remote and no DX deadlock.
[/shell]]]></description>
		<content:encoded><![CDATA[<p><strong>What is OPAQUE_TRANSFORM Hint and how to Control it [ID 780503.1]</strong></p>
<pre class="brush: bash; title: ; notranslate">
Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.3 and later
Information in this document applies to any platform.
Oracle Server Enterprise Edition - Version: 10.2.0.3
***Checked for relevance on 02-MAR-2012***
Goal

What is OPAQUE_TRANSFORM usage :

The OPAQUE_TRANSFORM hint is to help with the transformation of datatype when certain 
type of operations are done within the database.  For example object types .
It is also used for a insert-as-remote-select operation on a remote database 

 

Example : insert into emp (select * from emp@rep102b)   ;

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.50          0          0          0           0
Execute      1      0.00       0.51          0          1         44          12
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       1.01          0          1         44          12

Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 57  (SCOTT)

Rows     Row Source Operation
-------  ---------------------------------------------------
     12  REMOTE  EMP (cr=0 pr=0 pw=0 time=508808 us)


Rows     Execution Plan
-------  ---------------------------------------------------
      0  INSERT STATEMENT   MODE: ALL_ROWS
     12   REMOTE OF 'EMP' (REMOTE) [REP102B]
             SELECT /*+ OPAQUE_TRANSFORM */ &quot;EMPNO&quot;,&quot;ENAME&quot;,&quot;JOB&quot;,&quot;MGR&quot;,
               &quot;HIREDATE&quot;,&quot;SAL&quot;,&quot;COMM&quot;,&quot;DEPTNO&quot; FROM &quot;EMP&quot; &quot;EMP&quot;


Note :  This hint should not interfere with the query optimizer plan.

Solution

The below event can be set on the client (local) in order to turn the opaque_transform hint on and off..
- To switch on :

alter session set events '22825 trace name context off' ;

- To switch off :

1) alter session set events '22825 trace name context forever, level 1' ;

2)  or using the following hint : /*+ NO_QUERY_TRANSFORMATION */ 
3)  using  RULE hint.

 

-Note that if local site is 11g and remote is  11g server, this opens 2 sessions 
   on the remote database and OPAQUE_TRANSFORM hint gives DX LOCK deadlock.

- If  the local is 10g client and remote is 11g server, this opens 1 session on 
   the remote and no DX deadlock.
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
