This form of the GRANT statement grants authorities that apply to the entire database (rather than privileges that apply to specific objects within the database).
Invocation
This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared. However, if the bind option DYNAMICRULES BIND applies, the statement cannot be dynamically prepared (SQLSTATE 42509).
Authorization
To grant DBADM authority, SYSADM authority is required. To grant other authorities, either DBADM or SYSADM authority is required.
Refer to GRANT (Index Privileges), GRANT (Package Privileges), GRANT (Schema Privileges), GRANT (Server Privileges) and GRANT (Table, View, or Nickname Privileges) for details on other GRANT statements.
Syntax
.-,------------------------. V | >>-GRANT--------+-BINDADD-----------+--+--ON DATABASE-----------> +-CONNECT-----------+ +-CREATETAB---------+ +-CREATE_NOT_FENCED-+ +-IMPLICIT_SCHEMA---+ +-DBADM-------------+ '-LOAD--------------' .-,------------------------------------. V | >----TO----+-+-------+---authorization-name--+--+-------------->< | +-USER--+ | | '-GROUP-' | '-PUBLIC--------------------------'
Description
There is no explicit authority required for view creation. A view can be created at any time if the authorization ID of the statement used to create the view has either CONTROL or SELECT privilege on each base table of the view.
Once a function has been registered as not fenced, it continues to run in this manner even if CREATE_NOT_FENCED is subsequently revoked.
BINDADD, CONNECT, CREATETAB, CREATE_NOT_FENCED and IMPLICIT_SCHEMA are automatically granted to an authorization-name that is granted DBADM authority.
The list of authorization IDs cannot include the authorization ID of the user issuing the statement (SQLSTATE 42502).
Rules
Examples
Example 1: Give the users WINKEN, BLINKEN, and NOD the authority to connect to the database.
GRANT CONNECT ON DATABASE TO USER WINKEN, USER BLINKEN, USER NOD
Example 2: GRANT BINDADD authority on the database to a group named D024. There is both a group and a user called D024 in the system.
GRANT BINDADD ON DATABASE TO GROUP D024
Observe that, the GROUP keyword must be specified; otherwise, an error will occur since both a user and a group named D024 exist. Any member of the D024 group will be allowed to bind packages in the database, but the D024 user will not be allowed (unless this user is also a member of the group D024, had been granted BINDADD authority previously, or BINDADD authority had been granted to another group of which D024 was a member).