eHow launches Android app: Get the best of eHow on the go.

How To

How to Use an Explain Plan Table in Oracle

Contributor
By Kristen Leigh Grubb
eHow Contributing Writer
(0 Ratings)

Whenever an SQL query is issued to the Oracle database, Oracle creates a plan for executing the query. This execution plan can be saved in a plan table. The plan table contains the order of the tables referenced by the statement, the method used to access the table, the join method, and data operations. Plan tables can be used to determine how the plan is executed so that you can optimize the operations.

Difficulty: Moderately Easy
Instructions

Things You'll Need:

  • Oracle Database
  1. Step 1

    Start SQL*Plus by typing "sqlplus" at a command prompt.

  2. Step 2

    Create a table to hold the EXPLAIN PLAN output with the following syntax:
    CONNECT EXAMPLE/password @$ORACLE_HOME/RDMS/ADMIN/UTLXPLAN.SQL

  3. Step 3

    Run the EXPLAIN PLAN by placing "EXPLAIN PLAN FOR" in front of the SQL statement. Use the "SET STATEMENT_ID" clause if you have more than one statement in the plan table. For example, "EXPLAIN PLAN SET STATEMENT_ID = 'st1' FOR SELECT zip FROM address;"

  4. Step 4

    Type the command "@$ORACLE_HOME/rdbms/admin/utlxpls.sql" to view the Explain Plan.

  5. Step 5

    Type "quit" to close the SQL*Plus session.

Resources
Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

eHow Computers
eHow_eHow Technology and Electronics