GRANT Statement

    The GRANT statement supports the granting of privileges on resources to users or roles as well as the assignment of roles to users.

    You can use GRANT statements to manage privileges on the following Operational Insights objects:

    Database

    Grant Database Diagram
    GRANT

    Example:

    GRANT CREATE, DROP DATABASE TO USER user1, ROLE role1;

    Scope

    Grant Scope Diagram
    GRANT

    Example:

    GRANT CREATE, DROP SCOPE TO USER user1, ROLE role1;
    GRANT CREATE, DROP SCOPE IN DATABASE db TO USER user1, ROLE role1;

    Collection

    Grant Collection Diagram
    GRANT

    Example:

    GRANT SELECT, INSERT ON any COLLECTION TO USER user1, ROLE role1;
    GRANT SELECT, INSERT ON any COLLECTION IN DATABASE db TO USER user1, ROLE role1;
    GRANT SELECT, INSERT ON any COLLECTION IN SCOPE db.dv TO USER user1, ROLE role1;
    GRANT SELECT, INSERT ON COLLECTION col1 TO USER user1, ROLE role1;
    GRANT CREATE, DROP COLLECTION IN DATABASE db TO USER user1, ROLE role1;
    GRANT CREATE, DROP COLLECTION IN SCOPE db.dv TO USER user1, ROLE role1;

    View

    Grant View Diagram
    GRANT

    Example:

    GRANT SELECT ON any VIEW TO USER user1, ROLE role1;
    GRANT SELECT ON any VIEW IN DATABASE db TO USER user1, ROLE role1;
    GRANT SELECT ON any VIEW IN SCOPE db.dv TO USER user1, ROLE role1;
    GRANT SELECT ON VIEW view0 TO USER user1, ROLE role1;
    GRANT CREATE, DROP VIEW IN DATABASE db TO USER user1, ROLE role1;
    GRANT CREATE, DROP VIEW IN SCOPE db.dv TO USER user1, ROLE role1;

    Index

    Grant Index Diagram
    GRANT

    Example:

    GRANT CREATE, DROP INDEX ON any COLLECTION TO USER user1, ROLE role1;
    GRANT CREATE, DROP INDEX ON any COLLECTION IN DATABASE db TO USER user1, ROLE role1;
    GRANT CREATE, DROP INDEX ON any COLLECTION IN SCOPE db.dv TO USER user1, ROLE role1;
    GRANT CREATE, DROP INDEX ON COLLECTION col1 TO USER user1, ROLE role1;

    Function

    Grant Function Diagram
    GRANT

    Example:

    GRANT EXECUTE ON any FUNCTION TO USER user1, ROLE role1;
    GRANT EXECUTE ON any FUNCTION IN DATABASE db TO USER user1, ROLE role1;
    GRANT EXECUTE ON any FUNCTION IN SCOPE db.dv TO USER user1, ROLE role1;
    GRANT EXECUTE ON FUNCTION func TO USER user1, ROLE role1;
    GRANT CREATE, DROP FUNCTION TO USER user1, ROLE role1;
    GRANT CREATE, DROP FUNCTION IN DATABASE db TO USER user1, ROLE role1;
    GRANT CREATE, DROP FUNCTION IN SCOPE db.dv TO USER user1, ROLE role1;

    Library

    Grant Library Diagram
    GRANT

    Example:

    GRANT USAGE ON any LIBRARY TO USER user1, ROLE role1;
    GRANT USAGE ON any LIBRARY IN DATABASE db TO USER user1, ROLE role1;
    GRANT USAGE ON any LIBRARY IN SCOPE db.dv TO USER user1, ROLE role1;
    GRANT USAGE ON LIBRARY db.dv.lib TO USER user1, ROLE role1;
    Grant Link Diagram
    GRANT

    Example:

    GRANT CREATE, DROP, ALTER LINK TO USER user1, ROLE role1;
    GRANT CONNECT, DISCONNECT ON any LINK TO USER user1, ROLE role1;
    GRANT DISCONNECT ON any LINK link0 TO USER user1, ROLE role1;

    Role

    Grant Role Diagram
    GRANT

    Example:

    GRANT CREATE, DROP ROLE TO USER user1, ROLE role1;

    Synonym

    Grant Synonym Diagram
    GRANT

    Example:

    GRANT CREATE, DROP SYNONYM TO USER user1, ROLE role1;
    GRANT CREATE, DROP SYNONYM IN DATABASE db TO USER user1, ROLE role1;
    GRANT CREATE, DROP SYNONYM IN SCOPE db.dv TO USER user1, ROLE role1;