75 DBMS_DEVELOPER
パッケージDBMS_DEVELOPERには、データベース・オブジェクトに関する情報を取得するための開発者にわかりやすいシンプルなメソッドが用意されています。
この章のトピックは、次のとおりです:
75.1 DBMS_DEVELOPER概要
パッケージDBMS_DEVELOPERには、データベース・オブジェクトに関する情報を取得するためのサブプログラムが用意されています。
DBMS_DEVELOPERパッケージには、データベース・オブジェクトの関連情報を取得するための簡単なメソッドが用意されています。 このパッケージは、開発者ツールや開発者がデータベース内のオブジェクト、そのシェイプ、構造などの情報を取得する場合に役立ちます。
DBMS_DEVELOPERには、次の利点があります:
-
パフォーマンス : 情報は数ミリ秒以内に取得されます。
-
シンプルさ :
DBMS_DEVELOPERは、XMLから離れて、シンプルで包括的なJSONを利用します。 このパッケージは、非特権ユーザーが読み取り権を持っているすべてのオブジェクトに関する情報を取得するメソッドを提供します。
75.2 DBMS_DEVELOPERセキュリティ
この項では、DBMS_DEVELOPERパッケージに関連するセキュリティ制限を示します。
このファンクションは実行者の権限で実行されます。 データベース・オブジェクトのメタデータへのアクセスは、オブジェクトを「表示」する権限がある場合にのみ許可されます。 そのような認可がない場合、エラーが発生し、メタデータは取得されません。
必要な権限の要約を次に示します:
- 表およびビュー: 表またはビューに対するSELECT権限またはREAD権限が必要です。
- 索引: 索引が定義される表に対するSELECT権限またはREAD権限が必要です。
- シノニム: シノニムに対するSELECTまたはREAD権限が必要です。
自分のスキーマ内のオブジェクトを記述する場合は、追加の権限は必要ありません。 ただし、別のスキーマのオブジェクトを記述する場合は、それらのオブジェクトに対するSELECT権限が必要です。
DBAであるか、SELECT ANY TABLE、READ ANY TABLEおよびSELECT ANY VIEWシステム権限を持っている場合は、明示的に付与しなくても、データベース内の任意の表、索引またはビューに対してDBMS_DEVELOPER.GET_METADATAをコールできます。
75.3 DBMS_DEVELOPERサブプログラムの要約
この表は、DBMS_DEVELOPERサブプログラムおよび簡単な説明を示しています。
次の表に、DBMS_DEVELOPERパッケージのサブプログラムとその簡単な説明を示します。
| サブプログラム | 説明 |
GET_METADATA |
このファンクションは、次のようなオブジェクトに関する情報を取得 : name、 object_type、 schema、 etagは、対応するオブジェクトのメタデータを含むJSONドキュメントを生成します。 出力に生成する必要がある情報のレベルは、入力パラメータ(level)で指定できます。
|
75.3.1 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;
表75-1 入力構成フィールド
| フィールド | 値 |
|---|---|
|
|
オブジェクト名。 オブジェクト名のシノニムも指定できます。 大文字と小文字が区別され、データ・ディクショナリに示されているとおりに指定する必要があります。 |
|
|
スキーマ名。 デフォルトは現行ユーザーです。 大文字と小文字が区別され、データ・ディクショナリに示されているとおりに指定する必要があります。 |
|
|
取り出すオブジェクトのタイプ。 サポートされている値: 名前解決は |
|
|
詳細のレベル。 デフォルトは サポートされる値:
|
|
|
特定のバージョンのドキュメントの一意の識別子。 この
|
GET_METADATAファンクションに適切なパラメータを使用して、目的のメタデータJSONドキュメントを取得できます。
アプリケーションに必要なスキーマを理解するには、「様々なオブジェクトおよびサブオブジェクト・タイプのJSONスキーマ」を参照してください。
例
object_typeおよびlevelでのDBMS_DEVELOPER.GET_METADATAの使用例を示します。
levelをBASICに設定し、object_typeをTABLEに設定したメタデータの取得:SQL> conn hr/hr Connected. SQL> SQL> select DBMS_DEVELOPER.GET_METADATA(object_type => 'TABLE', name => 'REGIONS', level => 'BASIC');この問合せを実行すると、次のJSONドキュメントが生成されます:
{ "objectType" : "TABLE", "objectInfo" : { "name" : "REGIONS", "schema" : "HR", "columns" : [ { "name" : "REGION_ID", "notNull" : true, "dataType" : { "type" : "NUMBER" } }, { "name" : "REGION_NAME", "notNull" : false, "dataType" : { "type" : "VARCHAR2", "length" : 25, "sizeUnits" : "BYTE" } } ] }, "etag" : "9ADC6D08AE0D5C82C0188D53F3ECD5B9" }levelをTYPICALに設定し、object_typeをVIEWに設定したメタデータの取得:SQL> conn hr/hr Connected. SQL> SQL> select DBMS_DEVELOPER.GET_METADATA(object_type => 'VIEW', name => 'EMP_DETAILS_VIEW', level => 'TYPICAL');この問合せを実行すると、次のJSONドキュメントが生成されます:
{ "objectType" : "VIEW", "objectInfo" : { "name" : "EMP_DETAILS_VIEW", "schema" : "HR", "columns" : [ { "name" : "EMPLOYEE_ID", "notNull" : true, "dataType" : { "type" : "NUMBER", "precision" : 6 } }, { "name" : "JOB_ID", "notNull" : true, "dataType" : { "type" : "VARCHAR2", "length" : 10, "sizeUnits" : "BYTE" } }, { "name" : "MANAGER_ID", "notNull" : false, "dataType" : { "type" : "NUMBER", "precision" : 6 } }, { "name" : "DEPARTMENT_ID", "notNull" : false, "dataType" : { "type" : "NUMBER", "precision" : 4 } }, { "name" : "LOCATION_ID", "notNull" : false, "dataType" : { "type" : "NUMBER", "precision" : 4 } }, { "name" : "COUNTRY_ID", "notNull" : false, "dataType" : { "type" : "CHAR", "length" : 2, "sizeUnits" : "BYTE" } }, { "name" : "FIRST_NAME", "notNull" : false, "dataType" : { "type" : "VARCHAR2", "length" : 20, "sizeUnits" : "BYTE" } }, { "name" : "LAST_NAME", "notNull" : true, "dataType" : { "type" : "VARCHAR2", "length" : 25, "sizeUnits" : "BYTE" } }, { "name" : "SALARY", "notNull" : false, "dataType" : { "type" : "NUMBER", "precision" : 8, "scale" : 2 } }, { "name" : "COMMISSION_PCT", "notNull" : false, "dataType" : { "type" : "NUMBER", "precision" : 2, "scale" : 2 } }, { "name" : "DEPARTMENT_NAME", "notNull" : true, "dataType" : { "type" : "VARCHAR2", "length" : 30, "sizeUnits" : "BYTE" } }, { "name" : "JOB_TITLE", "notNull" : true, "dataType" : { "type" : "VARCHAR2", "length" : 35, "sizeUnits" : "BYTE" } }, { "name" : "CITY", "notNull" : true, "dataType" : { "type" : "VARCHAR2", "length" : 30, "sizeUnits" : "BYTE" } }, { "name" : "STATE_PROVINCE", "notNull" : false, "dataType" : { "type" : "VARCHAR2", "length" : 25, "sizeUnits" : "BYTE" } }, { "name" : "COUNTRY_NAME", "notNull" : false, "dataType" : { "type" : "VARCHAR2", "length" : 40, "sizeUnits" : "BYTE" } }, { "name" : "REGION_NAME", "notNull" : false, "dataType" : { "type" : "VARCHAR2", "length" : 25, "sizeUnits" : "BYTE" } } ], "readOnly" : true, "dualityView" : false, "constraints" : [ { "name" : "SYS_C008649", "constraintType" : "VIEW READONLY", "status" : "ENABLE", "deferrable" : false, "validated" : "NON VALIDATED", "sysGeneratedName" : true } ] }, "etag" : "30CA19323E091D7423842D366B727473" }levelをALLに設定し、object_typeをVIEWに設定したメタデータの取得:SQL> conn hr/hr Connected. SQL> SQL> select DBMS_DEVELOPER.GET_METADATA(object_type => 'VIEW', name => 'EMP_DETAILS_VIEW', level => 'ALL');{ "objectType" : "VIEW", "objectInfo" : { "name" : "EMP_DETAILS_VIEW", "schema" : "HR", "columns" : [ { "name" : "EMPLOYEE_ID", "notNull" : true, "dataType" : { "type" : "NUMBER", "precision" : 6 } }, { "name" : "JOB_ID", "notNull" : true, "dataType" : { "type" : "VARCHAR2", "length" : 10, "sizeUnits" : "BYTE" } }, { "name" : "MANAGER_ID", "notNull" : false, "dataType" : { "type" : "NUMBER", "precision" : 6 } }, { "name" : "DEPARTMENT_ID", "notNull" : false, "dataType" : { "type" : "NUMBER", "precision" : 4 } }, { "name" : "LOCATION_ID", "notNull" : false, "dataType" : { "type" : "NUMBER", "precision" : 4 } }, { "name" : "COUNTRY_ID", "notNull" : false, "dataType" : { "type" : "CHAR", "length" : 2, "sizeUnits" : "BYTE" } }, { "name" : "FIRST_NAME", "notNull" : false, "dataType" : { "type" : "VARCHAR2", "length" : 20, "sizeUnits" : "BYTE" } }, { "name" : "LAST_NAME", "notNull" : true, "dataType" : { "type" : "VARCHAR2", "length" : 25, "sizeUnits" : "BYTE" } }, { "name" : "SALARY", "notNull" : false, "dataType" : { "type" : "NUMBER", "precision" : 8, "scale" : 2 } }, { "name" : "COMMISSION_PCT", "notNull" : false, "dataType" : { "type" : "NUMBER", "precision" : 2, "scale" : 2 } }, { "name" : "DEPARTMENT_NAME", "notNull" : true, "dataType" : { "type" : "VARCHAR2", "length" : 30, "sizeUnits" : "BYTE" } }, { "name" : "JOB_TITLE", "notNull" : true, "dataType" : { "type" : "VARCHAR2", "length" : 35, "sizeUnits" : "BYTE" } }, { "name" : "CITY", "notNull" : true, "dataType" : { "type" : "VARCHAR2", "length" : 30, "sizeUnits" : "BYTE" } }, { "name" : "STATE_PROVINCE", "notNull" : false, "dataType" : { "type" : "VARCHAR2", "length" : 25, "sizeUnits" : "BYTE" } }, { "name" : "COUNTRY_NAME", "notNull" : false, "dataType" : { "type" : "VARCHAR2", "length" : 40, "sizeUnits" : "BYTE" } }, { "name" : "REGION_NAME", "notNull" : false, "dataType" : { "type" : "VARCHAR2", "length" : 25, "sizeUnits" : "BYTE" } } ], "readOnly" : true, "dualityView" : false, "constraints" : [ { "name" : "SYS_C008649", "constraintType" : "VIEW READONLY", "status" : "ENABLE", "deferrable" : false, "validated" : "NON VALIDATED", "sysGeneratedName" : true } ], "editioningView" : false, "authorizations" : [ { "grantee" : "SCOTT", "privileges" : [ { "name" : "SELECT", "grantable" : false }, { "name" : "READ", "grantable" : false } ] } ] }, "etag" : "B90C4AE92788116F695ADC2A1CB2859F" }levelをALLに設定し、object_typeをINDEXに設定したメタデータの取得:SQL> conn hr/hr Connected. SQL> SQL> select DBMS_DEVELOPER.GET_METADATA(object_type => 'INDEX', name => 'EMP_EMP_ID_PK', level => 'ALL');この問合せを実行すると、次のJSONドキュメントが生成されます:
{ "objectType" : "INDEX", "objectInfo" : { "indexType" : "NORMAL", "partitioned" : false, "columns" : [ { "dataType" : { "type" : "NUMBER", "precision" : 6 }, "isPk" : true, "hiddenColumn" : false, "numDistinct" : 107, "isUk" : true, "highValue" : "C20307", "isFk" : false, "lowValue" : "C202", "density" : 0.00934579439252336, "notNull" : true, "name" : "EMPLOYEE_ID", "avgColLen" : 4 } ], "uniqueness" : "UNIQUE", "numRows" : 107, "toBeDropped" : false, "lastAnalyzed" : "2025-01-09T20:36:23", "sampleSize" : 107, "segmentCreated" : "YES", "distinctKeys" : 107, "owner" : "HR", "visibility" : "VISIBLE", "name" : "EMP_EMP_ID_PK", "status" : "VALID", "compression" : "DISABLED", "tableName" : "EMPLOYEES" }, "etag" : "DFCF4C9591CD233EE746E129E875A43B" }levelおよびobject_typeを明示的に指定しないメタデータの取得:SQL> conn hr/hr Connected. SQL> SQL> select dbms_developer.get_metadata(name => 'REGIONS');object_typeを指定しない場合でも、名前解決は内部で行われます。name => 'EMPLOYEES'に対応するobject_typeの名前は、tableと判断されます。 そのため、JSONドキュメントは、table object_typeのデフォルトのtypical levelで生成されます。 前述の例に対応する出力JSONドキュメントを次に示します:{ "objectType" : "TABLE", "objectInfo" : { "schema" : "HR", "columns" : [ { "name" : "REGION_ID", "notNull" : true, "dataType" : { "type" : "NUMBER" }, "isPk" : true, "isUk" : true, "isFk" : false }, { "name" : "REGION_NAME", "notNull" : false, "dataType" : { "type" : "VARCHAR2", "length" : 25, "sizeUnits" : "BYTE" }, "isPk" : false, "isUk" : false, "isFk" : false } ], "numRows" : 4, "external" : "NO", "constraints" : [ { "name" : "REGION_ID_NN", "constraintType" : "CHECK - NOT NULL", "searchCondition" : "\"REGION_ID\" IS NOT NULL", "columns" : [ { "name" : "REGION_ID" } ], "status" : "ENABLE", "deferrable" : false, "validated" : "VALIDATED", "sysGeneratedName" : false }, { "name" : "REG_ID_PK", "constraintType" : "PRIMARY KEY", "columns" : [ { "name" : "REGION_ID" } ], "status" : "ENABLE", "deferrable" : false, "validated" : "VALIDATED", "sysGeneratedName" : false } ], "lastAnalyzed" : "2025-01-09T20:36:38", "sampleSize" : 4, "indexes" : [ { "name" : "REG_ID_PK", "indexType" : "NORMAL", "uniqueness" : "UNIQUE", "status" : "VALID", "lastAnalyzed" : "2025-01-09T20:36:39", "numRows" : 4, "sampleSize" : 4, "partitioned" : false, "columns" : [ { "name" : "REGION_ID" } ] } ], "avgRowLen" : 14, "name" : "REGIONS", "temporary" : "NO" }, "etag" : "20731DA3DCF5DA125C127B88BFB645EA" }- 指定された
etagが現在のetagと一致する場合にメタデータを取得すると、空のドキュメントが返されます:SQL> conn hr/hr Connected. SQL> SQL> select dbms_developer.get_metadata(name => 'REGIONS', etag => '20731DA3DCF5DA125C127B88BFB645EA');この問合せを実行すると、空のJSONドキュメントが生成されます:{ }
75.3.1.1 異なるオブジェクト型およびサブオブジェクト型のJSONスキーマ
この項では、様々なオブジェクト・タイプ、サブオブジェクト・タイプおよびレベルで可能な各種スキーマの概要を示します。
このJSONスキーマは、アプリケーションでリファレンスとして使用して、返されたJSONドキュメントを解析できます。 特定のバージョンのデータベース・プログラムをプログラミングする場合は、そのデータベース・バージョンに対する特定のバージョンのJSONスキーマを使用すると、そのスキーマは常に同じになります。 ただし、別のリリースにアップグレードまたはダウングレードする場合は、別のスキーマ・バージョンを使用するため、その正しいスキーマを使用する必要があります。 スキーマが変更された場合は、$idフィールドのバージョン番号が変更されます。 今後オラクルがJSONスキーマの改訂を予定している場合でも、アプリケーションはこの数値に依拠できます。 既存のバージョンは変更されないため、アプリケーションは引き続き完全に機能し、更新の影響を受けません。
object_typeTABLEのすべてのレベルのJSONスキーマの詳細は、「オブジェクト・タイプTABLEのJSONスキーマ」を参照してください。object_typeINDEXのすべてのレベルのJSONスキーマの詳細は、「オブジェクト・タイプINDEXのJSONスキーマ」を参照してください。object_typeVIEWのすべてのレベルのJSONスキーマの詳細な説明は、「オブジェクト・タイプVIEWのJSONスキーマ」を参照してください。- サブオブジェクト・タイプ
COLUMNSのすべてのレベルのJSONスキーマの詳細は、「サブオブジェクト・タイプcolumnsのJSONスキーマ」を参照してください。 - サブオブジェクト・タイプ
CONSTRAINTSのすべてのレベルのJSONスキーマの詳細は、「サブオブジェクト・タイプconstraintsのJSONスキーマ」を参照してください。
75.3.1.1.1 オブジェクト型のJSONスキーマ : TABLE
この項では、オブジェクト・タイプTABLEのすべてのレベルのJSONスキーマについて説明します。
TABLEオブジェクト・タイプのJSONスキーマ(表形式)
表75-2 オブジェクト型のJSONスキーマ : TABLE
| フィールド | レベル | ||||
|---|---|---|---|---|---|
| BASIC | TYPICAL | ALL | |||
|
name |
✔ | ✔ | ✔ | ||
|
schema |
✔ | ✔ | ✔ | ||
|
columns |
✔ | ✔ | ✔ | ||
|
hasBeenAnalyzed |
✔ | ✔ | |||
|
lastAnalyzed |
✔ | ✔ | |||
|
numRows |
✔ | ✔ | |||
|
sampleSize |
✔ | ✔ | |||
|
avgRowLen |
✔ | ✔ | |||
|
clusterName |
✔ | ✔ | |||
|
clusterOwner |
✔ | ✔ | |||
|
external |
✔ | ✔ | |||
|
temporary |
✔ | ✔ | |||
|
索引 |
✔ | ✔ | |||
|
制約 |
✔ | ✔ | |||
|
annotations |
✔ | ✔ | |||
|
segmentCreated |
✔ | ||||
|
inMemory |
✔ | ||||
|
compression |
✔ | ||||
|
dependencies |
✔ | ||||
|
authorizations |
grantee | ✔ | |||
| privileges | name | ||||
| grantable | |||||
|
inMemoryPriority |
✔ | ||||
|
inMemoryDistribute |
✔ | ||||
|
inMemoryCompression |
✔ | ||||
|
inMemoryDuplicate |
✔ | ||||
|
iotType |
✔ | ||||
ノート:
サブオブジェクトcolumnsおよびconstraintsのフィールドは、levelの選択によって異なります。 サブオブジェクトcolumnsに存在するフィールドの詳細は、「サブオブジェクト・タイプcolumnsのJSONスキーマ」を参照してください。 サブオブジェクトconstraintsに存在するフィールドの詳細は、「サブオブジェクト・タイプconstraintsのJSONスキーマ」を参照してください。
TABLEオブジェクト・タイプのJSONスキーマ(level BASIC)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/BASIC/object_info/table",
"title": "DBMS_DEVELOPER.GET_METADATA/BASIC/OBJECT_INFO/TABLE",
"description": "Information for a table object",
"type": "object",
"properties": {
"name": {
"description": "Table name",
"type": "string"
},
"schema": {
"description": "Table schema",
"type": "string"
},
"columns": {
"description": "Table columns",
"type": "array",
"items": {
"$ref": "../column"
}
}
},
"required": [
"name",
"schema",
"columns"
]
}
TABLEオブジェクト・タイプのJSONスキーマ(level TYPICAL)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/TYPICAL/object_info/table",
"title": "DBMS_DEVELOPER.GET_METADATA/TYPICAL/OBJECT_INFO/TABLE",
"description": "Information for a table object",
"type": "object",
"properties": {
"name": {
"description": "Table name",
"type": "string"
},
"schema": {
"description": "Table schema",
"type": "string"
},
"columns": {
"description": "Table columns",
"type": "array",
"items": {
"$ref": "../column"
}
},
"hasBeenAnalyzed": {
"description": "Indicates whether table has been analyzed",
"type": "boolean",
"default": false
},
"lastAnalyzed": {
"description": "Last time table was analyzed",
"type": "string",
"format": "date-time"
},
"numRows": {
"description": "Number of rows",
"type": "integer"
},
"sampleSize": {
"description": "Analyzed sample size",
"type": "integer"
},
"avgRowLen": {
"description": "Average row length",
"type": "integer"
},
"clusterName": {
"description": "Name of the cluster, if any, to which the table belongs",
"type": "string"
},
"clusterOwner": {
"description": "Owner of the cluster, if any, to which the table belongs",
"type": "string"
},
"external": {
"description": "Indicates whether the table is an external table (YES) or not (NO)",
"type": "string"
},
"temporary": {
"description": "Indicates whether the table is temporary (YES) or not (NO)",
"type": "string"
},
"indexes": {
"description": "Table indexes",
"type": "array",
"items": {
"$ref": "../index"
}
},
"constraints": {
"description": "Table constraints",
"type": "array",
"items": {
"$ref": "../constraint"
}
},
"annotations": {
"description": "Table annotations",
"type": "array",
"items": {
"$ref": "../annotation"
}
}
},
"required": [
"name",
"schema",
"columns",
"external",
"temporary"
]
}
TABLEオブジェクト・タイプのJSONスキーマ(level ALL)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/ALL/object_info/table",
"title": "DBMS_DEVELOPER.GET_METADATA/ALL/OBJECT_INFO/TABLE",
"description": "Information for a table object",
"type": "object",
"properties": {
"name": {
"description": "Table name",
"type": "string"
},
"schema": {
"description": "Table schema",
"type": "string"
},
"columns": {
"description": "Table columns",
"type": "array",
"items": {
"$ref": "../column"
}
},
"hasBeenAnalyzed": {
"description": "Indicates whether table has been analyzed",
"type": "boolean",
"default": false
},
"lastAnalyzed": {
"description": "Last time table was analyzed",
"type": "string",
"format": "date-time"
},
"numRows": {
"description": "Number of rows",
"type": "integer"
},
"sampleSize": {
"description": "Analyzed sample size",
"type": "integer"
},
"avgRowLen": {
"description": "Average row length",
"type": "integer"
},
"clusterName": {
"description": "Name of the cluster, if any, to which the table belongs",
"type": "string"
},
"clusterOwner": {
"description": "Owner of the cluster, if any, to which the table belongs",
"type": "string"
},
"external": {
"description": "Indicates whether the table is an external table (YES) or not (NO)",
"type": "string"
},
"temporary": {
"description": "Indicates whether the table is temporary (YES) or not (NO)",
"type": "string"
},
"indexes": {
"description": "Table indexes",
"type": "array",
"items": {
"$ref": "../index"
}
},
"constraints": {
"description": "Table constraints",
"type": "array",
"items": {
"$ref": "../constraint"
}
},
"annotations": {
"description": "Table annotations",
"type": "array",
"items": {
"$ref": "../annotation"
}
},
"segmentCreated": {
"description": "Indicates whether the table segment is created.",
"type": "string"
},
"inMemory": {
"description": "Indicates whether the In-Memory Column Store (IM column store)
is enabled (ENABLED) or disabled (DISABLED) for the table",
"type": "string"
},
"compression": {
"description": "Indicates whether table compression is enabled (ENABLED) or not (DISABLED)",
"type": "string"
},
"dependencies": {
"description": "Indicates whether the table is an external table (YES) or not (NO)",
"type": "string"
},
"authorizations": {
"description": "Table authorizations",
"type": "object",
"properties": {
"grantee": {
"description": "Name of the user to whom access was granted",
"type": "string"
},
"privileges": {
"description": "All privileges granted to grantee",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Privilege on the object,
"type": "string"
},
"grantable": {
"description": "Indicates whether the privilege was granted with the GRANT OPTION",
"type": "string"
}
}
}
}
}
},
"inMemoryPriority": {
"description": "Indicates the priority for In-Memory Column Store (IM column store) population. ",
"type": "string"
},
"inMemoryDistribute": {
"description": "Indicates how the IM column store is distributed in an
Oracle Real Application Clusters (Oracle RAC) environment",
"type": "string"
},
"inMemoryCompression": {
"description": "Indicates the compression level for the IM column store",
"type": "string"
},
"inMemoryDuplicate": {
"description": "Indicates the duplicate setting for the IM column store in an Oracle RAC environment",
"type": "string"
},
"iotType": {
"description": "If the table is an index-organized table, then IOT_TYPE is IOT,
IOT_OVERFLOW, or IOT_MAPPING. If the table is not an index-organized table,
then IOT_TYPE is NULL.",
"type": "string"
}
},
"required": [
"name",
"schema",
"columns",
"external",
"temporary",
"inMemory",
"compression",
"dependencies",
"segmentCreated"
]
}
75.3.1.1.2 オブジェクト型のJSONスキーマ : VIEW
この項では、オブジェクト・タイプVIEWのすべてのレベルのJSONスキーマについて説明します。
VIEWオブジェクト・タイプのJSONスキーマ(表形式)
表75-3 VIEWオブジェクト・タイプのJSONスキーマ
| フィールド | レベル | ||||
|---|---|---|---|---|---|
| BASIC | TYPICAL | ALL | |||
|
name |
✔ | ✔ | ✔ | ||
|
schema |
✔ | ✔ | ✔ | ||
|
columns |
✔ | ✔ | ✔ | ||
|
readOnly |
✔ | ✔ | |||
|
dualityView |
✔ | ✔ | |||
|
制約 |
✔ | ✔ | |||
|
annotations |
✔ | ✔ | |||
|
editioningView |
✔ | ||||
|
authorizations |
grantee |
✔ | |||
|
privileges |
name | ||||
| grantable | |||||
ノート:
サブオブジェクトcolumnsおよびconstraintsのフィールドは、levelの選択によって異なります。 サブオブジェクトcolumnsに存在するフィールドの詳細は、「サブオブジェクト・タイプcolumnsのJSONスキーマ」を参照してください。 サブオブジェクトconstraintsに存在するフィールドの詳細は、「サブオブジェクト・タイプconstraintsのJSONスキーマ」を参照してください。
VIEWオブジェクト・タイプのJSONスキーマ(level BASIC)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/BASIC/object_info/view",
"title": "DBMS_DEVELOPER.GET_METADATA/BASIC/OBJECT_INFO/VIEW",
"description": "Information for a View object",
"type": "object",
"properties": {
"name": {
"description": "View name",
"type": "string"
},
"schema": {
"description": "View schema",
"type": "string"
},
"columns": {
"description": "View columns",
"type": "array",
"items": {
"$ref": "../column"
}
}
},
"required": [
"name",
"schema",
"columns"
]
}
VIEWオブジェクト・タイプのJSONスキーマ(level TYPICAL)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/TYPICAL/object_info/view",
"title": "DBMS_DEVELOPER.GET_METADATA/TYPICAL/OBJECT_INFO/VIEW",
"description": "Information for a View object",
"type": "object",
"properties": {
"name": {
"description": "View name",
"type": "string"
},
"schema": {
"description": "View schema",
"type": "string"
},
"columns": {
"description": "View columns",
"type": "array",
"items": {
"$ref": "../column"
}
},
"readOnly": {
"description": "An indicator of whether the view is a Read Only View",
"type": "boolean",
"default": true
},
"dualityView": {
"description": "Whether the view is a JSON Duality View or not",
"type": "boolean",
"default": false
},
"constraints": {
"description": "View constraints",
"type": "array",
"items": {
"$ref": "../constraint"
}
} ,
"annotations": {
"description": "View annotations",
"type": "array",
"items": {
"$ref": "../annotation"
}
}
},
"required": [
"name",
"schema",
"readOnly",
"dualityView",
"columns"
]
}
VIEWオブジェクト・タイプのJSONスキーマ(level ALL)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/ALL/object_info/view",
"title": "DBMS_DEVELOPER.GET_METADATA/ALL/OBJECT_INFO/VIEW",
"description": "Information for a View object",
"type": "object",
"properties": {
"name": {
"description": "View name",
"type": "string"
},
"schema": {
"description": "View schema",
"type": "string"
},
"columns": {
"description": "View columns",
"type": "array",
"items": {
"$ref": "../column"
}
},
"readOnly": {
"description": "An indicator of whether the view is a Read Only View",
"type": "boolean",
"default": true
},
"dualityView": {
"description": "Whether the view is a JSON Duality View or not",
"type": "boolean",
"default": false
},
"constraints": {
"description": "View constraints",
"type": "array",
"items": {
"$ref": "../constraint"
}
},
"annotations": {
"description": "View annotations",
"type": "array",
"items": {
"$ref": "../annotation"
}
},
"editioningView": {
"description": "An indicator of whether the view is an Editioning view",
"type": "boolean",
"default": false
},
"authorizations": {
"description": "View authorizations",
"type": "object",
"properties": {
"grantee": {
"description": "Name of the user to whom access was granted",
"type": "string"
},
"privileges": {
"description": "All privileges granted to grantee",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Privilege on the object,
"type": "string"
},
"grantable": {
"description": "Indicates whether the privilege was granted with the GRANT OPTION",
"type": "string"
}
}
}
}
}
}
},
"required": [
"name",
"schema",
"columns"
]
}
75.3.1.1.3 オブジェクト型のJSONスキーマ : INDEX
この項では、オブジェクト・タイプINDEXのすべてのレベルのJSONスキーマについて説明します。
INDEXオブジェクト・タイプのJSONスキーマ(表形式)
表75-4 INDEXオブジェクト・タイプのJSONスキーマ
| フィールド | レベル | ||||
|---|---|---|---|---|---|
| BASIC | TYPICAL | ALL | |||
| name | ✔ | ✔ | ✔ | ||
| indexType | ✔ | ✔ | ✔ | ||
| owner | ✔ | ✔ | ✔ | ||
| tableName | ✔ | ✔ | ✔ | ||
| status | ✔ | ✔ | ✔ | ||
| columns | ✔ | ✔ | ✔ | ||
| uniqueness | ✔ | ✔ | |||
| funcIdxStatus | ✔ | ✔ | |||
| hasBeenAnalyzed | ✔ | ✔ | |||
| lastAnalyzed | ✔ | ✔ | |||
| numRows | ✔ | ✔ | |||
| sampleSize | ✔ | ✔ | |||
| annotations | ✔ | ✔ | |||
| partitioned | ✔ | ✔ | |||
| distinctKeys | ✔ | ||||
| compression | ✔ | ||||
| segmentCreated | ✔ | ||||
| visibility | ✔ | ||||
| toBeDropped | ✔ | ||||
ノート:
サブオブジェクトcolumnsのフィールドは、levelの選択に応じて異なります。 サブオブジェクトcolumnsに存在するフィールドの詳細は、「サブオブジェクト・タイプcolumnsのJSONスキーマ」を参照してください。
INDEXオブジェクト・タイプのJSONスキーマ(level BASIC)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/BASIC/object_info/index",
"title": "DBMS_DEVELOPER.GET_METADATA/BASIC/OBJECT_INFO/INDEX",
"description": "Information for index",
"type": "object",
"properties": {
"name": {
"description": "Index name",
"type": "string"
},
"indexType": {
"description": "Index Types i.e. CLUSTER, NORMAL, NORMAL/REV, BITMAP, DOMAIN, LOB, IOT - TOP, FUNCTION-BASED NORMAL, FUNCTION-BASED NORMAL/REV, FUNCTION-BASED BITMAP, FUNCTION-BASED DOMAIN, VECTOR",
"type": "string"
},
"owner": {
"description": "Owner of the indexed object",
"type": "string"
},
"tableName": {
"description": "Name of the indexed object",
"type": "string"
},
"status": {
"description": "Status",
"type": {
"enum": [
"VALID",
"UNUSABLE",
"INPROGRS",
"N/A"
]
}
},
"columns": {
"description": "Index column(s)",
"type": "array",
"items": {
"$ref": "../column"
}
}
},
"required": [
"name",
"indexType",
"owner",
"tableName",
"status",
"columns"
]
}
INDEXオブジェクト・タイプのJSONスキーマ(level TYPICAL)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/TYPICAL/object_info/index",
"title": "DBMS_DEVELOPER.GET_METADATA/TYPICAL/OBJECT_INFO/INDEX",
"description": "Information for index",
"type": "object",
"properties": {
"name": {
"description": "Index name",
"type": "string"
},
"indexType": {
"description": "Index Types i.e. CLUSTER, NORMAL, NORMAL/REV, BITMAP, DOMAIN, LOB, IOT - TOP, FUNCTION-BASED NORMAL, FUNCTION-BASED NORMAL/REV, FUNCTION-BASED BITMAP, FUNCTION-BASED DOMAIN, VECTOR",
"type": "string"
},
"owner": {
"description": "Owner of the indexed object",
"type": "string"
},
"tableName": {
"description": "Name of the indexed object",
"type": "string"
},
"status": {
"description": "Status",
"type": {
"enum": [
"VALID",
"INVALID",
"INPROGRS",
"N/A"
]
}
},
"columns": {
"description": "Index column(s)",
"type": "array",
"items": {
"$ref": "../column"
}
},
"uniqueness": {
"description": "Uniqueness",
"type": "string",
"enum": [
"UNIQUE",
"NONUNIQUE"
]
},
"funcIdxStatus": {
"description": "Functional index status",
"type": "string"
},
"hasBeenAnalyzed": {
"description": "Indicates whether index has been analyzed",
"type": "boolean",
"default": false
},
"lastAnalyzed": {
"description": "Last time View was analyzed",
"type": "string",
"format": "date-time"
},
"numRows": {
"description": "Number of rows",
"type": "integer"
},
"sampleSize": {
"description": "Analyzed sample size",
"type": "integer"
},
"partitioned": {
"description": "Indicates whether the index is partitioned",
"type": "boolean",
"default": false
},
"annotations": {
"description": "Index annotations",
"type": "array",
"items": {
"$ref": "annotation"
}
},
"required": [
"name",
"indexType",
"owner",
"tableName",
"status",
"columns"
]
}
}
INDEXオブジェクト・タイプのJSONスキーマ(level ALL)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/ALL/object_info/index",
"title": "DBMS_DEVELOPER.GET_METADATA/ALL/OBJECT_INFO/INDEX",
"description": "Information for index",
"type": "object",
"properties": {
"name": {
"description": "Index name",
"type": "string"
},
"indexType": {
"description": "Index Types i.e. CLUSTER, NORMAL, NORMAL/REV, BITMAP, DOMAIN, LOB,
IOT - TOP, FUNCTION-BASED NORMAL, FUNCTION-BASED NORMAL/REV,
FUNCTION-BASED BITMAP, FUNCTION-BASED DOMAIN, VECTOR",
"type": "string"
},
"owner": {
"description": "Owner of the indexed object",
"type": "string"
},
"tableName": {
"description": "Name of the indexed object",
"type": "string"
},
"status": {
"description": "Status",
"type": {
"enum": [
"VALID",
"INVALID",
"INPROGRS",
"N/A"
]
}
},
"columns": {
"description": "Index column(s)",
"type": "array",
"items": {
"$ref": "../column"
}
},
"uniqueness": {
"description": "Uniqueness",
"type": "string",
"enum": [
"UNIQUE",
"NONUNIQUE"
]
},
"funcIdxStatus": {
"description": "Functional index status",
"type": "string"
},
"hasBeenAnalyzed": {
"description": "Indicates whether index has been analyzed",
"type": "boolean",
"default": false
},
"lastAnalyzed": {
"description": "Last time View was analyzed",
"type": "string",
"format": "date-time"
},
"numRows": {
"description": "Number of rows",
"type": "integer"
},
"sampleSize": {
"description": "Analyzed sample size",
"type": "integer"
},
"partitioned": {
"description": "Indicates whether the index is partitioned",
"type": "boolean",
"default": false
},
"annotations": {
"description": "Index annotations",
"type": "array",
"items": {
"$ref": "annotation"
}
},
"distinctKeys": {
"description": "Number of distinct keys in the index",
"type": "integer"
},
"compression": {
"description": "Compression property of the index: ENABLED, DISABLED, ADVANCED HIGH, ADVANCED LOW",
"type": "string",
"enum": [
"ENABLED",
"DISABLED",
"ADVANCED HIGH",
"ADVANCED LOW"
]
},
"segmentCreated": {
"description": "Whether the index segment has been created",
"type": "string",
"enum": [
"YES",
"NO",
"N/A"
]
},
"visibility": {
"description": "Whether the index is VISIBLE or INVISIBLE to the optimizer",
"type": "string",
"enum": [
"VISIBLE",
"INVISIBLE"
]
},
"toBeDropped": {
"description": "Whether index is dropped and is in Recycle Bin",
"type": "boolean"
}
},
"required": [
"name",
"indexType",
"owner",
"tableName",
"status",
"columns",
"partitioned"
"compression",
"segmentCreated",
"visibility",
"tobeDropped"
]
}
75.3.1.1.4 サブオブジェクト型のJSONスキーマ : columns
サブオブジェクトcolumnsのbasic、typicalおよびallレベルのJSONスキーマ。
columnsサブオブジェクト・タイプのJSONスキーマ(表形式)
表75-5 COLUMNSサブオブジェクトのJSONスキーマ
| フィールド | レベル | |||
|---|---|---|---|---|
| BASIC | TYPICAL | ALL | ||
| name | ✔ | ✔ | ✔ | |
| default | ✔ | ✔ | ✔ | |
| notNull | ✔ | ✔ | ✔ | |
| dataType | type | ✔ | ✔ | ✔ |
| precision | ||||
| length | ||||
| scale | ||||
| size | ||||
| sizeUnits | ||||
| fractionalSecondsPrecision | ||||
| yearPrecision | ||||
| dayPrecision | ||||
| isPk | ✔ | ✔ | ||
| isUk | ✔ | ✔ | ||
| isFk | ✔ | ✔ | ||
| domain | name | ✔ | ✔ | |
| type | ||||
| display | ||||
| order | ||||
| annotations | ||||
| annotations | ✔ | ✔ | ||
| numDistinct | ✔ | |||
| lowValue | ✔ | |||
| highValue | ✔ | |||
| density | ✔ | |||
| avgColLen | ✔ | |||
| hiddenColumn | ✔ | |||
| virtualColumn | ✔ | |||
| reservableColumn | ✔ | |||
| identityColumn | ✔ | |||
| encryptedColumn | ✔ | |||
ノート:
typeフィールドの値に基づいて、特定のフィールドが必要です。 次の表に、各type値の必須フィールドを示します。
|
|
対応する必須の列 |
NUMBER |
precisionおよびscale |
FLOAT |
precision |
VARCHAR2 |
sizeおよびsizeUnits |
RAW |
size |
CHAR |
sizeおよびsizeUnits |
NCHAR |
size |
UROWID |
size |
NVARCHAR2 |
size |
TIMESTAMP、TIMESTAMP WITH TIME ZONEまたはTIMESTAMP WITH LOCAL TIME ZONE |
fractionalSecondsPrecision |
INTERVAL YEAR TO MONTH |
yearPrecision |
INTERVAL DAY TO SECOND |
yearPrecisionおよびfractionalSecondsPrecision |
COLUMNサブオブジェクト・タイプのJSONスキーマ(level BASIC)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/BASIC/object_info/column",
"title": "DBMS_DEVELOPER.GET_METADATA/BASIC/OBJECT_INFO/COLUMN",
"description": "Information for column",
"type": "object",
"properties": {
"name": {
"description": "Column name",
"type": "string"
},
"notNull": {
"description": "Not null",
"type": "boolean",
"default": false
},
"default": {
"description": "Default value",
"anyOf": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"dataType": {
"description": "Datatype",
"type": "object",
"properties": {
"type": {
"description": "dataType",
"type": "string"
},
"precision": {
"description": "precision",
"type": "integer",
"minimum": 1
},
"scale": {
"description": "scale",
"type": "integer",
"minimum": 0
},
"length": {
"description": "length",
"type": "integer",
"minimum": 0
},
"size": {
"description": "size",
"type": "integer",
"minimum": 1
},
"sizeUnits": {
"description": "varchar size units",
"type": "string",
"enum": [
"BYTE",
"CHAR"
]
},
"fractionalSecondsPrecision": {
"description": "fractionalSecondsPrecision",
"type": "integer"
},
"yearPrecision": {
"description": "yearPrecision",
"type": "integer"
},
"dayPrecision": {
"description": "dayPrecision",
"type": "integer"
}
},
"anyOf": [
{
"if": {
"properties": {
"type": {
"const": "NUMBER"
}
}
},
"then": {
"required": [
"precision",
"scale"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "FLOAT"
}
}
},
"then": {
"required": [
"precision"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "VARCHAR2"
}
}
},
"then": {
"required": [
"length",
"sizeUnits"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "RAW"
}
}
},
"then": {
"required": [
"size"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "CHAR"
}
}
},
"then": {
"required": [
"length",
"sizeUnits"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "NCHAR"
}
}
},
"then": {
"required": [
"length"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "UROWID"
}
}
},
"then": {
"required": [
"size"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "NVARCHAR2"
}
}
},
"then": {
"required": [
"length"
]
}
},
{
"if": {
"properties": {
"type": {
"enum": [
"TIME",
"TIME WITH TIMEZONE",
"TIMESTAMP",
"TIMESTAMP WITH TIME ZONE",
"TIMESTAMP WITH LOCAL TIME ZONE"
]
}
}
},
"then": {
"required": [
"fractionalSecondsPrecision"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "INTERVAL YEAR TO MONTH"
}
}
},
"then": {
"required": [
"yearPrecision"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "INTERVAL DAY TO SECOND"
}
}
},
"then": {
"required": [
"dayPrecision",
"fractionalSecondsPrecision"
]
}
}
]
}
},
"required": [
"name",
"dataType",
"notNull"
]
}
COLUMNサブオブジェクト・タイプのJSONスキーマ(level TYPICAL)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/TYPICAL/object_info/column",
"title": "DBMS_DEVELOPER.GET_METADATA/TYPICAL/OBJECT_INFO/COLUMN",
"description": "Information for column",
"type": "object",
"properties": {
"name": {
"description": "Column name",
"type": "string"
},
"default": {
"description": "Default value",
"anyOf": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"notNull": {
"description": "Not null",
"type": "boolean",
"default": false
},
"dataType": {
"description": "Datatype",
"type": "object",
"properties": {
"type": {
"description": "dataType",
"type": "string"
},
"precision": {
"description": "precision",
"type": "integer",
"minimum": 1
},
"scale": {
"description": "scale",
"type": "integer",
"minimum": 0
},
"length": {
"description": "length",
"type": "integer",
"minimum": 0
},
"size": {
"description": "size",
"type": "integer",
"minimum": 1
},
"sizeUnits": {
"description": "varchar size units",
"type": "string",
"enum": [
"BYTE",
"CHAR"
]
},
"fractionalSecondsPrecision": {
"description": "fractionalSecondsPrecision",
"type": "integer"
},
"yearPrecision": {
"description": "yearPrecision",
"type": "integer"
},
"dayPrecision": {
"description": "dayPrecision",
"type": "integer"
}
},
"anyOf": [
{
"if": {
"properties": {
"type": {
"const": "NUMBER"
}
}
},
"then": {
"required": [
"precision",
"scale"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "FLOAT"
}
}
},
"then": {
"required": [
"precision"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "VARCHAR2"
}
}
},
"then": {
"required": [
"length",
"sizeUnits"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "RAW"
}
}
},
"then": {
"required": [
"size"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "CHAR"
}
}
},
"then": {
"required": [
"length",
"sizeUnits"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "NCHAR"
}
}
},
"then": {
"required": [
"length"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "UROWID"
}
}
},
"then": {
"required": [
"size"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "NVARCHAR2"
}
}
},
"then": {
"required": [
"length"
]
}
},
{
"if": {
"properties": {
"type": {
"enum": [
"TIME",
"TIME WITH TIMEZONE",
"TIMESTAMP",
"TIMESTAMP WITH TIME ZONE",
"TIMESTAMP WITH LOCAL TIME ZONE"
]
}
}
},
"then": {
"required": [
"fractionalSecondsPrecision"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "INTERVAL YEAR TO MONTH"
}
}
},
"then": {
"required": [
"yearPrecision"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "INTERVAL DAY TO SECOND"
}
}
},
"then": {
"required": [
"dayPrecision",
"fractionalSecondsPrecision"
]
}
}
]
},
"isPk": {
"description": "Is Primary Key",
"type": "boolean",
"default": false
},
"isUk": {
"description": "Is Unique Key",
"type": "boolean",
"default": false
},
"isFk": {
"description": "Is Foreign Key",
"type": "boolean",
"default": false
},
"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 domain annotations",
"type": "array",
"items": {
"$ref": "annotation"
}
}
}
},
"annotations": {
"description": "Column annotations",
"type": "array",
"items": {
"$ref": "annotation"
}
}
},
"required": [
"name",
"isPk",
"isUk",
"isFk",
"dataType",
"notNull"
]
}
COLUMNサブオブジェクト・タイプのJSONスキーマ(level ALL)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/ALL/object_info/column",
"title": "DBMS_DEVELOPER.GET_METADATA/ALL/OBJECT_INFO/COLUMN",
"description": "Information for column",
"type": "object",
"properties": {
"name": {
"description": "Column name",
"type": "string"
},
"default": {
"description": "Default value",
"anyOf": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"notNull": {
"description": "Not null",
"type": "boolean",
"default": false
},
"dataType": {
"description": "Datatype",
"type": "object",
"properties": {
"type": {
"description": "dataType",
"type": "string"
},
"precision": {
"description": "precision",
"type": "integer",
"minimum": 1
},
"scale": {
"description": "scale",
"type": "integer",
"minimum": 0
},
"length": {
"description": "length",
"type": "integer",
"minimum": 0
},
"size": {
"description": "size",
"type": "integer",
"minimum": 1
},
"sizeUnits": {
"description": "varchar size units",
"type": "string",
"enum": [
"BYTE",
"CHAR"
]
},
"fractionalSecondsPrecision": {
"description": "fractionalSecondsPrecision",
"type": "integer"
},
"yearPrecision": {
"description": "yearPrecision",
"type": "integer"
},
"dayPrecision": {
"description": "dayPrecision",
"type": "integer"
}
},
"anyOf": [
{
"if": {
"properties": {
"type": {
"const": "NUMBER"
}
}
},
"then": {
"required": [
"precision",
"scale"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "FLOAT"
}
}
},
"then": {
"required": [
"precision"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "VARCHAR2"
}
}
},
"then": {
"required": [
"length",
"sizeUnits"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "RAW"
}
}
},
"then": {
"required": [
"size"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "CHAR"
}
}
},
"then": {
"required": [
"length",
"sizeUnits"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "NCHAR"
}
}
},
"then": {
"required": [
"length"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "UROWID"
}
}
},
"then": {
"required": [
"size"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "NVARCHAR2"
}
}
},
"then": {
"required": [
"length"
]
}
},
{
"if": {
"properties": {
"type": {
"enum": [
"TIME",
"TIME WITH TIMEZONE",
"TIMESTAMP",
"TIMESTAMP WITH TIME ZONE",
"TIMESTAMP WITH LOCAL TIME ZONE"
]
}
}
},
"then": {
"required": [
"fractionalSecondsPrecision"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "INTERVAL YEAR TO MONTH"
}
}
},
"then": {
"required": [
"yearPrecision"
]
}
},
{
"if": {
"properties": {
"type": {
"const": "INTERVAL DAY TO SECOND"
}
}
},
"then": {
"required": [
"dayPrecision",
"fractionalSecondsPrecision"
]
}
}
]
},
"isPk": {
"description": "Is Primary Key",
"type": "boolean",
"default": false
},
"isUk": {
"description": "Is Unique Key",
"type": "boolean",
"default": false
},
"isFk": {
"description": "Is Foreign Key",
"type": "boolean",
"default": false
},
"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 domain annotations",
"type": "array",
"items": {
"$ref": "annotation"
}
}
}
},
"annotations": {
"description": "Column annotations",
"type": "array",
"items": {
"$ref": "annotation"
}
},
"numDistinct": {
"description": "The number of distinct values in the column",
"type": "integer"
},
"lowValue": {
"description": "The low value in the column",
"type": "string"
},
"highValue": {
"description": "The high value in the column",
"type": "string"
},
"density": {
"description": "The average length of the column in bytes",
"type": "integer"
},
"avgColLen": {
"description": "The number of distinct values in the column",
"type": "integer"
},
"hiddenColumn": {
"description": "Indicates whether the column is a hidden column",
"type": "boolean"
},
"virtualColumn": {
"description": "Indicates whether the column is a virtual column",
"type": "boolean"
},
"reservableColumn": {
"description": "Indicates whether the column is a reservable column",
"type": "boolean"
},
"identityColumn": {
"description": "Indicates whether the column is a identity column",
"type": "boolean"
},
"encryptedColumn": {
"description": "Indicates whether the column is a encrypted column",
"type": "boolean"
}
},
"required": [
"name",
"isPk",
"isUk",
"isFk",
"dataType",
"notNull",
"hiddenColumn",
"virtualColumn",
"reservableColumn",
"identityColumn",
"encryptedColumn"
]
}
75.3.1.1.5 サブオブジェクト型のJSONスキーマ : constraints
サブオブジェクトconstraintsのtypicalおよびallレベルのJSONスキーマ。
constraintsサブオブジェクト・タイプのJSONスキーマ(表形式)
表75-6 サブオブジェクト型のJSONスキーマ : CONSTRAINTS
| フィールド | ||||
|---|---|---|---|---|
| BASIC | TYPICAL | ALL | ||
| name | ✔ | ✔ | ||
| constraintType | ✔ | ✔ | ||
| searchCondition | ✔ | ✔ | ||
| columns | name | ✔ | ✔ | |
| referencedConstraintName | ✔ | ✔ | ||
| referencedTable | ✔ | ✔ | ||
| action | ✔ | ✔ | ||
| referencedOwner | ✔ | ✔ | ||
| referencedColumns | ✔ | ✔ | ||
| status | ✔ | ✔ | ||
| deferrable | ✔ | ✔ | ||
| validated | ✔ | ✔ | ||
| sysGeneratedName | ✔ | ✔ |
ノート:
constraintTypeがREFERENTIAL INTEGRITYに設定されている場合、スキーマにはreferencedConstraintName、 referencedOwner、referencedTableおよびreferencedColumnsフィールドが必要です。
CONSTRAINTサブオブジェクト・タイプのJSONスキーマ(level TYPICAL)
ノート:
Constraintスキーマは、BASIC levelでは使用できません。
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/TYPICAL/object_info/constraint",
"title": "DBMS_DEVELOPER.GET_METADATA/TYPICAL/OBJECT_INFO/CONSTRAINT",
"description": "Information for constraint",
"type": "object",
"properties": {
"name": {
"description": "Constraint name",
"type": "string"
},
"constraintType": {
"description": "Type of constraint definition: CHECK, CHECK - NOT NULL, PRIMARY KEY, UNIQUE, REFERENTIAL INTEGRITY, VIEW CHECK, VIEW READONLY",
"type": "string"
},
"searchCondition": {
"description": "Text of search condition for a check constraint",
"type": "string"
},
"columns": {
"description": "Table columns",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Name associated with column or attribute of object column specified in the constraint definition",
"type": "string"
}
}
}
},
"referencedConstraintName": {
"description": "Name of unique constraint definition for referenced table",
"type": "string"
},
"referencedTable": {
"description": "Name of table used in referential constraint",
"type": "string"
},
"action": {
"description": "On delete rule",
"type": {
"enum": [
"RESTRICT",
"CASCADE",
"SET NULL",
"SET DEFAULT"
]
}
},
"referencedOwner": {
"description": "Owner of table used in referential constraint",
"type": "string"
},
"referencedColumns": {
"description": "Referenced table columns",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Referenced table column name",
"type": "string"
}
}
}
},
"status": {
"description": "Constraint status",
"type": {
"enum": [
"ENABLED",
"DISABLED"
]
}
},
"deferrable": {
"description": "Deferrable",
"type": "boolean",
"default": false
},
"validated": {
"description": "Validated",
"type": {
"enum": [
"VALIDATED",
"NONVALIDATED"
]
}
},
"sysGeneratedName": {
"description": "System Generated constraint",
"type": "boolean"
}
},
"required": [
"name",
"constraintType",
"status",
"deferrable",
"validated",
"sysGeneratedName"
],
"if": {
"properties": {
"constraintType": {
"const": "REFERENTIAL INTEGRITY"
}
}
},
"then": {
"required": [
"referencedConstraintName",
"referencedOwner",
"referencedTable",
"referencedColumns"
]
}
}
CONSTRAINTサブオブジェクト・タイプのJSONスキーマ(level ALL)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://oracle.com/schema/23.9/DBMS_DEVELOPER.GET_METADATA/ALL/object_info/constraint",
"title": "DBMS_DEVELOPER.GET_METADATA/ALL/OBJECT_INFO/CONSTRAINT",
"description": "Information for constraint",
"type": "object",
"properties": {
"name": {
"description": "Constraint name",
"type": "string"
},
"constraintType": {
"description": "Type of constraint definition",
"type": "string"
},
"searchCondition": {
"description": "Text of search condition for a check constraint",
"type": "string"
},
"columns": {
"description": "Table columns",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Name associated with column or attribute of object column specified in the constraint definition",
"type": "string"
},
"position": {
"description": "Original position of column or attribute in definition",
"type": "integer"
}
}
}
},
"referencedConstraintName": {
"description": "Name of unique constraint definition for referenced table",
"type": "string"
},
"referencedTable": {
"description": "Name of table used in referential constraint",
"type": "string"
},
"action": {
"description": "On delete rule",
"type": {
"enum": [
"RESTRICT",
"CASCADE",
"SET NULL",
"SET DEFAULT"
]
}
},
"referencedOwner": {
"description": "Owner of table used in referential constraint",
"type": "string"
},
"referencedColumns": {
"description": "Referenced table columns",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Referenced table column name",
"type": "string"
},
"position": {
"description": "Original position of column or attribute in definition",
"type": "integer"
}
}
}
},
"status": {
"description": "Constraint status",
"type": {
"enum": [
"ENABLED",
"DISABLED"
]
}
},
"deferrable": {
"description": "Deferrable",
"type": "boolean",
"default": false
},
"validated": {
"description": "Validated",
"type": {
"enum": [
"VALIDATED",
"NONVALIDATED"
]
}
},
"sysGeneratedName": {
"description": "System Generated constraint",
"type": "boolean"
}
},
"required": [
"name",
"constraintType"
],
"if": {
"properties": {
"constraintType": {
"const": "REFERENTIAL INTEGRITY"
}
}
},
"then": {
"required": [
"referencedConstraintName",
"referencedOwner",
"referencedTable",
"referencedColumns"
]
}
}