Drop Data Grants

Use the DROP DATA GRANT command to remove a named data grant and all associated data privileges from the database.

Dropping a data grant created without FILTER removes the authorization it supplied. Dropping a data grant filter removes its restriction from subsequent authorization checks. Removing a filter can therefore increase the rows or column values available through the remaining applicable data grants.

Required privilege

Syntax

DROP DATA GRANT [ FILTER ] [IF EXISTS] [schema.]grant_name;

Parameters

Parameter/Keyword Description
FILTER A keyword that indicates that the data grant being dropped was created with FILTER. Omit FILTER when dropping a data grant that was created without it.
schema

The schema name of the data grant. Must be a valid database user. If omitted, the current schema is used.

Error ORA-52553 is raised if the schema (owner) of the data grant is invalid, that is:

  • The owner is not a valid database user, or
  • An Oracle Deep Data Security user (whose schema is XS$NULL) tries to drop a data grant without specifying a schema name.

grant_name The name of the data grant to drop.

Usage notes and restrictions

For syntax diagrams and additional details, see DROP DATA GRANT in Oracle AI Database SQL Language Reference.

Example: Drop a data grant in own schema

DROP DATA GRANT IF EXISTS manager_direct_reports;

Example: Drop a data grant in another schema

DROP DATA GRANT IF EXISTS hr.manager_direct_reports;

Example: Drop a data grant with filter

The following statement drops the manager_employee_filter data grant if it exists:

DROP DATA GRANT FILTER IF EXISTS hr.manager_employee_filter;