0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Oracle 実行計画の取り方

Last updated at Posted at 2020-04-12

実行コマンド

EXPLAIN PLAN FOR
+ 実行計画を取りたいSQL;
SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());

上記のコマンドを実行すると、直近で行われた実行計画の結果が出力される。

SQL*Plusでの出力設定

  • 横幅の設定
    set linesize 1000

  • 縦幅の設定
    set pagesize 1000

  • カラム幅の設定
    COLUMN {column_name} FORMAT a{桁数};

  • 自動的に実行計画を取得する設定
    set autotrace on explain
    set autotrace off explain

番外編

カラムのデフォルト値の確認

select DATA_DEFAULT from ALL_TAB_COLUMNS where TABLE_NAME = {table name} AND COLUMN_NAME = {column name} AND OWNER = {owner name};
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?