62 DBMS_DEVELOPER

パッケージDBMS_DEVELOPERには、データベース・オブジェクトに関する情報を取得するための開発者にわかりやすいシンプルなメソッドが用意されています。

この章のトピックは、次のとおりです:

62.1 DBMS_DEVELOPERの概要

パッケージDBMS_DEVELOPERには、データベース・オブジェクトに関する情報を取得するためのサブプログラムが用意されています。

DBMS_DEVELOPERパッケージには、データベース・オブジェクトの関連情報を取得するための簡単なメソッドが用意されています。このパッケージは、開発者ツールや開発者がデータベース内のオブジェクト、そのシェイプ、構造などの情報を取得する場合に役立ちます。

パフォーマンスに関しては、DBMS_DEVELOPERパッケージは数ミリ秒以内に情報を取得します。

62.2 DBMS_DEVELOPERのセキュリティ

この項では、DBMS_DEVELOPERパッケージに関連するセキュリティ制限を示します。

このファンクションは実行者の権限で実行されます。データベース・オブジェクトのメタデータへのアクセスは、オブジェクトを「表示」する権限がある場合にのみ許可されます。そのような認可がない場合、エラーが発生し、メタデータは取得されません。

必要な権限の要約を次に示します:

  • 表およびビュー: 表またはビューに対するSELECT権限またはREAD権限が必要です。
  • 索引: 索引が定義される表に対するSELECT権限またはREAD権限が必要です。
  • シノニム: シノニムおよび基礎となるオブジェクトに対するSELECT権限またはREAD権限が必要です。

自分のスキーマ内のオブジェクトを記述する場合は、追加の権限は必要ありません。ただし、別のスキーマのオブジェクトを記述する場合は、それらのオブジェクトに対するSELECT権限が必要です。

DBAであるか、SELECT ANY TABLE、READ ANY TABLEおよびSELECT ANY VIEWシステム権限を持っている場合は、明示的に付与しなくても、データベース内の任意の表、索引またはビューに対してDBMS_DEVELOPER.GET_METADATAをコールできます。

62.3 DBMS_DEVELOPERサブプログラムの要約

この表は、DBMS_DEVELOPERサブプログラムおよび簡単な説明を示しています。

次の表に、DBMS_DEVELOPERパッケージのサブプログラムとその簡単な説明を示します。

62.3.1 GET_METADATAファンクション

この項では、GET_METADATAファンクションの構文、入力および出力形式について説明します。

このファンクションは、オブジェクトに関する情報を受け取り、対応するメタデータをJSON形式のテキスト出力を含むCLOBとして生成します。

構文

DBMS_DEVELOPER.GET_METADATA (  
name            IN VARCHAR2,  
schema          IN VARCHAR2 DEFAULT NULL,  
object_type     IN VARCHAR2 DEFAULT NULL,  
level           IN VARCHAR2 DEFAULT 'TYPICAL'  
etag            IN RAW      DEFAULT NULL)
RETURN CLOB;

表62-1 入力構成のフィールド

フィールド 値

name

オブジェクト名。オブジェクト名のシノニムも指定できます。大文字と小文字が区別され、データ・ディクショナリに示されているとおりに指定する必要があります。

schema

スキーマ名。デフォルトは現行ユーザーです。大文字と小文字が区別され、データ・ディクショナリに示されているとおりに指定する必要があります。

object_type

取り出すオブジェクトのタイプ。これはオプションです。名前解決は、object_type.を指定せずに実行することもできます

サポートされている値: TABLE、INDEXおよびVIEW

level

詳細のレベル。デフォルトはTYPICALです。

サポートされる値:

  1. BASIC: 必須の情報を示します。
  2. TYPICAL: 指定されたオブジェクトのさらに詳細な情報が含まれます。
  3. ALL: 最も包括的なレベルの情報を提供します。

etag

特定のバージョンのドキュメントの一意の識別子。このetag値により、アプリケーションでは、ドキュメントの特定のバージョンの内容が別のバージョンの内容と同じかどうかを判断します。

  1. etagが指定され、現在のetagと一致する場合、このファンクションは空のドキュメントを返します。
  2. データベース内のドキュメントのetagが指定されたetagと一致しない場合、(新しいetagが埋め込まれて)新しいドキュメントが返されます。
GET_METADATAファンクションは、JSONスキーマを返しません。かわりに、JSONドキュメントを返します。取得するメタデータのレベルに応じて、GET_METADATAファンクションに適切なパラメータを使用して、目的のメタデータJSONドキュメントを取得できます。

アプリケーションに必要なスキーマを理解するには、「様々なオブジェクトおよびサブオブジェクト・タイプのJSONスキーマ」を参照してください。

例

この項では、様々な値のobject_typeおよびlevelでのDBMS_DEVELOPER.GET_METADATAの使用例を示します。
  1. levelをBASICに設定し、object_typeをTABLEに設定したメタデータの取得:
    SQL> conn hr/hr
    Connected.
    SQL> SELECT JSON_SERIALIZE(dbms_developer.get_metadata(name => 'EMPLOYEES', 
    level => 'BASIC')RETURNING CLOB PRETTY) from dual;

    この問合せを実行すると、次の内容が生成されます:

    {
      "objectType" : "TABLE",
      "objectInfo" :
      {
        "name" : "EMPLOYEES",
        "schema" : "HR",
        "columns" :
        [
          {
            "name" : "EMPLOYEE_ID",
            "notNull" : true,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 6
            }
          },
          {
            "name" : "FIRST_NAME",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 20,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "LAST_NAME",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 25,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "EMAIL",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 25,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "PHONE_NUMBER",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 20,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "HIRE_DATE",
            "notNull" : true,
            "dataType" :
            {
              "type" : "DATE"
            }
          },
          {
            "name" : "JOB_ID",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 10,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "SALARY",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 8,
              "scale" : 2
            }
          },
          {
            "name" : "COMMISSION_PCT",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 2,
              "scale" : 2
            }
          },
          {
            "name" : "MANAGER_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 6
            }
          },
          {
            "name" : "DEPARTMENT_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 4
            }
          }
        ]
      },
      "etag" : "C2BAA871FC47AF364A441F1DCBDBB9D8"
    }
    
  2. levelをTYPICALに設定し、object_typeをVIEWに設定したメタデータの取得:
    SQL> conn hr/hr
    Connected.
    SQL> SELECT JSON_SERIALIZE(dbms_developer.get_metadata(name => 'EMP_DETAILS_VIEW', 
    level => 'TYPICAL')RETURNING CLOB PRETTY) from dual;

    この問合せを実行すると、次の内容が生成されます:

    {
      "objectType" : "VIEW",
      "objectInfo" :
      {
        "name" : "EMP_DETAILS_VIEW",
        "schema" : "HR",
        "columns" :
        [
          {
            "name" : "EMPLOYEE_ID",
            "notNull" : true,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 6
            }
          },
          {
            "name" : "JOB_ID",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 10,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "MANAGER_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 6
            }
          },
          {
            "name" : "DEPARTMENT_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 4
            }
          },
          {
            "name" : "LOCATION_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 4
            }
          },
          {
            "name" : "COUNTRY_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "CHAR",
              "length" : 2,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "FIRST_NAME",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 20,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "LAST_NAME",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 25,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "SALARY",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 8,
              "scale" : 2
            }
          },
          {
            "name" : "COMMISSION_PCT",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 2,
              "scale" : 2
            }
          },
          {
            "name" : "DEPARTMENT_NAME",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 30,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "JOB_TITLE",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 35,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "CITY",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 30,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "STATE_PROVINCE",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 25,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "COUNTRY_NAME",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 40,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "REGION_NAME",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 25,
              "sizeUnits" : "BYTE"
            }
          }
        ],
        "readOnly" : true,
        "constraints" :
        [
          {
            "name" : "SYS_C007578",
            "constraintType" : "VIEW READONLY",
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "NOT VALIDATED",
            "sysGeneratedName" : true
          }
        ]
      },
      "etag" : "C08C2ECBBE343A51060D8C475E16968E"
    }
    
  3. levelをALLに設定し、object_typeをVIEWに設定したメタデータの取得:
    SQL> conn hr/hr
    Connected.
    SQL> SELECT JSON_SERIALIZE(dbms_developer.get_metadata(name => 'EMP_DETAILS_VIEW', 
    level => 'ALL')RETURNING CLOB PRETTY) from dual;

    この問合せを実行すると、次の内容が生成されます:

    {
      "objectType" : "VIEW",
      "objectInfo" :
      {
        "name" : "EMP_DETAILS_VIEW",
        "schema" : "HR",
        "columns" :
        [
          {
            "name" : "EMPLOYEE_ID",
            "notNull" : true,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 6
            }
          },
          {
            "name" : "JOB_ID",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 10,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "MANAGER_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 6
            }
          },
          {
            "name" : "DEPARTMENT_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 4
            }
          },
          {
            "name" : "LOCATION_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 4
            }
          },
          {
            "name" : "COUNTRY_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "CHAR",
              "length" : 2,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "FIRST_NAME",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 20,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "LAST_NAME",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 25,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "SALARY",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 8,
              "scale" : 2
            }
          },
          {
            "name" : "COMMISSION_PCT",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 2,
              "scale" : 2
            }
          },
          {
            "name" : "DEPARTMENT_NAME",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 30,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "JOB_TITLE",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 35,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "CITY",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 30,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "STATE_PROVINCE",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 25,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "COUNTRY_NAME",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 40,
              "sizeUnits" : "BYTE"
            }
          },
          {
            "name" : "REGION_NAME",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 25,
              "sizeUnits" : "BYTE"
            }
          }
        ],
        "readOnly" : true,
        "constraints" :
        [
          {
            "name" : "SYS_C007578",
            "constraintType" : "VIEW READONLY",
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "NOT VALIDATED",
            "sysGeneratedName" : true
          }
        ],
        "editioningView" : false
      },
      "etag" : "ED648644C063A29B04E2A65CFC2D2E76"
    }
  4. levelをALLに設定し、object_typeをINDEXに設定したメタデータの取得:
    SQL> conn hr/hr
    Connected.
    SQL> SELECT JSON_SERIALIZE(dbms_developer.get_metadata(name => 'EMP_EMP_ID_PK', 
    level => 'ALL')RETURNING CLOB PRETTY) from dual;
    

    この問合せを実行すると、次の内容が生成されます:

    {
      "objectType" : "INDEX",
      "objectInfo" :
      {
        "name" : "EMP_EMP_ID_PK",
        "indexType" : "NORMAL",
        "owner" : "HR",
        "tableName" : "EMPLOYEES",
        "status" : "VALID",
        "columns" :
        [
          {
            "name" : "EMPLOYEE_ID",
            "notNull" : true,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 6
            },
            "isPk" : true,
            "isUk" : true,
            "isFk" : false,
            "numDistinct" : 107,
            "density" : 0.00934579439252336,
            "avgColLen" : 4,
            "lowValue" : "C202",
            "highValue" : "C20307",
            "hiddenColumn" : false
          }
        ],
        "uniqueness" : "UNIQUE",
        "lastAnalyzed" : "2025-05-09T06:44:31",
        "numRows" : 107,
        "sampleSize" : 107,
        "partitioned" : false,
        "distinctKeys" : 107,
        "compression" : "DISABLED",
        "segmentCreated" : "YES",
        "visibility" : "VISIBLE",
        "toBeDropped" : false
      },
      "etag" : "752F0B7990BD188863BBBB80D5248F35"
    }
  5. levelおよびobject_typeを明示的に指定しないメタデータの取得:
    SQL> conn hr/hr
    Connected.
    SQL>
    SQL> SELECT JSON_SERIALIZE(dbms_developer.get_metadata(name => 'EMPLOYEES')
    RETURNING CLOB PRETTY) from dual;

    object_typeを指定しない場合でも、名前解決は内部で行われます。name => 'EMPLOYEES'に対応するobject_typeの名前は、tableと判断されます。そのため、JSONドキュメントは、table object_typeのデフォルトのtypical levelで生成されます。前述の例に対応する出力JSONドキュメントを次に示します:

    {
      "objectType" : "TABLE",
      "objectInfo" :
      {
        "name" : "EMPLOYEES",
        "schema" : "HR",
        "columns" :
        [
          {
            "name" : "EMPLOYEE_ID",
            "notNull" : true,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 6
            },
            "isPk" : true,
            "isUk" : true,
            "isFk" : false
          },
          {
            "name" : "FIRST_NAME",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 20,
              "sizeUnits" : "BYTE"
            },
            "isPk" : false,
            "isUk" : false,
            "isFk" : false
          },
          {
            "name" : "LAST_NAME",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 25,
              "sizeUnits" : "BYTE"
            },
            "isPk" : false,
            "isUk" : false,
            "isFk" : false
          },
          {
            "name" : "EMAIL",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 25,
              "sizeUnits" : "BYTE"
            },
            "isPk" : false,
            "isUk" : true,
            "isFk" : false
          },
          {
            "name" : "PHONE_NUMBER",
            "notNull" : false,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 20,
              "sizeUnits" : "BYTE"
            },
            "isPk" : false,
            "isUk" : false,
            "isFk" : false
          },
          {
            "name" : "HIRE_DATE",
            "notNull" : true,
            "dataType" :
            {
              "type" : "DATE"
            },
            "isPk" : false,
            "isUk" : false,
            "isFk" : false
          },
          {
            "name" : "JOB_ID",
            "notNull" : true,
            "dataType" :
            {
              "type" : "VARCHAR2",
              "length" : 10,
              "sizeUnits" : "BYTE"
            },
            "isPk" : false,
            "isUk" : false,
            "isFk" : true
          },
          {
            "name" : "SALARY",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 8,
              "scale" : 2
            },
            "isPk" : false,
            "isUk" : false,
            "isFk" : false
          },
          {
            "name" : "COMMISSION_PCT",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 2,
              "scale" : 2
            },
            "isPk" : false,
            "isUk" : false,
            "isFk" : false
          },
          {
            "name" : "MANAGER_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 6
            },
            "isPk" : false,
            "isUk" : false,
            "isFk" : true
          },
          {
            "name" : "DEPARTMENT_ID",
            "notNull" : false,
            "dataType" :
            {
              "type" : "NUMBER",
              "precision" : 4
            },
            "isPk" : false,
            "isUk" : false,
            "isFk" : true
          }
        ],
        "lastAnalyzed" : "2025-05-09T06:44:29",
        "numRows" : 107,
        "sampleSize" : 107,
        "avgRowLen" : 69,
        "external" : "NO",
        "temporary" : "NO",
        "indexes" :
        [
          {
            "name" : "EMP_EMAIL_UK",
            "indexType" : "NORMAL",
            "uniqueness" : "UNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-05-09T06:44:30",
            "numRows" : 107,
            "sampleSize" : 107,
            "partitioned" : false,
            "columns" :
            [
              {
                "name" : "EMAIL"
              }
            ]
          },
          {
            "name" : "EMP_EMP_ID_PK",
            "indexType" : "NORMAL",
            "uniqueness" : "UNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-05-09T06:44:31",
            "numRows" : 107,
            "sampleSize" : 107,
            "partitioned" : false,
            "columns" :
            [
              {
                "name" : "EMPLOYEE_ID"
              }
            ]
          },
          {
            "name" : "EMP_DEPARTMENT_IX",
            "indexType" : "NORMAL",
            "uniqueness" : "NONUNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-05-09T06:44:31",
            "numRows" : 106,
            "sampleSize" : 106,
            "partitioned" : false,
            "columns" :
            [
              {
                "name" : "DEPARTMENT_ID"
              }
            ]
          },
          {
            "name" : "EMP_JOB_IX",
            "indexType" : "NORMAL",
            "uniqueness" : "NONUNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-05-09T06:44:32",
            "numRows" : 107,
            "sampleSize" : 107,
            "partitioned" : false,
            "columns" :
            [
              {
                "name" : "JOB_ID"
              }
            ]
          },
          {
            "name" : "EMP_MANAGER_IX",
            "indexType" : "NORMAL",
            "uniqueness" : "NONUNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-05-09T06:44:32",
            "numRows" : 106,
            "sampleSize" : 106,
            "partitioned" : false,
            "columns" :
            [
              {
                "name" : "MANAGER_ID"
              }
            ]
          },
          {
            "name" : "EMP_NAME_IX",
            "indexType" : "NORMAL",
            "uniqueness" : "NONUNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-05-09T06:44:32",
            "numRows" : 107,
            "sampleSize" : 107,
            "partitioned" : false,
            "columns" :
            [
              {
                "name" : "LAST_NAME"
              },
              {
                "name" : "FIRST_NAME"
              }
            ]
          }
        ],
        "constraints" :
        [
          {
            "name" : "EMP_LAST_NAME_NN",
            "constraintType" : "CHECK - NOT NULL",
            "searchCondition" : "\"LAST_NAME\" IS NOT NULL",
            "columns" :
            [
              {
                "name" : "LAST_NAME"
              }
            ],
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMAIL_NN",
            "constraintType" : "CHECK - NOT NULL",
            "searchCondition" : "\"EMAIL\" IS NOT NULL",
            "columns" :
            [
              {
                "name" : "EMAIL"
              }
            ],
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_HIRE_DATE_NN",
            "constraintType" : "CHECK - NOT NULL",
            "searchCondition" : "\"HIRE_DATE\" IS NOT NULL",
            "columns" :
            [
              {
                "name" : "HIRE_DATE"
              }
            ],
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_JOB_NN",
            "constraintType" : "CHECK - NOT NULL",
            "searchCondition" : "\"JOB_ID\" IS NOT NULL",
            "columns" :
            [
              {
                "name" : "JOB_ID"
              }
            ],
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_SALARY_MIN",
            "constraintType" : "CHECK",
            "searchCondition" : "salary > 0",
            "columns" :
            [
              {
                "name" : "SALARY"
              }
            ],
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMAIL_UK",
            "constraintType" : "UNIQUE",
            "columns" :
            [
              {
                "name" : "EMAIL"
              }
            ],
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMP_ID_PK",
            "constraintType" : "PRIMARY KEY",
            "columns" :
            [
              {
                "name" : "EMPLOYEE_ID"
              }
            ],
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_DEPT_FK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "DEPARTMENT_ID"
              }
            ],
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false,
            "referencedConstraintName" : "DEPT_ID_PK",
            "referencedTable" : "DEPARTMENTS",
            "referencedOwner" : "HR",
            "Action" : "RESTRICT",
            "referencedColumns" :
            [
              {
                "name" : "DEPARTMENT_ID"
              }
            ]
          },
          {
            "name" : "EMP_JOB_FK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "JOB_ID"
              }
            ],
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false,
            "referencedConstraintName" : "JOB_ID_PK",
            "referencedTable" : "JOBS",
            "referencedOwner" : "HR",
            "Action" : "RESTRICT",
            "referencedColumns" :
            [
              {
                "name" : "JOB_ID"
              }
            ]
          },
          {
            "name" : "EMP_MANAGER_FK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "MANAGER_ID"
              }
            ],
            "status" : "ENABLED",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false,
            "referencedConstraintName" : "EMP_EMP_ID_PK",
            "referencedTable" : "EMPLOYEES",
            "referencedOwner" : "HR",
            "Action" : "RESTRICT",
            "referencedColumns" :
            [
              {
                "name" : "EMPLOYEE_ID"
              }
            ]
          }
        ]
      },
      "etag" : "250A14E4E687854657E7336BCE46432F"
    }
  6. 指定されたetagが現在のetagと一致する場合にメタデータを取得すると、空のドキュメントが返されます:
    SQL> conn hr/hr
    Connected.
    SQL>
    SQL> SELECT JSON_SERIALIZE(dbms_developer.get_metadata(name => 'REGIONS', 
    etag => '9ADC6D08AE0D5C82C0188D53F3ECD5B9')RETURNING CLOB PRETTY) from dual;
    この問合せを実行すると、空のJSONドキュメントが生成されます:
    {
    }
62.3.1.1 様々なオブジェクトおよびサブオブジェクト・タイプのJSONスキーマ

この項では、様々なオブジェクト・タイプ、サブオブジェクト・タイプおよびレベルで可能な各種スキーマの概要を示します。

このJSONスキーマは、アプリケーションでリファレンスとして使用して、返されたJSONドキュメントを解析できます。特定のバージョンのデータベース・プログラムをプログラミングする場合は、そのデータベース・バージョンに対する特定のバージョンのJSONスキーマを使用すると、そのスキーマは常に同じになります。ただし、別のリリースにアップグレードまたはダウングレードする場合は、別のスキーマ・バージョンを使用するため、その正しいスキーマを使用する必要があります。スキーマが変更された場合は、$idフィールドのバージョン番号が変更されます。今後オラクルがJSONスキーマの改訂を予定している場合でも、アプリケーションはこの数値に依拠できます。既存のバージョンは変更されないため、アプリケーションは引き続き完全に機能し、更新の影響を受けません。

62.3.1.1.1 オブジェクト・タイプTABLEのJSONスキーマ

この項では、オブジェクト・タイプTABLEのすべてのレベルのJSONスキーマについて説明します。

TABLEオブジェクト・タイプのJSONスキーマ(表形式)

表62-2 オブジェクト・タイプTABLEのJSONスキーマ

フィールド     レベル
      BASIC TYPICAL ALL

name

    ✔ ✔ ✔

schema

    ✔ ✔ ✔

columns

    ✔ ✔ ✔

hasBeenAnalyzed

      ✔ ✔

lastAnalyzed

      ✔ ✔

numRows

      ✔ ✔

sampleSize

      ✔ ✔

avgRowLen

      ✔ ✔

clusterName

      ✔ ✔

clusterOwner

      ✔ ✔

external

      ✔ ✔

temporary

      ✔ ✔

索引

      ✔ ✔

制約

      ✔ ✔

segmentCreated

        ✔

inMemory

        ✔

compression

        ✔

dependencies

        ✔

authorizations

grantee       ✔
privileges name
grantable

inMemoryPriority

        ✔

inMemoryDistribute

        ✔

inMemoryCompression

        ✔

inMemoryDuplicate

        ✔

iotType

        ✔

ノート:

サブオブジェクトcolumnsおよびconstraintsのフィールドは、levelの選択によって異なります。サブオブジェクトcolumnsに存在するフィールドの詳細は、「サブオブジェクト・タイプcolumnsのJSONスキーマ」を参照してください。サブオブジェクトconstraintsに存在するフィールドの詳細は、「サブオブジェクト・タイプconstraintsのJSONスキーマ」を参照してください。

TABLEオブジェクト・タイプのJSONスキーマ(level BASIC)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/BASIC/object_info/table",
    "title": "DBMS_DEVELOPER.GET_METADATA/BASIC/OBJECT_INFO/TABLE",
    "description": "Information for a table object",
    "type": "object",
    "properties": {
        "name": {
            "description": "Table name",
            "type": "string"
        },
        "schema": {
            "description": "Table schema",
            "type": "string"
        },
        "columns": {
            "description": "Table columns",
            "type": "array",
            "items": {
                "$ref": "../column"
            }
        }
    },
    "required": [
        "name",
        "schema",
        "columns"
    ]
}

TABLEオブジェクト・タイプのJSONスキーマ(level TYPICAL)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/TYPICAL/object_info/table",
    "title": "DBMS_DEVELOPER.GET_METADATA/TYPICAL/OBJECT_INFO/TABLE",
    "description": "Information for a table object",
    "type": "object",
    "properties": {
        "name": {
            "description": "Table name",
            "type": "string"
        },
        "schema": {
            "description": "Table schema",
            "type": "string"
        },
        "columns": {
            "description": "Table columns",
            "type": "array",
            "items": {
                "$ref": "../column"
            }
        },
        "hasBeenAnalyzed": {
            "description": "Indicates whether table has been analyzed",
            "type": "boolean",
            "default": false
        },
        "lastAnalyzed": {
            "description": "Last time table was analyzed",
            "type": "string",
            "format": "date-time"
        },
        "numRows": {
            "description": "Number of rows",
            "type": "integer"
        },
        "sampleSize": {
            "description": "Analyzed sample size",
            "type": "integer"
        },
        "avgRowLen": {
            "description": "Average row length",
            "type": "integer"
        },
        "clusterName": {
            "description": "Name of the cluster, if any, to which the table belongs",
            "type": "string"
        },
        "clusterOwner": {
            "description": "Owner of the cluster, if any, to which the table belongs",
            "type": "string"
        },
        "external": {
            "description": "Indicates whether the table is an external table (YES) or not (NO)",
            "type": "string"
        },
        "temporary": {
            "description": "Indicates whether the table is temporary (YES) or not (NO)",
            "type": "string"
        },
        "indexes": {
            "description": "Table indexes",
            "type": "array",
            "items": {
                "$ref": "../index"
            }
        },
        "constraints": {
            "description": "Table constraints",
            "type": "array",
            "items": {
                "$ref": "../constraint"
            }
        }
    },
    "required": [
        "name",
        "schema",
        "columns",
        "external",
        "temporary"
    ]
}

TABLEオブジェクト・タイプのJSONスキーマ(level ALL)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/ALL/object_info/table",
    "title": "DBMS_DEVELOPER.GET_METADATA/ALL/OBJECT_INFO/TABLE",
    "description": "Information for a table object",
    "type": "object",
    "properties": {
        "name": {
            "description": "Table name",
            "type": "string"
        },
        "schema": {
            "description": "Table schema",
            "type": "string"
        },   
        "columns": {
            "description": "Table columns",
            "type": "array",
            "items": {
                "$ref": "../column"
            }
        },
        "hasBeenAnalyzed": {
            "description": "Indicates whether table has been analyzed",
            "type": "boolean",
            "default": false
        },
        "lastAnalyzed": {
            "description": "Last time table was analyzed",
            "type": "string",
            "format": "date-time"
        },
        "numRows": {
            "description": "Number of rows",
            "type": "integer"
        },
        "sampleSize": {
            "description": "Analyzed sample size",
            "type": "integer"
        },
        "avgRowLen": {
            "description": "Average row length",
            "type": "integer"
        },
        "clusterName": {
            "description": "Name of the cluster, if any, to which the table belongs",
            "type": "string"
        },
        "clusterOwner": {
            "description": "Owner of the cluster, if any, to which the table belongs",
            "type": "string"
        },
        "external": {
            "description": "Indicates whether the table is an external table (YES) or not (NO)",
            "type": "string"
        },
        "temporary": {
            "description": "Indicates whether the table is temporary (YES) or not (NO)",
            "type": "string"
        },
        "indexes": {
            "description": "Table indexes",
            "type": "array",
            "items": {
                "$ref": "../index"
            }
        },
        "constraints": {
            "description": "Table constraints",
            "type": "array",
            "items": {
                "$ref": "../constraint"
            }
        },
        "segmentCreated": {
            "description": "Indicates whether the table segment is created.",
            "type": "string"
        },  
        "inMemory": {
            "description": "Indicates whether the In-Memory Column Store (IM column store) is 
                            enabled (ENABLED) or disabled (DISABLED) for the table",
            "type": "string"
        }, 
        "compression": {
            "description": "Indicates whether table compression is enabled (ENABLED) or not (DISABLED)",
            "type": "string"
        }, 
        "dependencies": {
            "description": "Indicates whether the table is an external table (YES) or not (NO)",
            "type": "string"
        },
         "authorizations": {
            "description": "Table authorizations",
            "type": "object",
            "properties": {
                "grantee": {
                    "description": "Name of the user to whom access was granted",
                    "type": "string"  
                },
                "privileges": {
                    "description": "All privileges granted to grantee",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "description": "Privilege on the object,
                                "type": "string"
                            },
                            "grantable": {
                                "description": "Indicates whether the privilege was granted with the GRANT OPTION",
                                "type": "string"
                            }
                        }
                    }
                }
            }      
        }, 
        "inMemoryPriority": {
            "description": "Indicates the priority for In-Memory Column Store (IM column store) population. ",
            "type": "string"
        }, 
        "inMemoryDistribute": {
            "description": "Indicates how the IM column store is distributed in an 
                            Oracle Real Application Clusters (Oracle RAC) environment",
            "type": "string"
        }, 
        "inMemoryCompression": {
            "description": "Indicates the compression level for the IM column store",
            "type": "string"
        }, 
        "inMemoryDuplicate": {
            "description": "Indicates the duplicate setting for the IM column store in an Oracle RAC environment",
            "type": "string"
        }, 
        "iotType": {
            "description": "If the table is an index-organized table, then IOT_TYPE is IOT, 
                            IOT_OVERFLOW, or IOT_MAPPING. If the table is not an 
                            index-organized table, then IOT_TYPE is NULL.",
            "type": "string"
        }
    },
    "required": [
        "name",
        "schema",
        "columns",
        "external",
        "temporary",
        "inMemory",
        "compression",
        "dependencies",
        "segmentCreated"
    ]
}
62.3.1.1.2 オブジェクト・タイプVIEWのJSONスキーマ

この項では、オブジェクト・タイプVIEWのすべてのレベルのJSONスキーマについて説明します。

VIEWオブジェクト・タイプのJSONスキーマ(表形式)

表62-3 VIEWオブジェクト・タイプのJSONスキーマ

フィールド     レベル
      BASIC TYPICAL ALL

name

    ✔ ✔ ✔

schema

    ✔ ✔ ✔

columns

    ✔ ✔ ✔

readOnly

      ✔ ✔

制約

      ✔ ✔

editioningView

        ✔

authorizations

grantee

      ✔

privileges

name
grantable

ノート:

サブオブジェクトcolumnsおよびconstraintsのフィールドは、levelの選択によって異なります。サブオブジェクトcolumnsに存在するフィールドの詳細は、「サブオブジェクト・タイプcolumnsのJSONスキーマ」を参照してください。サブオブジェクトconstraintsに存在するフィールドの詳細は、「サブオブジェクト・タイプconstraintsのJSONスキーマ」を参照してください。

VIEWオブジェクト・タイプのJSONスキーマ(level BASIC)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/BASIC/object_info/view",
    "title": "DBMS_DEVELOPER.GET_METADATA/BASIC/OBJECT_INFO/VIEW",
    "description": "Information for a View object",
    "type": "object",
    "properties": {
        "name": {
            "description": "View name",
            "type": "string"
        },
        "schema": {
            "description": "View schema",
            "type": "string"
        },
        "columns": {
            "description": "View columns",
            "type": "array",
            "items": {
                "$ref": "../column"
            }
        }
    },
    "required": [
        "name",
        "schema",
        "columns"
    ]
}

VIEWオブジェクト・タイプのJSONスキーマ(level TYPICAL)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/TYPICAL/object_info/view",
    "title": "DBMS_DEVELOPER.GET_METADATA/TYPICAL/OBJECT_INFO/VIEW",
    "description": "Information for a View object",
    "type": "object",
    "properties": {
        "name": {
            "description": "View name",
            "type": "string"
        },
        "schema": {
            "description": "View schema",
            "type": "string"
        },
        "columns": {
            "description": "View columns",
            "type": "array",
            "items": {
                "$ref": "../column"
            }
        },
        "readOnly": {
            "description": "An indicator of whether the view is a Read Only View",
            "type": "boolean",
            "default": true
        },
        "constraints": {
            "description": "View constraints",
            "type": "array",
            "items": {
                "$ref": "../constraint"
            }
        }
    },
    "required": [
         "name",
         "schema",
         "readOnly",
         "columns"
    ]
}

VIEWオブジェクト・タイプのJSONスキーマ(level ALL)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/ALL/object_info/view",
    "title": "DBMS_DEVELOPER.GET_METADATA/ALL/OBJECT_INFO/VIEW",
    "description": "Information for a View object",
    "type": "object",
    "properties": {
        "name": {
            "description": "View name",
            "type": "string"
        },
        "schema": {
            "description": "View schema",
            "type": "string"
        }, 
        "columns": {
            "description": "View columns",
            "type": "array",
            "items": {
                "$ref": "../column"
            }
        },
        "readOnly": {
            "description": "An indicator of whether the view is a Read Only View",
            "type": "boolean",
            "default": true
        }, 
        "constraints": {
            "description": "View constraints",
            "type": "array",
            "items": {
                "$ref": "../constraint"
            }
        },,
        "editioningView": {
            "description": "An indicator of whether the view is an Editioning view",
            "type": "boolean",
            "default": false
        },
        "authorizations": {
            "description": "View authorizations",
            "type": "object",
            "properties": {
                "grantee": {
                    "description": "Name of the user to whom access was granted",
                    "type": "string"  
                },
                "privileges": {
                    "description": "All privileges granted to grantee",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "description": "Privilege on the object,
                                "type": "string"
                            },
                            "grantable": {
                                "description": "Indicates whether the privilege was granted with the GRANT OPTION",
                                "type": "string"
                            }
                        }
                    }
                }
            }      
        }
    },
    "required": [
         "name",
         "schema",
         "columns"
    ]
}
62.3.1.1.3 オブジェクト・タイプINDEXのJSONスキーマ

この項では、オブジェクト・タイプINDEXのすべてのレベルのJSONスキーマについて説明します。

INDEXオブジェクト・タイプのJSONスキーマ(表形式)

表62-4 INDEXオブジェクト・タイプのJSONスキーマ

フィールド     レベル
      BASIC TYPICAL ALL
name     ✔ ✔ ✔
indexType     ✔ ✔ ✔
owner     ✔ ✔ ✔
tableName     ✔ ✔ ✔
status     ✔ ✔ ✔
columns     ✔ ✔ ✔
uniqueness       ✔ ✔
funcIdxStatus       ✔ ✔
hasBeenAnalyzed       ✔ ✔
lastAnalyzed       ✔ ✔
numRows       ✔ ✔
sampleSize       ✔ ✔
partitioned       ✔ ✔
distinctKeys         ✔
compression         ✔
segmentCreated         ✔
visibility         ✔
toBeDropped         ✔

ノート:

サブオブジェクトcolumnsのフィールドは、levelの選択に応じて異なります。サブオブジェクトcolumnsに存在するフィールドの詳細は、「サブオブジェクト・タイプcolumnsのJSONスキーマ」を参照してください。

INDEXオブジェクト・タイプのJSONスキーマ(level BASIC)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/BASIC/object_info/index",
    "title": "DBMS_DEVELOPER.GET_METADATA/BASIC/OBJECT_INFO/INDEX",
    "description": "Information for index",
    "type": "object",
    "properties": {
        "name": {
            "description": "Index name",
            "type": "string"
        },
        "indexType": {
            "description": "Index Types i.e. CLUSTER, NORMAL, NORMAL/REV, BITMAP, DOMAIN, 
                            LOB, IOT - TOP, FUNCTION-BASED NORMAL, FUNCTION-BASED NORMAL/REV, 
                            FUNCTION-BASED BITMAP, FUNCTION-BASED DOMAIN, VECTOR",
            "type": "string"
        },
        "owner": {
            "description": "Owner of the indexed object",
            "type": "string"
        },
        "tableName": {
            "description": "Name of the indexed object",
            "type": "string"
        },
        "status": {
            "description": "Status",
            "type": {
                "enum": [
                    "VALID",
                    "UNUSABLE",
                    "INPROGRS",
                    "N/A"
                ]
            }
        },
        "columns": {
            "description": "Index column(s)",
            "type": "array",
            "items": {
                "$ref": "../column"
            }
        }
    },
    "required": [
        "name",
        "indexType",
        "owner",
        "tableName",
        "status",
        "columns"
    ]
}

INDEXオブジェクト・タイプのJSONスキーマ(level TYPICAL)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/TYPICAL/object_info/index",
    "title": "DBMS_DEVELOPER.GET_METADATA/TYPICAL/OBJECT_INFO/INDEX",
    "description": "Information for index",
    "type": "object",
    "properties": {
        "name": {
            "description": "Index name",
            "type": "string"
        },
        "indexType": {
            "description": "Index Types i.e. CLUSTER, NORMAL, NORMAL/REV, BITMAP, DOMAIN, 
                            LOB, IOT - TOP, FUNCTION-BASED NORMAL, FUNCTION-BASED NORMAL/REV, 
                            FUNCTION-BASED BITMAP, FUNCTION-BASED DOMAIN, VECTOR",
            "type": "string"
        },
        "owner": {
            "description": "Owner of the indexed object",
            "type": "string"
        },
        "tableName": {
            "description": "Name of the indexed object",
            "type": "string"
        },  
        "status": {
            "description": "Status",
            "type": {
                "enum": [
                    "VALID",
                    "INVALID",
                    "INPROGRS",
                    "N/A"
                ]
            }
        },
        "columns": {
            "description": "Index column(s)",
            "type": "array",
            "items": {
                "$ref": "../column"
            }
        },
        "uniqueness": {
            "description": "Uniqueness",
            "type": "string",
            "enum": [
                "UNIQUE",
                "NONUNIQUE"
            ]
        },
        "funcIdxStatus": {
            "description": "Functional index status",
            "type": "string"
        },
        "hasBeenAnalyzed": {
            "description": "Indicates whether index has been analyzed",
            "type": "boolean",
            "default": false
        },
        "lastAnalyzed": {
            "description": "Last time View was analyzed",
            "type": "string",
            "format": "date-time"
        },
        "numRows": {
            "description": "Number of rows",
            "type": "integer"
        },
        "sampleSize": {
            "description": "Analyzed sample size",
            "type": "integer"
        },
        "partitioned": {
            "description": "Indicates whether the index is partitioned",
            "type": "boolean",
            "default": false
        }
    },
    "required": [
        "name",
        "indexType",
        "owner",
        "tableName",
        "status",
        "columns"
    ]
}

INDEXオブジェクト・タイプのJSONスキーマ(level ALL)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/ALL/object_info/index",
    "title": "DBMS_DEVELOPER.GET_METADATA/ALL/OBJECT_INFO/INDEX",
    "description": "Information for index",
    "type": "object",
    "properties": {
        "name": {
            "description": "Index name",
            "type": "string"
        },
        "indexType": {
            "description": "Index Types i.e. CLUSTER, NORMAL, NORMAL/REV, BITMAP, DOMAIN, 
                            LOB, IOT - TOP, FUNCTION-BASED NORMAL, FUNCTION-BASED NORMAL/REV, 
                            FUNCTION-BASED BITMAP, FUNCTION-BASED DOMAIN, VECTOR",
            "type": "string"
        },
        "owner": {
            "description": "Owner of the indexed object",
            "type": "string"
        },
        "tableName": {
            "description": "Name of the indexed object",
            "type": "string"
        },
        "status": {
            "description": "Status",
            "type": {
                 "enum": [
                    "VALID",
                    "INVALID",
                    "INPROGRS",
                    "N/A"
                ]
            }
        },
        "columns": {
            "description": "Index column(s)",
            "type": "array",
            "items": {
                "$ref": "../column"
            }
        },
        "uniqueness": {
            "description": "Uniqueness",
            "type": "string",
            "enum": [
                "UNIQUE",
                "NONUNIQUE"
            ]
        },
        "funcIdxStatus": {
            "description": "Functional index status",
            "type": "string"
        },
        "hasBeenAnalyzed": {
            "description": "Indicates whether index has been analyzed",
            "type": "boolean",
            "default": false
        }, 
        "lastAnalyzed": {
            "description": "Last time View was analyzed",
            "type": "string",
            "format": "date-time"
        },
        "numRows": {
            "description": "Number of rows",
            "type": "integer"
        },
        "sampleSize": {
            "description": "Analyzed sample size",
            "type": "integer"
        },
        "partitioned": {
            "description": "Indicates whether the index is partitioned",
            "type": "boolean",
            "default": false
        },  
        "distinctKeys": {
            "description": "Number of distinct keys in the index",
            "type": "integer"
        },
        "compression": {
            "description": "Compression property of the index: ENABLED, DISABLED, ADVANCED HIGH, ADVANCED LOW",
            "type": "string",
            "enum": [
                "ENABLED",
                "DISABLED",
                "ADVANCED HIGH",
                "ADVANCED LOW"
            ]
        },
        "segmentCreated": {
            "description": "Whether the index segment has been created",
            "type": "string",
            "enum": [
                "YES",
                "NO",
                "N/A"
            ]
        },
        "visibility": {
            "description": "Whether the index is VISIBLE or INVISIBLE to the optimizer",
            "type": "string",
            "enum": [
                "VISIBLE",
                "INVISIBLE"
            ]
        },
        "toBeDropped": {
            "description": "Whether index is dropped and is in Recycle Bin",
            "type": "boolean"
        }
    },
    "required": [
         "name",
         "indexType",
         "owner",
         "tableName",
         "status",
         "columns",
         "partitioned"
         "compression",
         "segmentCreated",
         "visibility",
         "tobeDropped"
   ]
}
62.3.1.1.4 サブオブジェクト・タイプcolumnsのJSONスキーマ

サブオブジェクトcolumnsのbasic、typicalおよびallレベルのJSONスキーマ。

columnsサブオブジェクト・タイプのJSONスキーマ(表形式)

表62-5 COLUMNSサブオブジェクトのJSONスキーマ

フィールド   レベル
    BASIC TYPICAL ALL
name   ✔ ✔ ✔
default   ✔ ✔ ✔
notNull   ✔ ✔ ✔
dataType type ✔ ✔ ✔
precision
length
scale
size
sizeUnits
fractionalSecondsPrecision
yearPrecision
dayPrecision
isPk     ✔ ✔
isUk     ✔ ✔
isFk     ✔ ✔
numDistinct       ✔
lowValue       ✔
highValue       ✔
density       ✔
avgColLen       ✔
hiddenColumn       ✔
virtualColumn       ✔
identityColumn       ✔
encryptedColumn       ✔

ノート:

typeフィールドの値に基づいて、特定のフィールドが必要です。次の表に、各type値の必須フィールドを示します。

COLUMNサブオブジェクト・タイプのJSONスキーマ(level BASIC)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/BASIC/object_info/column",
    "title": "DBMS_DEVELOPER.GET_METADATA/BASIC/OBJECT_INFO/COLUMN",
    "description": "Information for column",
    "type": "object",
    "properties": {
        "name": {
            "description": "Column name",
            "type": "string"
        },
        "notNull": {
            "description": "Not null",
            "type": "boolean",
            "default": false
        },
        "default": {
            "description": "Default value",
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "number"
                }
            ]
        },
        "dataType": {
            "description": "Datatype",
            "type": "object",
            "properties": {
                "type": {
                    "description": "dataType",
                    "type": "string"
                },
                "precision": {
                    "description": "precision",
                    "type": "integer",
                    "minimum": 1
                },
                "scale": {
                    "description": "scale",
                    "type": "integer",
                    "minimum": 0
                },
                "length": {
                    "description": "length",
                    "type": "integer",
                    "minimum": 0
                }, 
                "size": {
                    "description": "size",
                    "type": "integer",
                    "minimum": 1
                },
                "sizeUnits": {
                    "description": "varchar size units",
                    "type": "string",
                    "enum": [
                        "BYTE",
                        "CHAR"
                    ]
                },
                "fractionalSecondsPrecision": {
                    "description": "fractionalSecondsPrecision",
                    "type": "integer"
                },
                "yearPrecision": {
                    "description": "yearPrecision",
                    "type": "integer"
                },
                "dayPrecision": {
                    "description": "dayPrecision",
                    "type": "integer"
                }
            },
            "anyOf": [
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NUMBER"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "precision",
                            "scale"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "FLOAT"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "precision"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "VARCHAR2"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "RAW"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "CHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NCHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "UROWID"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NVARCHAR2"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "enum": [
                                    "TIME",
                                    "TIME WITH TIMEZONE",
                                    "TIMESTAMP",
                                    "TIMESTAMP WITH TIME ZONE",
                                    "TIMESTAMP WITH LOCAL TIME ZONE"
                                ]
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "fractionalSecondsPrecision"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "INTERVAL YEAR TO MONTH"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "yearPrecision"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "INTERVAL DAY TO SECOND"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "dayPrecision",
                            "fractionalSecondsPrecision"
                        ]
                    }
                }
            ]
        }
    },
    "required": [
        "name",
        "dataType",
        "notNull"
    ]
}

COLUMNサブオブジェクト・タイプのJSONスキーマ(level TYPICAL)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/TYPICAL/object_info/column",
    "title": "DBMS_DEVELOPER.GET_METADATA/TYPICAL/OBJECT_INFO/COLUMN",
    "description": "Information for column",
    "type": "object",
    "properties": {
        "name": {
            "description": "Column name",
            "type": "string"
        },
        "default": {
            "description": "Default value",
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "number"
                }
            ]
        },
        "notNull": {
            "description": "Not null",
            "type": "boolean",
            "default": false
        },
        "dataType": {
            "description": "Datatype",
            "type": "object",
            "properties": {
                "type": {
                    "description": "dataType",
                    "type": "string"
                },
                "precision": {
                    "description": "precision",
                    "type": "integer",
                    "minimum": 1
                },
                "scale": {
                    "description": "scale",
                    "type": "integer",
                    "minimum": 0
                },
                "length": {
                    "description": "length",
                    "type": "integer",
                    "minimum": 0
                }, 
                "size": {
                    "description": "size",
                    "type": "integer",
                    "minimum": 1
                },
                "sizeUnits": {
                    "description": "varchar size units",
                    "type": "string",
                    "enum": [
                        "BYTE",
                        "CHAR"
                    ]
                },
                "fractionalSecondsPrecision": {
                    "description": "fractionalSecondsPrecision",
                    "type": "integer"
                },
                "yearPrecision": {
                    "description": "yearPrecision",
                    "type": "integer"
                },
                "dayPrecision": {
                    "description": "dayPrecision",
                    "type": "integer"
                }
            },
            "anyOf": [
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NUMBER"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "precision",
                            "scale"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "FLOAT"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "precision"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "VARCHAR2"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "RAW"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "CHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NCHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "UROWID"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NVARCHAR2"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "enum": [
                                    "TIME",
                                    "TIME WITH TIMEZONE",
                                    "TIMESTAMP",
                                    "TIMESTAMP WITH TIME ZONE",
                                    "TIMESTAMP WITH LOCAL TIME ZONE"
                                ]
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "fractionalSecondsPrecision"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "INTERVAL YEAR TO MONTH"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "yearPrecision"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "INTERVAL DAY TO SECOND"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "dayPrecision",
                            "fractionalSecondsPrecision"
                        ]
                    }
                }
            ]
        },
        "isPk": {
            "description": "Is Primary Key",
            "type": "boolean",
            "default": false
        },
        "isUk": {
            "description": "Is Unique Key",
            "type": "boolean",
            "default": false
        },
        "isFk": {
            "description": "Is Foreign Key",
            "type": "boolean",
            "default": false
        }
    },
    "required": [
        "name",
        "isPk",
        "isUk",
        "isFk",    
        "dataType",
        "notNull"
    ]
}

COLUMNサブオブジェクト・タイプのJSONスキーマ(level ALL)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/19.28/DBMS_DEVELOPER.GET_METADATA/ALL/object_info/column",
    "title": "DBMS_DEVELOPER.GET_METADATA/ALL/OBJECT_INFO/COLUMN",
    "description": "Information for column",
    "type": "object",
    "properties": {
        "name": {
            "description": "Column name",
            "type": "string"
        },
        "default": {
            "description": "Default value",
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "number"
                }
            ]
        },
        "notNull": {
            "description": "Not null",
            "type": "boolean",
            "default": false
        },
        "dataType": {
            "description": "Datatype",
            "type": "object",
            "properties": {
                "type": {
                    "description": "dataType",
                    "type": "string"
                },
                "precision": {
                    "description": "precision",
                    "type": "integer",
                    "minimum": 1
                },
                "scale": {
                    "description": "scale",
                    "type": "integer",
                    "minimum": 0
                },
                "length": {
                    "description": "length",
                    "type": "integer",
                    "minimum": 0
                },
                "size": {
                    "description": "size",
                    "type": "integer",
                    "minimum": 1
                },
                "sizeUnits": {
                    "description": "varchar size units",
                    "type": "string",
                    "enum": [
                        "BYTE",
                        "CHAR"
                    ]
                },
                "fractionalSecondsPrecision": {
                    "description": "fractionalSecondsPrecision",
                    "type": "integer"
                },
                "yearPrecision": {
                    "description": "yearPrecision",
                    "type": "integer"
                },
                "dayPrecision": {
                    "description": "dayPrecision",
                    "type": "integer"
                }
            },
            "anyOf": [
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NUMBER"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "precision",
                            "scale"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "FLOAT"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "precision"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "VARCHAR2"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "RAW"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "CHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NCHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "UROWID"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NVARCHAR2"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "length"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "enum": [
                                    "TIME",
                                    "TIME WITH TIMEZONE",
                                    "TIMESTAMP",
                                    "TIMESTAMP WITH TIME ZONE",
                                    "TIMESTAMP WITH LOCAL TIME ZONE"
                                ]
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "fractionalSecondsPrecision"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "INTERVAL YEAR TO MONTH"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "yearPrecision"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "INTERVAL DAY TO SECOND"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "dayPrecision",
                            "fractionalSecondsPrecision"
                        ]
                    }
                }
            ]
        },
        "isPk": {
            "description": "Is Primary Key",
            "type": "boolean",
            "default": false
        },
        "isUk": {
            "description": "Is Unique Key",
            "type": "boolean",
            "default": false
        },
        "isFk": {
            "description": "Is Foreign Key",
            "type": "boolean",
            "default": false
        },
        "numDistinct": {
            "description": "The number of distinct values in the column",
            "type": "integer"
        },
        "lowValue": {
            "description": "The low value in the column",
            "type": "string"
        },
        "highValue": {
            "description": "The high value in the column",
            "type": "string"
        },
        "density": {
            "description": "The average length of the column in bytes",
            "type": "integer"
        },
        "avgColLen": {
            "description": "The number of distinct values in the column",
            "type": "integer"
        },
        "hiddenColumn": {
            "description": "Indicates whether the column is a hidden column",
            "type": "boolean"
        },
        "virtualColumn": {
            "description": "Indicates whether the column is a virtual column",
            "type": "boolean"
        }
        "identityColumn": {
            "description": "Indicates whether the column is a identity column",
            "type": "boolean"
        },
        "encryptedColumn": {
            "description": "Indicates whether the column is a encrypted column",
            "type": "boolean"
        }
    },
    "required": [
         "name",
         "isPk",
         "isUk",
         "isFk",    
         "dataType",
         "notNull",
         "hiddenColumn",
         "virtualColumn",
         "identityColumn",
         "encryptedColumn"
    ]
}
62.3.1.1.5 サブオブジェクト・タイプconstraintsのJSONスキーマ

サブオブジェクトconstraintsのtypicalおよびallレベルのJSONスキーマ。

constraintsサブオブジェクト・タイプのJSONスキーマ(表形式)

表62-6 サブオブジェクト・タイプCONSTRAINTSのJSONスキーマ

フィールド        
    BASIC TYPICAL ALL
name     ✔ ✔
constraintType     ✔ ✔
searchCondition     ✔ ✔
columns name   ✔ ✔
referencedConstraintName     ✔ ✔
referencedTable     ✔ ✔
action     ✔ ✔
referencedOwner     ✔ ✔
referencedColumns name   ✔ ✔
status     ✔ ✔
deferrable     ✔ ✔
validated     ✔ ✔
sysGeneratedName     ✔ ✔

ノート:

constraintTypeがREFERENTIAL INTEGRITYに設定されている場合、スキーマにはreferencedConstraintName、 referencedOwner、referencedTableおよびreferencedColumnsフィールドが必要です。

CONSTRAINTサブオブジェクト・タイプのJSONスキーマ(level TYPICAL)

ノート:

Constraintスキーマは、BASIC levelでは使用できません。
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.10/DBMS_DEVELOPER.GET_METADATA/TYPICAL/object_info/constraint",
    "title": "DBMS_DEVELOPER.GET_METADATA/TYPICAL/OBJECT_INFO/CONSTRAINT",
    "description": "Information for constraint",
    "type": "object",
    "properties": {
        "name": {
            "description": "Constraint name",
            "type": "string"
        },
        "constraintType": {
            "description": "Type of constraint definition: CHECK, CHECK - NOT NULL, PRIMARY KEY, UNIQUE, 
                            REFERENTIAL INTEGRITY, VIEW CHECK, VIEW READONLY",
            "type": "string"
        },
        "searchCondition": {
            "description": "Text of search condition for a check constraint",
            "type": "string"
        },
        "columns": {
            "description": "Table columns",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "description": "Name associated with column or attribute of object column 
                                        specified in the constraint definition",
                        "type": "string"
                    }
                }
            }
        },
        "referencedConstraintName": {
            "description": "Name of unique constraint definition for Referenced table",
            "type": "string"
        },
        "referencedTable": {
            "description": "Name of table used in referential constraint",
            "type": "string"
        },
        "action": {
            "description": "On delete rule",
            "type": {
                "enum": [
                    "RESTRICT",
                    "CASCADE",
                    "SET NULL",
                    "SET DEFAULT"
                ]
            }
        }, 
        "referencedOwner": {
            "description": "Owner of table used in referential constraint",
            "type": "string"
        },
        "referencedColumns": {
            "description": "Referenced table columns",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "description": "Referenced table column name",
                        "type": "string"
                    }
                }
            }
        },
        "status": {
            "description": "Constraint status",
            "type": {
                "enum": [
                    "ENABLED",
                    "DISABLED"
                ]
            }
        },
        "deferrable": {
            "description": "Deferrable",
            "type": "boolean",
            "default": false
        },
        "validated": {
            "description": "Validated",
            "type": {
                "enum": [
                    "VALIDATED",
                    "NOT VALIDATED"
                ]
            }
        },
        "sysGeneratedName": {
            "description": "System Generated constraint",
            "type": "boolean"
        }
    },
    "required": [
        "name",
        "constraintType",
        "status",
        "deferrable",
        "validated",
        "sysGeneratedName"
    ],
    "if": {
        "properties": {
            "constraintType": {
                "const": "REFERENTIAL INTEGRITY"
             }
         }
    },
    "then": {
        "required": [
            "referencedConstraintName",
             "referencedOwner",
             "referencedTable",
             "referencedColumns"
         ]
    }
}

CONSTRAINTサブオブジェクト・タイプのJSONスキーマ(level ALL)

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.10/DBMS_DEVELOPER.GET_METADATA/ALL/object_info/constraint",
    "title": "DBMS_DEVELOPER.GET_METADATA/ALL/OBJECT_INFO/CONSTRAINT",
    "description": "Information for constraint",
    "type": "object",
     "properties": {
        "name": {
            "description": "Constraint name",
            "type": "string"
        },
        "constraintType": {
            "description": "Type of constraint definition",
            "type": "string"
        },
        "searchCondition": {
            "description": "Text of search condition for a check constraint",
            "type": "string"
        },
        "columns": {
            "description": "Table columns",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "description": "Name associated with column or attribute of object column 
                                        specified in the constraint definition",
                        "type": "string"
                    },
                    "position": {
                        "description": "Original position of column or attribute in definition",
                        "type": "integer"
                    }
                }
            }
        },
        "referencedConstraintName": {
            "description": "Name of unique constraint definition for Referenced table",
            "type": "string"
        },
        "referencedTable": {
            "description": "Name of table used in referential constraint",
            "type": "string"
        },
        "action": {
            "description": "On delete rule",
            "type": {
                "enum": [
                     "RESTRICT",
                     "CASCADE",
                     "SET NULL",
                     "SET DEFAULT"
                ]
            }
        },
        "referencedOwner": {
            "description": "Owner of table used in referential constraint",
            "type": "string"
        },
        "referencedColumns": {
            "description": "Referenced table columns",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "description": "Referenced table column name",
                        "type": "string"
                    },
                    "position": {
                        "description": "Original position of column or attribute in definition",
                        "type": "integer"
                    }
                }
            }
        },
        "status": {
            "description": "Constraint status",
            "type": {
                "enum": [
                    "ENABLED",
                    "DISABLED"
                ]
            }
        },
        "deferrable": {
            "description": "Deferrable",
            "type": "boolean",
            "default": false
        },
        "validated": {
            "description": "Validated",
            "type": {
                "enum": [
                    "VALIDATED",
                    "NONVALIDATED"
                ]
            }
        },
        "sysGeneratedName": {
            "description": "System Generated constraint",
            "type": "boolean"
        }
    },
    "required": [
         "name",
         "constraintType"
    ],
    "if": {
         "properties": {
              "constraintType": {
                    "const": "REFERENTIAL INTEGRITY"
               }
          }
    },
    "then": {
         "required": [
              "referencedConstraintName",
              "referencedOwner",
              "referencedTable",
              "referencedColumns"
         ]
    }
}