How can you view the execution plan in Oracle?

There are two ways to view the execution plan in Oracle.

Generate an execution plan using the EXPLAIN PLAN statement.

EXPLAIN PLAN FOR
SELECT * FROM table_name;

SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);

After executing the above statement, the execution plan for the query will be generated and displayed.

2. Use the DBMS_XPLAN package to view the execution plan.

SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR);

This will display the execution plan of the most recent query. You can also specify the SQL_ID parameter to view the execution plan of a specific query.

Please note that the content displayed in the execution plan may vary depending on the Oracle version and configuration.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds