Privilege control

2023-10-24 09:23:03  Updated

By default, functions and procedures can be executed by their creators only. However, the creator can use the GRANT command to authorize other users to execute the functions and procedures.

Syntax:

GRANT system_privilege | role  
TO user | role | PUBLIC [WITH ADMIN OPTION]

GRANT object_privilege | ALL ON schema.object  
TO user | role | PUBLIC [WITH GRANT OPTION]

Example: Grant all users the privilege to execute the hr.log_message stored procedure.

obclient> GRANT EXECUTE ON log_message TO PUBLIC;
Query OK, 0 rows affected

Frequently used system privileges:

  • CREATE ANY PROCEDURE: The privilege to create any stored procedures.

  • DROP ANY PROCEDURE: The privilege to drop any stored procedures.

  • EXECUTE ANY PROCEDURE: The privilege to execute any stored procedures.

For more information, see "Manage user privileges" in the Administrator Guide on the official website of OceanBase Database.

Contact Us