Details on rights management
Learn about the details of all system privileges, object privileges, and system tables in Exasol.
System and object privileges
System privileges
Users
| System privilege | Permissions |
|---|---|
ALTER USER
|
Alter the password of any user This is a powerful privilege and should be granted restrictively. |
CREATE USER
|
Create user |
DROP USER
|
Delete user |
IMPERSONATE ANY USER
|
Impersonate other users |
Roles
| System privilege | Permissions |
|---|---|
CREATE ROLE
|
Create roles |
DROP ANY ROLE
|
Delete roles |
GRANT ANY ROLE
|
Grant any role This is a powerful privilege and should be granted restrictively. |
Connections
| System privilege | Permissions |
|---|---|
ACCESS ANY CONNECTION
|
Access any connection details from scripts |
ALTER ANY CONNECTION
|
Change connection data of a connection |
CREATE CONNECTION
|
Create external connections |
DROP ANY CONNECTION
|
Delete connections |
GRANT ANY CONNECTION
|
Grant any connection to users/roles |
USE ANY CONNECTION
|
Use any connection in statements |
Schema
| System privilege | Permissions |
|---|---|
ALTER ANY SCHEMA
|
Allocate a schema to another user or role |
ALTER ANY VIRTUAL SCHEMA
|
Update parameters of any virtual schema |
ALTER ANY VIRTUAL SCHEMA REFRESH
|
Update the metadata of any virtual schema |
CREATE SCHEMA
|
Create a schema |
CREATE VIRTUAL SCHEMA
|
Create of a virtual schema |
DROP ANY SCHEMA
|
Delete any schema |
DROP ANY VIRTUAL SCHEMA
|
Delete any virtual schema |
USE ANY SCHEMA
|
See and use any schema. This privilege is granted to PUBLIC by default in a new database. |
Tables
| System privilege | Permissions |
|---|---|
ALTER ANY TABLE
|
Alter a table in any schema |
CREATE ANY TABLE
|
Create a table in any schema |
CREATE TABLE
|
Create a table in the user’s own schema or the schema of an allocated role
|
DELETE ANY TABLE
|
Delete rows in a table in any schema |
DROP ANY TABLE
|
Delete tables in any schema |
INSERT ANY TABLE
|
Insert data into a table in any schema |
SELECT ANY DICTIONARY
|
Access the contents of any system table |
SELECT ANY TABLE
|
Access the contents of a table or view in any schema (does not include system tables) |
UPDATE ANY TABLE
|
Alter rows in a table in any schema |
Views
| System privilege | Permissions |
|---|---|
CREATE VIEW
|
Create a view in the user’s own schema or in the schema of an allocated role
|
CREATE ANY VIEW
|
Create a view in any schema |
DROP ANY VIEW
|
Delete views in any schema |
Functions
| System privilege | Permissions |
|---|---|
CREATE FUNCTION
|
Create a function in the user’s own schema or in the schema of an allocated role
|
CREATE ANY FUNCTION
|
Create a function in any schema |
DROP ANY FUNCTION
|
Delete functions in any schema |
EXECUTE ANY FUNCTION
|
Execute functions in any schema |
Scripts
| System privilege | Permissions |
|---|---|
CREATE SCRIPT
|
Create a script in the user’s own schema or in the schema of an allocated role
|
CREATE ANY SCRIPT
|
Create a script in any schema |
DROP ANY SCRIPT
|
Delete scripts in any schema |
EXECUTE ANY SCRIPT
|
Execute scripts in any schema |
Miscellaneous
| System privilege | Permissions |
|---|---|
ALTER SYSTEM
|
Alter system-wide settings (for example, |
CREATE SESSION
|
Connect to the database |
EXPORT
|
Export data from tables using the |
GRANT ANY OBJECT PRIVILEGE
|
Grant or withdraw any object rights |
GRANT ANY PRIVILEGE
|
Grant or withdraw any system rights This is a powerful privilege and should be granted restrictively. |
IMPORT
|
Import data into tables using the |
KILL ANY SESSION
|
Kill session or query |
MANAGE CONSUMER GROUPS
|
Create, alter and drop consumer groups |
SET ANY CONSUMER GROUP
|
Set consumer group for users or roles |
Object privileges
| Object privilege | Schema objects | Permissions |
|---|---|---|
ACCESS
|
Connection |
Access details of a connection from scripts |
ALTER
|
Schema, table, virtual schema |
Run the |
DELETE
|
Schema, table |
Delete rows |
EXECUTE
|
Schema, function, script |
Run functions or scripts |
IMPERSONATION
|
User |
Impersonate another user identity |
INSERT
|
Schema, table |
Insert rows in a table |
REFERENCES
|
Table |
Create foreign keys referencing this table |
REFRESH
|
Virtual schema |
Update the metadata of a virtual schema |
SELECT
|
Schema, table, view, virtual schema, virtual table |
Access the table contents |
UPDATE
|
Schema, table |
Change the contents of a row in a table |
USAGE
|
Schema | View and use a schema |
In order to allow users to use connections in an IMPORT or EXPORT statement, you must grant the connection object to the user or role using the syntax GRANT CONNECTION <CONNECTION NAME> TO <USER/ROLE>.
Required privileges for SQL statements
The following sections list all SQL statements supported in Exasol and the necessary privileges.
By default, all users get the USE ANY SCHEMA system privilege because it is granted to the PUBLIC role. For more information about USAGE, see USAGE privilege.
Users
| SQL statement | Required privileges |
|---|---|
CREATE USER u ... |
System privilege |
ALTER USER u ...
|
Your own password can always be changed. The |
RENAME USER u ...
|
System privilege |
DROP USER u; |
System privilege |
IMPERSONATE u;
|
System privilege |
Roles
| SQL statement | Required privileges |
|---|---|
CREATE ROLE r ...
|
System privilege |
RENAME ROLE r ...
|
System privilege |
DROP ROLE r;
|
System privilege |
Connections
| SQL statement | Required privileges |
|---|---|
CREATE CONNECTION c ... |
System privilege |
ALTER CONNECTION c ...
|
System privilege |
RENAME CONNECTION c ...
|
System privilege ALTER ANY CONNECTION or the connection has to be granted to you with the ADMIN OPTION |
DROP CONNECTION c;
|
System privilege |
Schemas
| SQL statement | Required privileges |
|---|---|
CREATE SCHEMA s; |
System privilege |
OPEN SCHEMA s; |
System privilege Note:The schema objects within the schema are not automatically readable! |
DROP SCHEMA s;
|
System privilege |
ALTER SCHEMA s...
|
|
RENAME SCHEMA s...
|
Schema s must be owned by the current user or one of that user's roles. |
CREATE VIRTUAL SCHEMA s |
|
DROP VIRTUAL SCHEMA s
|
|
ALTER VIRTUAL SCHEMA s SET ... |
|
ALTER VIRTUAL SCHEMA s REFRESH
|
|
ALTER VIRTUAL SCHEMA s CHANGE OWNER u
|
|
Tables
| SQL statement | Required privileges |
|---|---|
CREATE TABLE t (<col_defs>) |
|
CREATE TABLE AS <subquery> |
Similar to |
CREATE OR REPLACE TABLE t ...
|
Similar to |
ALTER TABLE t ... |
|
ALTER TABLE t1 ADD FOREIGN KEY ... REFERENCES t2 ...
|
|
RENAME TABLE t...
|
The schema containing t is owned by the current user or one of that user's roles. |
SELECT * FROM t; |
|
INSERT INTO t ...
|
|
UPDATE t SET ...; |
|
MERGE INTO t USING u ... |
|
DELETE FROM t;
|
|
TRUNCATE TABLE t;
|
|
DROP TABLE t;
|
|
RECOMPRESS TABLE t;
|
|
REORGANIZE TABLE t;
|
|
PRELOAD TABLE t;
|
|
Views
| SQL statement | Required privileges |
|---|---|
CREATE VIEW v AS ...
|
|
CREATE OR REPLACE VIEW v ...
|
Similar to |
RENAME VIEW v...
|
The schema containing v is owned by the current user or one of that user's roles. |
SELECT * FROM v;
|
|
DROP VIEW v;
|
|
Functions
| SQL statement | Required privileges |
|---|---|
CREATE FUNCTION f ...
|
|
CREATE OR REPLACE FUNCTION f ...
|
Similar to |
RENAME FUNCTION f...
|
The schema containing f is owned by the current user or one of that user's roles. |
SELECT f(...) FROM ...;
|
|
DROP FUNCTION f;
|
|
Scripts
| SQL statement | Required privileges |
|---|---|
CREATE SCRIPT s ...
|
|
CREATE OR REPLACE SCRIPT s ...
|
Similar to |
RENAME SCRIPT s...
|
The schema containing s is owned by the current user or one of that user's roles. |
EXECUTE SCRIPT s;
|
|
DROP SCRIPT s;
|
|
Consumer Groups
| SQL statement | Required privileges |
|---|---|
CREATE CONSUMER GROUP c ...
|
System privilege |
ALTER CONSUMER GROUP c ...
|
System privilege |
RENAME CONSUMER GROUP c ...
|
System privilege |
DROP CONSUMER GROUP c;
|
System privilege |
ALTER USER u SET CONSUMER_GROUP ...
|
System privilege |
ALTER ROLE r SET CONSUMER_GROUP ...
|
System privilege |
Grant
| SQL statement | Required privileges |
|---|---|
GRANT <system_privilege> TO <user>
|
System privilege |
GRANT <object_privilege> ON <object> TO <user>
|
System privilege AND System privilege If |
GRANT <role> TO <user>
|
System privilege |
GRANT IMPERSONATION ON
|
The current user must have the DBA role. |
GRANT CONNECTION <connection> TO <user>
|
System privilege GRANT ANY CONNECTION, OR <connection> was granted to the current user or one of their roles with WITH ADMIN OPTION. |
GRANT ACCESS ON CONNECTION <connection> TO <user>
|
System privilege GRANT ANY CONNECTION, OR <connection> was granted to the current user or one of their roles with WITH ADMIN OPTION. |
Revoke
| SQL statement | Required privileges |
|---|---|
REVOKE <sys_priv> FROM u
|
System privilege |
REVOKE <obj_priv> ON o FROM u
|
|
REVOKE r FROM u
|
System privilege |
REVOKE CONNECTION c TO u
|
System privilege |
Import
| SQL statement | Required privileges |
|---|---|
IMPORT INTO (<col_defs>) FROM <file/dbms> ...
|
|
IMPORT INTO (<col_defs>) FROM <script> ...
|
|
IMPORT INTO t FROM <file/dbms> ...
|
|
IMPORT INTO t FROM <script> ...
|
|
Export
EXPORT (<subquery>) INTO <file/dbms> ...
|
|
EXPORT (<subquery>) INTO <script> ...
|
|
EXPORT t INTO <file/dbms> ...
|
|
EXPORT t INTO <script> ...
|
|
Miscellaneous
| SQL statement | Required privileges |
|---|---|
ALTER SESSION ...
|
No privileges are needed for this statement. |
KILL SESSION ...
|
System privilege |
ALTER SYSTEM ...
|
System privilege |
DESC[RIBE] o
|
Schema objects can be described with the |
System tables for rights management
| Category | System table | Description |
|---|---|---|
|
Users |
EXA_DBA_USERS |
All users of the database |
EXA_ALL_USERS
|
All users of the database, restricted information |
|
EXA_USER_USERS |
Current user |
|
|
Roles |
EXA_DBA_ROLES and EXA_ALL_ROLES |
All roles of the database |
EXA_DBA_ROLE_PRIVS
|
Granted roles |
|
EXA_USER_ROLE_PRIVS
|
Roles directly granted to the current user |
|
EXA_ROLE_ROLE_PRIVS
|
Roles possessed by the current user indirectly through other roles |
|
EXA_SESSION_ROLES
|
Roles possessed by the current user |
|
|
Connections |
EXA_DBA_CONNECTIONS
|
All connections of the database |
EXA_ALL_CONNECTIONS
|
All connections of the database, restricted information |
|
EXA_DBA_CONNECTION_PRIVS
|
Granted connections |
|
EXA_USER_CONNECTION_PRIVS
|
Connections directly granted to the current user |
|
EXA_ROLE_CONNECTION_PRIVS
|
Connections possessed by the current user indirectly via other roles |
|
EXA_SESSION_CONNECTIONS
|
Connection to which the current user has access |
|
|
System privileges |
EXA_DBA_SYS_PRIVS
|
Granted system privileges |
EXA_USER_SYS_PRIVS
|
System privileges directly granted to the current user |
|
EXA_ROLE_SYS_PRIVS
|
System privileges granted to the roles of the current user |
|
EXA_SESSION_PRIVS
|
System privileges currently available to the user |
|
|
Object privileges |
EXA_DBA_OBJ_PRIVS and EXA_DBA_RESTRICTED_OBJ_PRIVS |
Object privileges granted to objects on the database |
EXA_ALL_OBJ_PRIVS
|
Similar to |
|
EXA_USER_OBJ_PRIVS and EXA_USER_RESTRICTED_OBJ_PRIVS |
Object privileges on the objects to which the current user has access apart from through the |
|
EXA_ROLE_OBJ_PRIVS and EXA_ROLE_RESTRICTED_OBJ_PRIVS |
Object privileges that have been granted to the roles of the user |
|
EXA_ALL_OBJ_PRIVS_MADE
|
Object privileges self-granted by the current user or those concerning that user's objects |
|
EXA_USER_OBJ_PRIVS_MADE
|
Object privileges that relate to objects of the current user |
|
EXA_ALL_OBJ_PRIVS_RECD
|
Object privileges that have been directly granted to the current user or via PUBLIC |
|
EXA_USER_OBJ_PRIVS_RECD
|
Object privileges that have been directly granted to the current user |
|
EXA_DBA_IMPERSONATION_PRIVS
|
All impersonation privileges |
|
EXA_USER_IMPERSONATION_PRIVS
|
Impersonation privileges of the current user |
Object accessibility
The following system tables show information about objects to which the user has access:
The following tables show the object and system privileges that allow a user to access a schema.
If a user is owner of a schema then the user has access to it.
For all objects, the USE ANY SCHEMA system privilege or USAGE object privilege is required on the schema of the object in addition to the other privileges.
System privileges
| Object | System privileges that provide access through EXA_ALL_* |
|---|---|
| Table |
|
| Script |
|
| View |
|
| Function |
|
| Schema | USE ANY SCHEMA
|
| Virtual schema | USE ANY SCHEMA
|
Object privileges
| Object | Object privileges that provide access through EXA_ALL_* |
|---|---|
| Table |
|
| Script |
|
| View |
|
| Function |
|
| Schema | USAGE
|
| Virtual schema | USAGE
|