76 DBMS_DEVELOPER

パッケージDBMS_DEVELOPERは、データベース・オブジェクトに関する情報を取得するためのシンプルで開発者が使いやすいメソッドを提供します。

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

DBMS_DEVELOPERの概要

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

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

DBMS_DEVELOPERには、次の利点があります:

  • パフォーマンス : 情報は数ミリ秒以内に取得されます。

  • シンプルさ : DBMS_DEVELOPERは、XMLから離れて、シンプルで包括的なJSONを利用します。 このパッケージは、非特権ユーザーが読み取り権を持っているすべてのオブジェクトに関する情報を取得するメソッドを提供します。

DBMS_DEVELOPERセキュリティ

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

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

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

  • 表およびビュー: 表またはビューに対するSELECTまたはREAD権限が必要です。
  • 索引: 索引が定義されている表に対するSELECTまたはREAD権限が必要です。
  • シノニム: シノニムに対するSELECTまたはREAD権限が必要です。

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

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

DBMS_DEVELOPERサブプログラムの要約

この表では、DBMS_DEVELOPERサブプログラムをリストし、簡単に説明します。

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

GET_METADATAファンクション

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

このファンクションは、オブジェクトに関する情報を取得し、そのオブジェクトの対応するメタデータを含むJSONドキュメントを生成します。

構文

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 JSON;

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

フィールド

name

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

schema

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

object_type

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

サポートされている値: TABLEINDEXおよび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. BASICに設定され、object_typeTABLEに設定されたlevelのメタデータの取得 :
    SQL> conn hr/hr
    Connected.
    SQL>
    SQL> select DBMS_DEVELOPER.GET_METADATA(object_type => 'TABLE', name => 'EMPLOYEES', level => 'BASIC');

    この問合せを実行すると、次のJSONドキュメントが生成されます:

    {
        "etag": "113059749145936325402354257176981405696",
        "objectType": "TABLE",
        "objectInfo": {
            "schema": "HR",
            "name": "EMPLOYEES",
            "columns": [
                {
                    "name": "EMPLOYEE_ID",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 5,
                        "scale": 0
                    },
                    "notNull": true
                },
                {
                    "name": "FIRST_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 20,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": false
                },
                {
                    "name": "LAST_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 25,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "EMAIL",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 25,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "PHONE_NUMBER",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 20,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": false
                },
                {
                    "name": "HIRE_DATE",
                    "dataType": "DATE",
                    "notNull": true
                },
                {
                    "name": "JOB_ID",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 10,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "SALARY",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 8,
                        "scale": 2
                    },
                    "notNull": false
                },
                {
                    "name": "COMISSION_PCT",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 2,
                        "scale": 0
                    },
                    "notNull": false
                },
                {
                    "name": "MANAGER_ID",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 6,
                        "scale": 0
                    },
                    "notNull": false
                },
                {
                    "name": "DEPARTMENT_ID",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 4,
                        "scale": 0
                    },
                    "notNull": false
                }
            ]
        }
    }
  2. TYPICALに設定され、object_typeVIEWに設定されたlevelのメタデータの取得 :
    SQL> conn hr/hr
    Connected.
    SQL>
    SQL> select DBMS_DEVELOPER.GET_METADATA(object_type => 'VIEW', name => 'EMP_DETAILS_VIEW', level => 'TYPICAL');

    この問合せを実行すると、次のJSONドキュメントが生成されます:

    {
        "etag": "113059749145936325402354257176981405696",
        "objectType": "VIEW",
        "objectInfo": {
            "name": "EMP_DETAILS_VIEW",
            "schema": "HR",
            "readOnly": true,
            "dualityView": false
            "columns": [
                {
                    "name": "EMPLOYEE_ID",
                    "isPk": true,
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 5,
                        "scale": 0
                    },
                    "notNull": true
                },
                {
                    "name": "JOB_ID",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 10,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "MANAGER_ID",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 6,
                        "scale": 0
                    },
                    "notNull": false
                },
                {
                    "name": "DEPARTMENT_ID",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 4,
                        "scale": 0
                    },
                    "notNull": false
                },
                {
                    "name": "LOCATION_ID",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 4,
                        "scale": 0
                    },
                    "notNull": false
                },
                {
                    "name": "COUNTRY_ID",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 2,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "FIRST_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 20,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": false
                },
                {
                    "name": "LAST_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 25,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true,
                    "comments": "Last name."
                },
                {
                    "name": "SALARY",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 8,
                        "scale": 2
                    },
                    "notNull": false
                },
                {
                    "name": "COMISSION_PCT",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 2,
                        "scale": 0
                    },
                    "notNull": false
                },
                {
                    "name": "DEPARTMENT_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 30,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "JOB_TITLE",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 35,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "CITY",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 30,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "STATE_PROVINCE",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 25,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": false
                },
                {
                    "name": "COUNTRY_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 40,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": false
                },
                {
                    "name": "REGION_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 25,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": false
                }
            ],
            "constraints": [
                {
                    "name" : "SYS_C008649",
                    "constraintType" : "VIEW READONLY",
                    "status" : "ENABLE",
                    "deferrable" : false,
                    "validated" : "NON VALIDATED",
                    "sysGeneratedName" : true
                }
            ],
            "annotations": [
                {
                    "Category": "EmpdetailsInfo"
                },
                {
                    "Display": "Normal"
                }
            ]
        }
    }
  3. ALLに設定され、object_typeVIEWに設定されたlevelのメタデータの取得 :
    SQL> conn hr/hr
    Connected.
    SQL>
    SQL> select DBMS_DEVELOPER.GET_METADATA(object_type => 'VIEW', name => 'EMP_DETAILS_VIEW', level => 'ALL');
    {
        "etag": "113059749145936325402354257176981405696",
        "objectType": "VIEW",
        "objectInfo": {
            "name": "EMP_DETAILS_VIEW",
            "schema": "HR",
            "readOnly": true,
            "dualityView": false,
            "editioningView" : false,
            "columns": [
                {
                    "name": "EMPLOYEE_ID",
                    "isPk": true,
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 5,
                        "scale": 0
                    },
                    "notNull": true
                },
                {
                    "name": "JOB_ID",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 10,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "MANAGER_ID",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 6,
                        "scale": 0
                    },
                    "notNull": false
                },
                {
                    "name": "DEPARTMENT_ID",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 4,
                        "scale": 0
                    },
                    "notNull": false
                },
                {
                    "name": "LOCATION_ID",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 4,
                        "scale": 0
                    },
                    "notNull": false
                },
                {
                    "name": "COUNTRY_ID",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 2,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "FIRST_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 20,
                        "sizeUnits": "BYTE"
                    },
                    "not_null": false
                },
                {
                    "name": "LAST_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 25,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "SALARY",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 8,
                        "scale": 2
                    },
                    "notNull": false
                },
                {
                    "name": "COMISSION_PCT",
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 2,
                        "scale": 0
                    },
                    "notNull": false
                },
                {
                    "name": "DEPARTMENT_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 30,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "JOB_TITLE",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 35,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "CITY",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 30,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": true
                },
                {
                    "name": "STATE_PROVINCE",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 25,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": false
                },
                {
                    "name": "COUNTRY_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 40,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": false
                },
                {
                    "name": "REGION_NAME",
                    "dataType": {
                        "type": "VARCHAR2",
                        "size": 25,
                        "sizeUnits": "BYTE"
                    },
                    "notNull": false
                }
            ],
            "constraints": [
                {
                    "name" : "SYS_C008649",
                    "constraintType" : "VIEW READONLY",
                    "status" : "ENABLE",
                    "deferrable" : false,
                    "validated" : "NON VALIDATED",
                    "sysGeneratedName" : true
                }
            ],
            "annotations": [
                {
                    "Category": "EmpdetailsInfo"
                },
                {
                    "Display": "Normal"
                }
            ]
        }
    }
    
  4. ALLに設定され、object_typeINDEXに設定されたlevelのメタデータの取得 :
    SQL> conn hr/hr
    Connected.
    SQL>
    SQL> select DBMS_DEVELOPER.GET_METADATA(object_type => 'INDEX', name => 'EMP_EMP_ID_PK', level => 'ALL');

    この問合せを実行すると、次のJSONドキュメントが生成されます:

    {
        "etag": "113059749145936325402354257176981405696",
        "objectType": "INDEX",
        "objectInfo": {
            "name": "EMP_EMP_ID_PK",
            "indexType": "NORMAL",
            "Owner": "HR",
            "tableName": "EMPLOYEES",
            "uniqueness": "UNIQUE",
            "status": "VALID",
            "lastAnalyzed": "2024-06-19T18:25:43.511Z",
            "numRows": 107,
            "distinctKeys": 107,
            "sampleSize": 107,
            "compression": "DISABLE",
            "visibility": "VISIBLE",
            "toBeDropped": false,
            "columns": [
                {
                    "name": "EMPLOYEE_ID",
                    "isPk": true,
                    "isUk": true, 
                    "isFk": false, 
                    "dataType": {
                        "type": "NUMBER",
                        "precision": 5,
                        "scale": 0
                    },
                    "numDistinct": 107,
                    "lowValue": "100",
                    "highValue": "206",
                    "density": 0.00934579439252336,
                    "avgColLength": 4
                }
            ],
            "annotations": [
                {
                    "Category": "EMP_EMP_ID_PKinfo"
                },
                {
                    "Display": "Normal"
                }
            ]
        }
    }
  5. levelおよびobject_typeが明示的に指定されていないメタデータの取得:
    SQL> conn hr/hr
    Connected.
    SQL>
    SQL> select dbms_developer.get_metadata(name => 'EMPLOYEES');

    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-01-06T12:57:19",
        "numRows" : 107,
        "sampleSize" : 107,
        "avgRowLen" : 69,
        "indexes" :
        [
          {
            "name" : "EMP_EMAIL_UK",
            "indexType" : "NORMAL",
            "uniqueness" : "UNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-01-06T12:57:19",
            "numRows" : 107,
            "sampleSize" : 107,
            "columns" :
            [
              {
                "name" : "EMAIL"
              }
            ]
          },
          {
            "name" : "EMP_EMP_ID_PK",
            "indexType" : "NORMAL",
            "uniqueness" : "UNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-01-06T12:57:20",
            "numRows" : 107,
            "sampleSize" : 107,
            "columns" :
            [
              {
                "name" : "EMPLOYEE_ID"
              }
            ]
          },
          {
            "name" : "EMP_DEPARTMENT_IX",
            "indexType" : "NORMAL",
            "uniqueness" : "NONUNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-01-06T12:57:20",
            "numRows" : 106,
            "sampleSize" : 106,
            "columns" :
            [
              {
                "name" : "DEPARTMENT_ID"
              }
            ]
          },
          {
            "name" : "EMP_JOB_IX",
            "indexType" : "NORMAL",
            "uniqueness" : "NONUNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-01-06T12:57:20",
            "numRows" : 107,
            "sampleSize" : 107,
            "columns" :
            [
              {
                "name" : "JOB_ID"
              }
            ]
          },
          {
            "name" : "EMP_MANAGER_IX",
            "indexType" : "NORMAL",
            "uniqueness" : "NONUNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-01-06T12:57:20",
            "numRows" : 106,
            "sampleSize" : 106,
            "columns" :
            [
              {
                "name" : "MANAGER_ID"
              }
            ]
          },
          {
            "name" : "EMP_NAME_IX",
            "indexType" : "NORMAL",
            "uniqueness" : "NONUNIQUE",
            "status" : "VALID",
            "lastAnalyzed" : "2025-01-06T12:57:20",
            "numRows" : 107,
            "sampleSize" : 107,
            "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" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMAIL_NN",
            "constraintType" : "CHECK - NOT NULL",
            "searchCondition" : "\"EMAIL\" IS NOT NULL",
            "columns" :
            [
              {
                "name" : "EMAIL"
              }
            ],
            "status" : "ENABLE",
            "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" : "ENABLE",
            "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" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_SALARY_MIN",
            "constraintType" : "CHECK",
            "searchCondition" : "salary > 0",
            "columns" :
            [
              {
                "name" : "SALARY"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMAIL_UK",
            "constraintType" : "UNIQUE",
            "columns" :
            [
              {
                "name" : "EMAIL"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMP_ID_PK",
            "constraintType" : "PRIMARY KEY",
            "columns" :
            [
              {
                "name" : "EMPLOYEE_ID"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "Action" : "RESTRICT",
            "referencedConstraintName" : "DEPT_ID_PK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "DEPARTMENT_ID"
              }
            ],
            "referencedColumns" :
            [
              {
                "name" : "DEPARTMENT_ID"
              }
            ],
            "sysGeneratedName" : false,
            "deferrable" : false,
            "referencedOwner" : "HR",
            "referencedTable" : "DEPARTMENTS",
            "name" : "EMP_DEPT_FK",
            "status" : "ENABLE",
            "validated" : "VALIDATED"
          },
          {
            "Action" : "RESTRICT",
            "referencedConstraintName" : "JOB_ID_PK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "JOB_ID"
              }
            ],
            "referencedColumns" :
            [
              {
                "name" : "JOB_ID"
              }
            ],
            "sysGeneratedName" : false,
            "deferrable" : false,
            "referencedOwner" : "HR",
            "referencedTable" : "JOBS",
            "name" : "EMP_JOB_FK",
            "status" : "ENABLE",
            "validated" : "VALIDATED"
          },
          {
            "Action" : "RESTRICT",
            "referencedConstraintName" : "EMP_EMP_ID_PK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "MANAGER_ID"
              }
            ],
            "referencedColumns" :
            [
              {
                "name" : "EMPLOYEE_ID"
              }
            ],
            "sysGeneratedName" : false,
            "deferrable" : false,
            "referencedOwner" : "HR",
            "referencedTable" : "EMPLOYEES",
            "name" : "EMP_MANAGER_FK",
            "status" : "ENABLE",
            "validated" : "VALIDATED"
          }
        ]
      },
      "etag" : "CBBE5B271EEBB4C0C97FCFB047C233DD"
    }
    
  6. 指定されたetagが現在のetagと一致した場合にメタデータを取得すると、空のドキュメントが返されます :
    SQL> conn hr/hr
    Connected.
    SQL>
    SQL> select dbms_developer.get_metadata(name => 'EMPLOYEES', etag => 'CBBE5B271EEBB4C0C97FCFB047C233DD');
    この問合せを実行すると、空のJSONドキュメントが生成されます :
    {
    }
異なるオブジェクト型およびサブオブジェクト型のJSONスキーマ

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

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

オブジェクト型のJSONスキーマ : TABLE

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

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

表76-2 オブジェクト型のJSONスキーマ : TABLE

FIELDS     LEVELS
      BASIC TYPICAL ALL

name

   

schema

   

columns

   

lastAnalyzed

     

hasBeenAnalyzed

     

numRows

     

sampleSize

     

avgRowLen

     

索引

     

制約

     

annotations

     

segmentCreated

       

inMemory

       

圧縮

       

ノート:

サブオブジェクトcolumnsおよびconstraintsのフィールドは、levelの選択に応じて異なります。 サブオブジェクトcolumnsに存在するフィールドの詳細は、この項を参照してください : サブオブジェクト型のJSONスキーマ : columns. サブオブジェクトconstraintsに存在するフィールドの詳細は、この項を参照してください : サブオブジェクト型のJSONスキーマ : constraints.

level BASICTABLEオブジェクト型のJSONスキーマ

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.7/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"
    ]
}

level TYPICALTABLEオブジェクト型のJSONスキーマ

{
    "etag": "113059749145936325402354257176981405696",
    "objectType": "TABLE",
    "objectInfo": {
        "schema": "HR",
        "name": "EMPLOYEES",
        "lastAnalyzed": "2024-06-14T18:25:43.511Z",
        "numRows": 107,
        "sampleSize": 107,
        "columns": [
            {
                "name": "EMPLOYEE_ID",
                "isPk": true,
                "isUk": true,
                "isFk": false,
                "dataType": {
                    "type": "NUMBER",
                    "precision": 5,
                    "scale": 0
                },
                "notNull": true
            },
            {
                "name": "FIRST_NAME",
                "isPk": false,
                "isUk": false,
                "isFk": false,
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 20,
                    "sizeUnits": "BYTE"
                },
                "notNull": false
            },
            {
                "name": "LAST_NAME",
                "isPk": false,
                "isUk": false,
                "isFk": false,
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 25,
                    "sizeUnits": "BYTE"
                },
                "notNull": true
            },
            {
                "name": "EMAIL",
                "isPk": false,
                "isUk": true,
                "isFk": false,
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 25,
                    "sizeUnits": "BYTE"
                },
                "notNull": true
            },
            {
                "name": "PHONE_NUMBER",
                "isPk": false,
                "isUk": false,
                "isFk": false,
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 20,
                    "sizeUnits": "BYTE"
                },
                "notNull": false
            },
            {
                "name": "HIRE_DATE",
                "isPk": false,
                "isUk": false,
                "isFk": false,
                "dataType": "DATE",
                "notNull": true
            },
            {
                "name": "JOB_ID",
                "isPk": false,
                "isUk": false,
                "isFk": true,
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 10,
                    "sizeUnits": "BYTE"
                },
                "notNull": true
            },
            {
                "name": "SALARY",
                "isPk": false,
                "isUk": false,
                "isFk": false, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 8,
                    "scale": 2
                },
                "notNull": false
            },
            {
                "name": "COMISSION_PCT",
                "isPk": false,
                "isUk": false,
                "isFk": false, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 2,
                    "scale": 0
                },
                "notNull": false
            },
            {
                "name": "MANAGER_ID",
                "isPk": false,
                "isUk": false,
                "isFk": true, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 6,
                    "scale": 0
                },
                "notNull": false
            },
            {
                "name": "DEPARTMENT_ID",
                "isPk": false,
                "isUk": false,
                "isFk": true, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 4,
                    "scale": 0
                },
                "notNull": false
            }
        ],
        "indexes": [
            {
                "name": "HR.EMP_JOB_IX",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "columns": [
                    {
                        "name": "JOB_ID"
                    }
                ]
            },
            {
                "name": "HR.EMP_NAME_IX",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "columns": [
                    {
                        "name": "FIRST_NAME"
                    },
                    {
                        "name": "LAST_NAME"
                    }
                ]
            },
            {
                "name": "HR.EMP_EMAIL_UK",
                "uniqueness": "UNIQUE",
                "status": "VALID",
                "columns": [
                    {
                        "name": "EMAIL"
                    }
                ]
            },
            {
                "name": "HR.EMP_EMP_ID_PK",
                "uniqueness": "UNIQUE",
                "status": "VALID",
                "columns": [
                    {
                        "name": "EMPLOYEE_ID"
                    }
                ]
            },
            {
                "name": "HR.EMP_MANAGER_IX",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "columns": [
                    {
                        "name": "MANAGER_ID"
                    }
                ]
            },
            {
                "name": "HR.EMP_DEPARTMENT_IX",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "columns": [
                    {
                        "name": "DEPARTMENT_ID"
                    }
                ]
            }
        ],
        "constraints":
        [
          {
            "name" : "EMP_LAST_NAME_NN",
            "constraintType" : "CHECK - NOT NULL",
            "searchCondition" : "\"LAST_NAME\" IS NOT NULL",
            "columns" :
            [
              {
                "name" : "LAST_NAME"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMAIL_NN",
            "constraintType" : "CHECK - NOT NULL",
            "searchCondition" : "\"EMAIL\" IS NOT NULL",
            "columns" :
            [
              {
                "name" : "EMAIL"
              }
            ],
            "status" : "ENABLE",
            "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" : "ENABLE",
            "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" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_SALARY_MIN",
            "constraintType" : "CHECK",
            "searchCondition" : "salary > 0",
            "columns" :
            [
              {
                "name" : "SALARY"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMAIL_UK",
            "constraintType" : "UNIQUE",
            "columns" :
            [
              {
                "name" : "EMAIL"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMP_ID_PK",
            "constraintType" : "PRIMARY KEY",
            "columns" :
            [
              {
                "name" : "EMPLOYEE_ID"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "Action" : "RESTRICT",
            "referencedConstraintName" : "DEPT_ID_PK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "DEPARTMENT_ID"
              }
            ],
            "referencedColumns" :
            [
              {
                "name" : "DEPARTMENT_ID"
              }
            ],
            "sysGeneratedName" : false,
            "deferrable" : false,
            "referencedOwner" : "HR",
            "referencedTable" : "DEPARTMENTS",
            "name" : "EMP_DEPT_FK",
            "status" : "ENABLE",
            "validated" : "VALIDATED"
          },
          {
            "Action" : "RESTRICT",
            "referencedConstraintName" : "JOB_ID_PK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "JOB_ID"
              }
            ],
            "referencedColumns" :
            [
              {
                "name" : "JOB_ID"
              }
            ],
            "sysGeneratedName" : false,
            "deferrable" : false,
            "referencedOwner" : "HR",
            "referencedTable" : "JOBS",
            "name" : "EMP_JOB_FK",
            "status" : "ENABLE",
            "validated" : "VALIDATED"
          },
          {
            "Action" : "RESTRICT",
            "referencedConstraintName" : "EMP_EMP_ID_PK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "MANAGER_ID"
              }
            ],
            "referencedColumns" :
            [
              {
                "name" : "EMPLOYEE_ID"
              }
            ],
            "sysGeneratedName" : false,
            "deferrable" : false,
            "referencedOwner" : "HR",
            "referencedTable" : "EMPLOYEES",
            "name" : "EMP_MANAGER_FK",
            "status" : "ENABLE",
            "validated" : "VALIDATED"
          }
        ],
        "annotations": [
            {
                "Category": "EmpInfo"
            },
            {
                "Display": "Normal"
            }
        ]
    }
}

level ALLTABLEオブジェクト型のJSONスキーマ

{
    "etag": "98D8203DF79ECF4207BCCC91FEF81515",
    "objectType": "TABLE",
    "objectInfo": {
        "schema": "HR",
        "name": "EMPLOYEES",
        "lastAnalyzed": "2024-06-14T18:25:43.511Z",
        "numRows": 107,
        "sampleSize": 107,
        "commpression": false,
        "avgRowLen": 69,
        "segmentCreated": "YES",
        "inMemory": "ENABLED",
        "columns": [
            {
                "name": "EMPLOYEE_ID",
                "isPk": true,
                "isUk": true,
                "isFk": false, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 5,
                    "scale": 0
                },
                "notNull": true,
                "numDistinct": 107,
                "lowValue": "100",
                "highValue": "206",
                "density": 0.00934579439252336,
                "avgColLength": 4
            },
            {
                "name": "FIRST_NAME",
                "isPk": false,
                "isUk": false,
                "isFk": false, 
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 20,
                    "sizeUnits": "BYTE"
                },
                "notNull": true,
                "numDistinct": 91,
                "lowValue": "Adam",
                "highValue": "Winston",
                "density": 0.010989010989011,
                "avgColLength": 7
            },
            {
                "name": "LAST_NAME",
                "isPk": false,
                "isUk": false,
                "isFk": false, 
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 25,
                    "sizeUnits": "BYTE"
                },
                "notNull": true,
                "numDistinct": 102,
                "lowValue": "Abel",
                "highValue": "Zlotkey",
                "density": 0.00980392156862745,
                "avgColLength": 8
            },
            {
                "name": "EMAIL",
                "isPk": false,
                "isUk": true,
                "isFk": false, 
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 25,
                    "sizeUnits": "BYTE"
                },
                "notNull": true,
                "numDistinct": 107,
                "lowValue": "ABANDA",
                "highValue": "WTAYLOR",
                "density": 0.00934579439252336,
                "avgColLength": 8
            },
            {
                "name": "PHONE_NUMBER",
                "isPk": false,
                "isUk": false,
                "isFk": false, 
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 20,
                    "sizeUnits": "BYTE"
                },
                "notNull": false,
                "numDistinct": 107,
                "lowValue": "011.44.1343.329268",
                "highValue": "650.509.4876",
                "density": 0.00934579439252336,
                "avgColLength": 15
            },
            {
                "name": "HIRE_DATE",
                "isPk": false,
                "isUk": false,
                "isFk": false, 
                "dataType": "DATE",
                "notNull": true,
                "numDistinct": 98,
                "lowValue": "2001.01.13.00.00.00",
                "highValue": "2008.04.21.00.00.00",
                "density": 0.0102040816326531,
                "avgColLength": 8
            },
            {
                "name": "JOB_ID",
                "isPk": false,
                "isUk": false,
                "isFk": true, 
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 10,
                    "sizeUnits": "BYTE"
                },
                "notNull": true,
                "numDistinct": 19,
                "lowValue": "AC_ACCOUNT",
                "highValue": "ST_MAN",
                "density": 0.00467289719626168,
                "avgColLength": 9
            },
            {
                "name": "SALARY",
                "isPk": false,
                "isUk": false,
                "isFk": false, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 8,
                    "scale": 2
                },
                "notNull": false,
                "numDistinct": 58,
                "lowValue": "2100",
                "highValue": "24000",
                "density": 0.0172413793103448,
                "avgColLength": 4
            },
            {
                "name": "COMISSION_PCT",
                "isPk": false,
                "isUk": false,
                "isFk": false, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 2,
                    "scale": 0
                },
                "notNull": false,
                "numDistinct": 7,
                "lowValue": ".1",
                "highValue": ".4",
                "density": 0.142857142857143,
                "avgColLength": 2
            },
            {
                "name": "MANAGER_ID",
                "isPk": false,
                "isUk": false,
                "isFk": true, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 6,
                    "scale": 0
                },
                "notNull": false,
                "numDistinct": 18,
                "lowValue": "100",
                "highValue": "205",
                "density": 0.00471698113207547,
                "avgColLength": 4
            },
            {
                "name": "DEPARTMENT_ID",
                "isPk": false,
                "isUk": false,
                "isFk": true, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 4,
                    "scale": 0
                },
                "notNull": false,
                "numDistinct": 11,
                "lowValue": "10",
                "highValue": "110",
                "density": "0.00471698113207547",
                "avgColLength": 3
            }
        ],
        "indexes": [
            {
                "name": "HR.EMP_JOB_IX",
                "indexType": "NORMAL",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "numRows": 107,
                "distinctKeys": 19,
                "lastAnalyzed": "2024-06-14T18:25:43.511Z",
                "compression": "DISABLED",
                "segmentCreated": "YES",
                "visibility": "VISIBLE",
                "columns": [
                    {
                        "name": "JOB_ID"
                    }
                ]
            },
            {
                "name": "HR.EMP_NAME_IX",
                "indexType": "NORMAL",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "numRows": 107,
                "distinctKeys": 107,
                "lastAnalyzed": "2024-06-14T18:25:43.511Z",
                "compression": "DISABLED",
                "segmentCreated": "YES",
                "visibility": "VISIBLE",
                "columns": [
                    {
                        "name": "FIRST_NAME"
                    },
                    {
                        "name": "LAST_NAME"
                    }
                ]
            },
            {
                "name": "HR.EMP_EMAIL_UK",
                "indexType": "NORMAL",
                "uniqueness": "UNIQUE",
                "status": "VALID",
                "numRows": 107,
                "distinctKeys": 107,
                "lastAnalyzed": "2024-06-14T18:25:43.511Z",
                "compression": "DISABLED",
                "segmentCreated": "YES",
                "visibility": "VISIBLE",
                "columns": [
                    {
                        "name": "EMAIL"
                    }
                ]
            },
            {
                "name": "HR.EMP_EMP_ID_PK",
                "indexType": "NORMAL",
                "uniqueness": "UNIQUE",
                "status": "VALID",
                "numRows": 107,
                "distinctKeys": 107,
                "lastAnalyzed": "2024-06-14T18:25:43.511Z",
                "compression": "DISABLED",
                "segmentCreated": "YES",
                "visibility": "VISIBLE",
                "columns": [
                    {
                        "name": "EMPLOYEE_ID"
                    }
                ]
            },
            {
                "name": "HR.EMP_MANAGER_IX",
                "indexType": "NORMAL",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "numRows": 106,
                "distinctKeys": 18,
                "lastAnalyzed": "2024-06-14T18:25:43.511Z",
                "compression": "DISABLED",
                "segmentCreated": "YES",
                "visibility": "VISIBLE",
                "columns": [
                    {
                        "name": "MANAGER_ID"
                    }
                ]
            },
            {
                "name": "HR.EMP_DEPARTMENT_IX",
                "indexType": "NORMAL",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "numRows": 106,
                "distinctKeys": 11,
                "lastAnalyzed": "2024-06-14T18:25:43.511Z",
                "compression": "DISABLED",
                "segmentCreated": "YES",
                "visibility": "VISIBLE",
                "columns": [
                    {
                        "name": "DEPARTMENT_ID"
                    }
                ]
            }
        ],
        "constraints":
        [
          {
            "name" : "EMP_LAST_NAME_NN",
            "constraintType" : "CHECK - NOT NULL",
            "searchCondition" : "\"LAST_NAME\" IS NOT NULL",
            "columns" :
            [
              {
                "name" : "LAST_NAME"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMAIL_NN",
            "constraintType" : "CHECK - NOT NULL",
            "searchCondition" : "\"EMAIL\" IS NOT NULL",
            "columns" :
            [
              {
                "name" : "EMAIL"
              }
            ],
            "status" : "ENABLE",
            "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" : "ENABLE",
            "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" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_SALARY_MIN",
            "constraintType" : "CHECK",
            "searchCondition" : "salary > 0",
            "columns" :
            [
              {
                "name" : "SALARY"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMAIL_UK",
            "constraintType" : "UNIQUE",
            "columns" :
            [
              {
                "name" : "EMAIL"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "name" : "EMP_EMP_ID_PK",
            "constraintType" : "PRIMARY KEY",
            "columns" :
            [
              {
                "name" : "EMPLOYEE_ID"
              }
            ],
            "status" : "ENABLE",
            "deferrable" : false,
            "validated" : "VALIDATED",
            "sysGeneratedName" : false
          },
          {
            "Action" : "RESTRICT",
            "referencedConstraintName" : "DEPT_ID_PK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "DEPARTMENT_ID"
              }
            ],
            "referencedColumns" :
            [
              {
                "name" : "DEPARTMENT_ID"
              }
            ],
            "sysGeneratedName" : false,
            "deferrable" : false,
            "referencedOwner" : "HR",
            "referencedTable" : "DEPARTMENTS",
            "name" : "EMP_DEPT_FK",
            "status" : "ENABLE",
            "validated" : "VALIDATED"
          },
          {
            "Action" : "RESTRICT",
            "referencedConstraintName" : "JOB_ID_PK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "JOB_ID"
              }
            ],
            "referencedColumns" :
            [
              {
                "name" : "JOB_ID"
              }
            ],
            "sysGeneratedName" : false,
            "deferrable" : false,
            "referencedOwner" : "HR",
            "referencedTable" : "JOBS",
            "name" : "EMP_JOB_FK",
            "status" : "ENABLE",
            "validated" : "VALIDATED"
          },
          {
            "Action" : "RESTRICT",
            "referencedConstraintName" : "EMP_EMP_ID_PK",
            "constraintType" : "REFERENTIAL INTEGRITY",
            "columns" :
            [
              {
                "name" : "MANAGER_ID"
              }
            ],
            "referencedColumns" :
            [
              {
                "name" : "EMPLOYEE_ID"
              }
            ],
            "sysGeneratedName" : false,
            "deferrable" : false,
            "referencedOwner" : "HR",
            "referencedTable" : "EMPLOYEES",
            "name" : "EMP_MANAGER_FK",
            "status" : "ENABLE",
            "validated" : "VALIDATED"
          }
        ], 
        "annotations": [
            {
                "Category": "EmpInfo"
            },
            {
                "Display": "Normal"
            }
        ]
    }
}
オブジェクト型のJSONスキーマ : VIEW

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

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

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

フィールド     LEVELS
      BASIC TYPICAL ALL
name    
schema    
columns    
readOnly      
dualityView      
制約      
annotations      
editioningView        

ノート:

サブオブジェクトcolumnsおよびconstraintsのフィールドは、levelの選択に応じて異なります。 サブオブジェクトcolumnsに存在するフィールドの詳細は、この項を参照してください : サブオブジェクト型のJSONスキーマ : columns. サブオブジェクトconstraintsに存在するフィールドの詳細は、この項を参照してください : サブオブジェクト型のJSONスキーマ : constraints.

level BASICVIEWオブジェクト型のJSONスキーマ

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.7/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"
        ]
    }
}

level TYPICALVIEWオブジェクト型のJSONスキーマ

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.7/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"
        },
        "readOnly": {
            "description": "An indicator of whether the view is a Read Only View",
            "type": "boolean",
            "default": true
        },
        "dualityView": {
            "description": "Whether the view is a JSON Duality View or not",
            "type": "boolean",
            "default": false
        },
        "columns": {
            "description": "View columns",
            "type": "array",
            "items": {
                "$ref": "../column"
            }
        },
        "annotations": {
            "description": "View annotations",
            "type": "array",
            "items": {
                "$ref": "../annotation"
            }
        },
        "constraints": {
            "description": "View constraints",
            "type": "array",
            "items": {
                "$ref": "../constraint"
            }
        },
        "required": [
            "name",
            "schema",
            "readOnly",
            "dualityView",
            "columns"
        ]
    }
}

level ALLVIEWオブジェクト型のJSONスキーマ

{
    "etag": "113059749145936325402354257176981405696",
    "objectType": "VIEW",
    "objectInfo": {
        "name": "EMP_DETAILS_VIEW",
        "schema": "HR",
        "readOnly": true,
        "dualityView": false,
        "editioningView" : false,
        "columns": [
            {
                "name": "EMPLOYEE_ID",
                "isPk": true,
                "dataType": {
                    "type": "NUMBER",
                    "precision": 5,
                    "scale": 0
                },
                "notNull": true
            },
            {
                "name": "JOB_ID",
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 10,
                    "sizeUnits": "BYTE"
                },
                "notNull": true
            },
            {
                "name": "MANAGER_ID",
                "dataType": {
                    "type": "NUMBER",
                    "precision": 6,
                    "scale": 0
                },
                "notNull": false
            },
            {
                "name": "DEPARTMENT_ID",
                "dataType": {
                    "type": "NUMBER",
                    "precision": 4,
                    "scale": 0
                },
                "notNull": false
            },
            {
                "name": "LOCATION_ID",
                "dataType": {
                    "type": "NUMBER",
                    "precision": 4,
                    "scale": 0
                },
                "notNull": false
            },
            {
                "name": "COUNTRY_ID",
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 2,
                    "sizeUnits": "BYTE"
                },
                "notNull": true
            },
            {
                "name": "FIRST_NAME",
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 20,
                    "sizeUnits": "BYTE"
                },
                "not_null": false
            },
            {
                "name": "LAST_NAME",
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 25,
                    "sizeUnits": "BYTE"
                },
                "notNull": true
            },
            {
                "name": "SALARY",
                "dataType": {
                    "type": "NUMBER",
                    "precision": 8,
                    "scale": 2
                },
                "notNull": false
            },
            {
                "name": "COMISSION_PCT",
                "dataType": {
                    "type": "NUMBER",
                    "precision": 2,
                    "scale": 0
                },
                "notNull": false
            },
            {
                "name": "DEPARTMENT_NAME",
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 30,
                    "sizeUnits": "BYTE"
                },
                "notNull": true
            },
            {
                "name": "JOB_TITLE",
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 35,
                    "sizeUnits": "BYTE"
                },
                "notNull": true
            },
            {
                "name": "CITY",
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 30,
                    "sizeUnits": "BYTE"
                },
                "notNull": true
            },
            {
                "name": "STATE_PROVINCE",
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 25,
                    "sizeUnits": "BYTE"
                },
                "notNull": false
            },
            {
                "name": "COUNTRY_NAME",
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 40,
                    "sizeUnits": "BYTE"
                },
                "notNull": false
            },
            {
                "name": "REGION_NAME",
                "dataType": {
                    "type": "VARCHAR2",
                    "size": 25,
                    "sizeUnits": "BYTE"
                },
                "notNull": false
            }
        ],
        "constraints": [
            {
                "name" : "SYS_C008649",
                "constraintType" : "VIEW READONLY",
                "status" : "ENABLE",
                "deferrable" : false,
                "validated" : "NON VALIDATED",
                "sysGeneratedName" : true
            }
        ],
        "annotations": [
            {
                "Category": "EmpdetailsInfo"
            },
            {
                "Display": "Normal"
            }
        ]
    }
}
オブジェクト型のJSONスキーマ : INDEX

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

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

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

フィールド     LEVELS
      BASIC TYPICAL ALL
name    
indexType    
所有者    
tableName    
status    
columns    
一意性      
funcIdxStatus      
hasBeenAnalyzed      
lastAnalyzed      
numRows      
sampleSize      
annotations      
distinctKeys        
圧縮        
segmentCreated        
生憎        
toBeDropped        

ノート:

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

level BASICINDEXオブジェクト型のJSONスキーマ

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.7/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"
        ]
    }
}

level TYPICALINDEXオブジェクト型のJSONスキーマ

{
    "etag": "113059749145936325402354257176981405696",
    "objectType": "INDEX",
    "objectInfo": {
        "name": "EMP_EMP_ID_PK",
        "indexType": "NORMAL",
        "Owner": "HR",
        "tableName": "EMPLOYEES",
        "uniqueness": "UNIQUE",
        "status": "VALID",
        "lastAnalyzed": "2024-06-14T18:25:43.511Z",
        "numRows": 107,
        "sampleSize": 107,
        "columns": [
            {
                "name": "EMPLOYEE_ID",
                "isPk": true,
                "isUk": true,
                "isFk": false, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 5,
                    "scale": 0
                },
                "notNull": true
            }
        ],
        "annotations": [
            {
                "Category": "EMP_EMP_ID_PKinfo"
            },
            {
                "Display": "Normal"
            }
        ]
    }
}

level ALLINDEXオブジェクト型のJSONスキーマ

{
    "etag": "113059749145936325402354257176981405696",
    "objectType": "INDEX",
    "objectInfo": {
        "name": "EMP_EMP_ID_PK",
        "indexType": "NORMAL",
        "Owner": "HR",
        "tableName": "EMPLOYEES",
        "uniqueness": "UNIQUE",
        "status": "VALID",
        "lastAnalyzed": "2024-06-19T18:25:43.511Z",
        "numRows": 107,
        "distinctKeys": 107,
        "sampleSize": 107,
        "compression": "DISABLE",
        "visibility": "VISIBLE",
        "toBeDropped": false,
        "columns": [
            {
                "name": "EMPLOYEE_ID",
                "isPk": true,
                "isUk": true, 
                "isFk": false, 
                "dataType": {
                    "type": "NUMBER",
                    "precision": 5,
                    "scale": 0
                },
                "numDistinct": 107,
                "lowValue": "100",
                "highValue": "206",
                "density": 0.00934579439252336,
                "avgColLength": 4
            }
        ],
        "annotations": [
            {
                "Category": "EMP_EMP_ID_PKinfo"
            },
            {
                "Display": "Normal"
            }
        ]
    }
}
サブオブジェクト型のJSONスキーマ : columns

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

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

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

フィールド   レベル
    BASIC TYPICAL ALL
name  
default  
notNull  
dataType type
precision
scale
length
sizeUnits
fractionalSecondsPrecision
yearPrecision
dayPrecision
size
isPk    
isUk    
isFk    
domain name  
type  
display  
order  
annotations  
annotations    
numDistinct      
lowValue      
highValue      
密度      
avgColLen      
hiddenColumn      

level BASICCOLUMNサブオブジェクト型のJSONスキーマ

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.7/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"
        },
        "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
                },
                "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": [
                            "size",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "RAW"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "CHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NCHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "UROWID"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NVARCHAR2"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "enum": [
                                    "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": [
                            "yearPrecision",
                            "fractionalSecondsPrecision"
                        ]
                    }
                }
            ]
        },
        "notNull": {
            "description": "Not null",
            "type": "boolean",
            "default": false
        },
        "default": {
            "description": "Default value",
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "number"
                }
            ]
        },
        "required": [
            "name",
            "dataType",
            "notNull"
        ]
    }
}

level TYPICALCOLUMNサブオブジェクト型のJSONスキーマ

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.7/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"
        },
        "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
        },
        "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
                },
                "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": [
                            "size",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "RAW"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "CHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NCHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "UROWID"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NVARCHAR2"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "enum": [
                                    "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": [
                            "yearPrecision",
                            "fractionalSecondsPrecision"
                        ]
                    }
                }
            ]
        },
        "notNull": {
            "description": "Not null",
            "type": "boolean",
            "default": false
        },
        "default": {
            "description": "Default value",
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "number"
                }
            ]
        },
        "domain": {
            "description": "Column domain",
            "type": "object",
            "properties": {
                "name": {
                    "description": "Domain name",
                    "type": "string"   
                },
                "type": {
                    "description": "Domain type",
                    "type": "string"   
                },
                "dislplay": {
                    "description": "Domain display",
                    "type": "string"   
                },
                "order": {
                    "description": "Domain order",
                    "type": "string"   
                },
            }       
        },
        "annotations": {
            "description": "Column annotations",
            "type": "array",
            "items": {
                "$ref": "annotation"
            }
        },
        "required": [
            "name",
            "isPk",
            "isUk",
            "isFk",     
            "dataType",
            "notNull"
        ]
    }
}

level ALLCOLUMNサブオブジェクト型のJSONスキーマ

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.7/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"
        },
        "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
        },
        "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
                },
                "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": [
                            "size",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "RAW"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "CHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size",
                            "sizeUnits"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NCHAR"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "UROWID"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "NVARCHAR2"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "size"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "type": {
                                "enum": [
                                    "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": [
                            "yearPrecision",
                            "fractionalSecondsPrecision"
                        ]
                    }
                }
            ]
        },
        "notNull": {
            "description": "Not null",
            "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"
        },
        "avgColLength": {
            "description": "The number of distinct values in the column",
            "type": "integer"
        },
        "hiddenColumn": {
            "description": "Is this a hidden column?",
            "type": "boolean"
        },
        "default": {
            "description": "Default value",
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "number"
                }
            ]
        },
        "domain": {
            "description": "Column domain",
            "type": "object",
            "properties": {
                "name": {
                    "description": "Domain name",
                    "type": "string"   
                },
                "type": {
                    "description": "Domain type",
                    "type": "string"   
                },
                "dislplay": {
                    "description": "Domain display",
                    "type": "string"   
                },
                "order": {
                    "description": "Domain order",
                    "type": "string"   
                },
            }       
        },
        "annotations": {
            "description": "Column annotations",
            "type": "array",
            "items": {
                "$ref": "annotation"
            }
        },
        "required": [
            "name",
            "isPk",
            "isUk",
            "isFk",     
            "dataType",
            "notNull",
            "hiddenColumn"
        ]
    }
}
サブオブジェクト型のJSONスキーマ : constraints

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

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

表76-6 サブオブジェクト型のJSONスキーマ : CONSTRAINTS

フィールド        
    BASIC TYPICAL ALL
name    
constraintType    
searchCondition    
columns name  
referencedConstraintName    
referencedTable    
処置    
referencedOwner    
referencedColumns name  
status    
遅延可能    
検証済み    
sysGeneratedName    

level TYPICALCOLUMNサブオブジェクト型のJSONスキーマ

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.7/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"
        },
        "constarintType": {
            "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 refernced table",
            "type": "string"
        },
        "referencedOwner": {
            "description": "Owner of table used in referential constraint",
            "type": "string"
        },
        "referencedTable": {
            "description": "Name of table used in referential constraint",
            "type": "string"
        },
        "referencedColumns": {
            "description": "Refernced table columns",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "description": "Refernced table column name",
                        "type": "string"
                    }
                }
            }
        },
        "Action": {
            "description": "On delete rule",
            "type": {
                "enum": [
                    "RESTRICT",
                    "CASCADE",
                    "SET NULL",
                    "SET DEFAULT"
                ]
            }
        },
        "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",
            "constarintType",
            "status",
            "deferrable",
            "validated",
            "sysGeneratedName"
        ],
        "if": {
            "properties": {
                "constarintType": {
                    "const": "REFERENTIAL INTEGRITY"
                }
            }
        },
        "then": {
            "required": [
                "referencedConstraintName",
                "referencedOwner",
                "referencedTable",
                "referencedColumns"
            ]
        }
    }
}

level ALLCOLUMNサブオブジェクト型のJSONスキーマ

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://oracle.com/schema/23.7/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: 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 refernced table",
            "type": "string"
        },
        "referencedOwner": {
            "description": "Owner of table used in referential constraint",
            "type": "string"
        },
        "referencedTable": {
            "description": "Name of table used in referential constraint",
            "type": "string"
        },
        "referencedColumns": {
            "description": "Refernced table columns",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "description": "Refernced table column name",
                        "type": "string"
                    }
                }
            }
        },
        "Action": {
            "description": "On delete rule",
            "type": {
                "enum": [
                     "RESTRICT",
                     "CASCADE",
                     "SET NULL",
                     "SET DEFAULT"
                ]
            }
        },
        "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",
            "constarintType",
            "status",
            "deferrable",
            "validated",
            "sysGeneratedName"
        ],
        "if": {
            "properties": {
                "constarintType": {
                    "const": "REFERENTIAL INTEGRITY"
                }
            }
        },
        "then": {
            "required": [
                "referencedConstraintName",
                "referencedOwner",
                "referencedTable",
                "referencedColumns"
            ]
        }
    }
}