Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-11-29 · container image gvenzl/oracle-free:23-slim
A view on another user's table can be created with a plain GRANT SELECT. Granting that view to someone else is different: it effectively hands on access to the base table, so the view owner needs the base table privilege WITH GRANT OPTION. Without it Oracle returns ORA-01720 and names the base table, for example LAB_A.CUSTOMERS.
The three runs below cover a view owner granting to PUBLIC, a CREATE OR REPLACE VIEW on a view that already had grants, and a DBA account (system) granting its own view on a user's table.
In all three, the fix was the same: the table owner granted SELECT on the named table WITH GRANT OPTION to the view owner.
01Granting a view built on another user's table
lab_a granted SELECT ON customers to lab_b, and lab_b created customer_v on lab_a.customers. GRANT SELECT ON customer_v TO PUBLIC failed with ORA-01720: grant option does not exist for LAB_A.CUSTOMERS.
After lab_a ran GRANT SELECT ON customers TO lab_b WITH GRANT OPTION, the same grant succeeded.
Setup
CREATE TABLE customers (customer_id NUMBER PRIMARY KEY, name VARCHAR2(50));
INSERT INTO customers VALUES (1, 'Kim');
COMMIT;
GRANT SELECT ON customers TO lab_b;Table created.
1 row created.
Commit complete.
Grant succeeded.CREATE VIEW customer_v AS SELECT customer_id, name FROM lab_a.customers;View created.GRANT SELECT ON customer_v TO PUBLIC;GRANT SELECT ON customer_v TO PUBLIC
*
ERROR at line 1:
ORA-01720: grant option does not exist for LAB_A.CUSTOMERS
Help: https://docs.oracle.com/error-help/db/ora-01720/GRANT SELECT ON customers TO lab_b WITH GRANT OPTION;Grant succeeded.GRANT SELECT ON customer_v TO PUBLIC;Grant succeeded.02CREATE OR REPLACE VIEW on a granted view adds a table without grant option
lab_b's customer_v was already granted to PUBLIC. lab_b had customers WITH GRANT OPTION but orders without it. Replacing the view to join lab_a.orders failed at the CREATE OR REPLACE itself with ORA-01720: grant option does not exist for LAB_A.ORDERS, the asterisk under lab_a.orders.
user_tab_privs_made showed GRANTABLE = YES for CUSTOMERS and NO for ORDERS. After GRANT SELECT ON orders TO lab_b WITH GRANT OPTION, the view was replaced.
Setup
CREATE TABLE customers (customer_id NUMBER PRIMARY KEY, name VARCHAR2(50));
CREATE TABLE orders (order_id NUMBER PRIMARY KEY, customer_id NUMBER, amount NUMBER);
INSERT INTO customers VALUES (1, 'Kim');
INSERT INTO orders VALUES (10, 1, 100);
COMMIT;
GRANT SELECT ON customers TO lab_b WITH GRANT OPTION;
GRANT SELECT ON orders TO lab_b;Table created.
Table created.
1 row created.
1 row created.
Commit complete.
Grant succeeded.
Grant succeeded.CREATE VIEW customer_v AS SELECT customer_id, name FROM lab_a.customers;
GRANT SELECT ON customer_v TO PUBLIC;View created.
Grant succeeded.CREATE OR REPLACE VIEW customer_v AS
SELECT c.customer_id, c.name, SUM(o.amount) AS total
FROM lab_a.customers c LEFT JOIN lab_a.orders o ON o.customer_id = c.customer_id
GROUP BY c.customer_id, c.name;FROM lab_a.customers c LEFT JOIN lab_a.orders o ON o.customer_id = c.customer_id
*
ERROR at line 3:
ORA-01720: grant option does not exist for LAB_A.ORDERS
Help: https://docs.oracle.com/error-help/db/ora-01720/COLUMN table_name FORMAT A10
COLUMN grantee FORMAT A8
SELECT table_name, grantee, privilege, grantable FROM user_tab_privs_made WHERE grantee = 'LAB_B' ORDER BY table_name;TABLE_NAME GRANTEE PRIVILEGE GRA
---------- -------- ------------------------------ ---
CUSTOMERS LAB_B SELECT YES
ORDERS LAB_B SELECT NO
2 rows selected.GRANT SELECT ON orders TO lab_b WITH GRANT OPTION;Grant succeeded.CREATE OR REPLACE VIEW customer_v AS
SELECT c.customer_id, c.name, SUM(o.amount) AS total
FROM lab_a.customers c LEFT JOIN lab_a.orders o ON o.customer_id = c.customer_id
GROUP BY c.customer_id, c.name;View created.03A DBA account grants its own view on a user's table
system could create lab_customer_v on lab_a.customers without any grant from lab_a. GRANT SELECT ON lab_customer_v TO lab_b still failed with ORA-01720 for LAB_A.CUSTOMERS.
After lab_a ran GRANT SELECT ON customers TO system WITH GRANT OPTION, the grant succeeded.
Setup
CREATE TABLE customers (customer_id NUMBER PRIMARY KEY, name VARCHAR2(50));
INSERT INTO customers VALUES (1, 'Kim');
COMMIT;Table created.
1 row created.
Commit complete.CREATE OR REPLACE VIEW lab_customer_v AS SELECT customer_id, name FROM lab_a.customers;View created.GRANT SELECT ON lab_customer_v TO lab_b;GRANT SELECT ON lab_customer_v TO lab_b
*
ERROR at line 1:
ORA-01720: grant option does not exist for LAB_A.CUSTOMERS
Help: https://docs.oracle.com/error-help/db/ora-01720/GRANT SELECT ON customers TO system WITH GRANT OPTION;Grant succeeded.GRANT SELECT ON lab_customer_v TO lab_b;Grant succeeded.FAQ
How do I fix ORA-01720 grant option does not exist?
Have the owner of the table named in the message grant it to the view owner WITH GRANT OPTION, for example GRANT SELECT ON customers TO lab_b WITH GRANT OPTION;, then grant the view again.
Why does CREATE OR REPLACE VIEW raise ORA-01720?
When the view has already been granted to others, replacing it checks the grant option on every table in the new definition. In the second case the newly joined orders table had no grant option.
Even system/DBA gets ORA-01720. Why?
In the third case system could create the view, but granting it still needed SELECT WITH GRANT OPTION from the table owner.
How do I check whether I have the grant option?
The table owner can run SELECT table_name, grantee, privilege, grantable FROM user_tab_privs_made;. GRANTABLE = YES means WITH GRANT OPTION.
How we verify
Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.
lab_a and lab_b are ordinary users created for the test; system is the DBA account. Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free 23.26.3.0.0