<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DISPLAY_CURSOR on Oracle Scripts</title><link>https://www.oraclescripts.com/tags/display_cursor/</link><description>Recent content in DISPLAY_CURSOR on Oracle Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>OracleScripts.com</copyright><lastBuildDate>Sun, 13 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.oraclescripts.com/tags/display_cursor/index.xml" rel="self" type="application/rss+xml"/><item><title>Get the Actual Execution Plan with DBMS_XPLAN.DISPLAY_CURSOR</title><link>https://www.oraclescripts.com/post/get-actual-execution-plan-dbms-xplan-display-cursor/</link><pubDate>Sun, 13 Sep 2026 00:00:00 +0000</pubDate><guid>https://www.oraclescripts.com/post/get-actual-execution-plan-dbms-xplan-display-cursor/</guid><description>
&lt;h2 id="get-the-actual-execution-plan-with-dbms_xplandisplay_cursor"&gt;Get the Actual Execution Plan with DBMS_XPLAN.DISPLAY_CURSOR&lt;/h2&gt;
&lt;h2 id="purpose"&gt;Purpose&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;EXPLAIN PLAN&lt;/code&gt; never runs the statement it describes. It asks the optimizer what it &lt;em&gt;would&lt;/em&gt; do, based on statistics and cardinality estimates, and prints that guess — which is exactly why a query that looks fine in &lt;code&gt;EXPLAIN PLAN&lt;/code&gt; can still run slow in production: skewed data, stale statistics, or a bind variable peeked at parse time can all send the real execution down a different path than the estimate shows. &lt;strong&gt;&lt;a href="https://docs.oracle.com/en/database/oracle/oracle-database/18/arpls/DBMS_XPLAN.html"&gt;DBMS_XPLAN&lt;/a&gt;&lt;/strong&gt;'s &lt;code&gt;DISPLAY_CURSOR&lt;/code&gt; table function closes that gap. Instead of estimating, it reads the plan already sitting in the cursor cache for a statement that has actually executed — sourced from &lt;code&gt;V$SQL_PLAN&lt;/code&gt;, &lt;code&gt;V$SQL&lt;/code&gt;, and, when the statement was parsed with the right hint in place, &lt;code&gt;V$SQL_PLAN_STATISTICS_ALL&lt;/code&gt; — and returns the real operations Oracle chose, not the ones it might have chosen.&lt;/p&gt;</description></item></channel></rss>