Examples of Granting DDL Privileges
-
Allow user
JOE
to create tablesGRANT CREATE TABLE TO USER Joe;
-
Allow user
JOE
to alter any procedureGRANT ALTER ANY PROCEDURE TO USER Joe;
Allow user JOE
to create tables
GRANT CREATE TABLE
TO USER Joe;
Allow user JOE
to alter any procedure
GRANT ALTER ANY PROCEDURE
TO USER Joe;
The syntax for granting privileges to create, alter or drop a database deviates from the normal syntax of granting DDL privileges for other object types.
CREATE
Allows creation of a database
ALTER
Allows modification of the current database
DROP
Allows deletion of the current database
ALL [PRIVILEGES]
Combines the ALTER
and DROP
privileges.ALL
does not include the CREATE
privilege.
The ALTER DATABASE
and DROP DATABASE
privileges apply only to the current database, whereas DDL privileges ALTER ANY
and DROP ANY
on other object types apply to all objects of the specified type in the current database.The privilege to alter or drop the current database can only be granted by administrators.
The CREATE DATABASE
privilege is a special kind of privilege as it is saved in the security database.A list of users with the CREATE DATABASE
privilege is available from the virtual table SEC$DB_CREATORS
.Only administrators in the security database can grant the privilege to create a new database.
Note
|
|
Granting SUPERUSER
the privilege to create databases:
GRANT CREATE DATABASE
TO USER Superuser;
Granting JOE
the privilege to execute ALTER DATABASE
for the current database:
GRANT ALTER DATABASE
TO USER Joe;
Granting FEDOR
the privilege to drop the current database:
GRANT DROP DATABASE
TO USER Fedor;