ORA-01031 when using JSON Data Guide

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:

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s