What is JSON Data Guide?
A JSON data guide lets you discover information about the structure and content of JSON documents stored in Oracle Database.
Some ways that you can use this information include:
- Generating a JSON Schema document that describes the set of JSON documents.
- Creating views that you can use to perform SQL operations on the data in the documents.
- Automatically adding or updating virtual columns that correspond to added or changed fields in the documents.
For detailed information about JSON Data Guide and how to use it, please refer to:
JSON Data Guide (oracle.com)
When I tried to run the following example (using scott user) to get information about some JSON documents:
I got the following errors:
To fix this issue, you have to login as sys and grant the scott user two privileges:
grant execute on XDB.DBMS_JSON to scott; — This alone will not fix the issue.
grant create view to scott;
Now, I can run the above code successfully: