Part II Store and Manage JSON Data
You can create, partition, and replicate database tables with JSON columns
(native binary or textual).You can ensure the data has particular shapes and types using
JSON Schema. If textual, you can ensure it's well-formed JSON using an is
json
check constraint (binary JSON is always well-formed).
- Overview of Storing and Managing JSON Data
You can store JSON data in one or more columns of a table, alone or with relational columns.JSON
data type is recommended, but you can also store JSON textually. If you store textual JSON data then use SQL/JSON conditionis json
to ensure that the data is well-formed. - Tables With JSON Columns
You can store JSON data in columns of database tables. If your use case is mainly document-centric you can store the documents in JSON collection tables for easiest use with document APIs. However you store JSON data, you can access, query, and update it in the same ways. - SQL/JSON Conditions IS JSON and IS NOT JSON
SQL/JSON conditionsis json
andis not json
are complementary. They test whether their argument is syntactically correct, that is, well-formed, JSON data. With optional keywordVALIDATE
they test whether the data is also valid with respect to a given JSON schema. - JSON Collections
JSON collections are database objects that store or otherwise provide a set of JSON documents. Client applications typically use operations provided by document APIs to manipulate collections and their documents. They can also use SQL to do so. - JSON Schema
You can create a JSON schema against which to validate the structure and type information of your JSON documents. You can validate data on the fly or do it with a check constraint to ensure that only schema-valid data is inserted in a JSON column. - Character Sets and Character Encoding for JSON Data
JSON data always uses the Unicode character set. In this respect, JSON data is simpler to use than XML data. This is an important part of the JSON Data Interchange Format (RFC 8259). For JSON data processed by Oracle Database, any needed character-set conversions are performed automatically. - Considerations When Using LOB Storage for JSON Data
LOB storage considerations for JSON data are described, including considerations when you use a client to retrieve JSON data as a LOB instance. - Partitioning JSON Data
Partitioning can increase performance by using only a particular subset of the data in a table. To partition JSON data you use a JSON expression column as the partitioning key, extracting the scalar column data from JSON data in the table using SQL/JSON functionjson_value
. - Replication of JSON Data
You can use Oracle GoldenGate, Oracle XStreams, Oracle Data Guard, or Oracle Active Data Guard to replicate tables that have columns containing JSON data. You can also use Oracle GoldenGate to replicate JSON-relational duality views.