1 create a plan table under a specific schema owner.
How to create plan table in oracle. There are a few different ways to utilize explain plan. Button to specify the schema you want to create the table in. Exporting from one database and importing into another. Explain plan parses a query and records the plan that oracle devises to execute it.
While a plan table table is automatically set up for each user you can use the sql script utlxplan sql to manually create a local plan table in your schema. Find the explain plan section. Plan table is the default sample output table into which the explain plan statement inserts rows describing execution plans. And automatically for every statement.
Here are the steps to pass along to a dba to set up explain plan in sql navigator for oracle. Each plan history contains some accepted plans the sql plan baseline and some non accepted plans. Plan table is automatically created as a global temporary table to hold the output of an explain plan statement for all users. This method of moving also grabbed the existing plan table.
Create table sqln explain plan statement id varchar2 30 timestamp date remarks varchar2 80 operation varchar2 30 options varchar2 30 object node varchar2 128 object owner varchar2 30 object name varchar2 30 object instance number. We will focus on using it through sql plus since most oracle programmers have access to sql plus. When the plan table does not match the rev of the database it is to be associated with you might be missing some useful information. This associates a user specified id with each plan which can be used when retrieving the data.
Using an older plan table than the current rev of the database really isn t a big problem. In this blog we are going to see what exactly is this plan table and all the concepts around its existence. Plan table is the default sample output table into which the explain plan statement inserts rows describing execution plans. While a plan table table is automatically set up for each user you can use the sql script catplan sql to manually create the global temporary.
Click on the image for a larger view you can create a sql plan baseline in several ways. From the cursor cache. View toad options oracle general. Using a sql tuning set sts.
Oracle handles the syntax but oracle frequently updates the plan table to contain more useful information. By examining this plan you can find out if oracle is picking the right indexes and joining your tables in the most efficient manner. If multiple people are accessing the same plan table or you would like to keep a history of the execution plans you should use the statement id.