Skip Headers
Oracle® TimesTen In-Memory Database SQL Reference
Release 11.2.1

Part Number E13070-04
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

GRANT

The GRANT statement assigns one or more privileges to a user.

Required privilege

ADMIN to grant system privileges.

ADMIN or the object owner to grant object privileges.

SQL syntax

GRANT {SystemPrivilege [,...] | ALL [PRIVILEGES]} [...] TO {user |PUBLIC} [,...]

GRANT {{ObjectPrivilege [,...] | ALL [PRIVILEGES]} ON {[owner.]object}[,...]} TO {user | PUBLIC} [,...]

Parameters

Granting system privileges:

Parameter Description
SystemPrivilege See "System privileges" for a list of acceptable values.
ALL [PRIVILEGES] Assigns all system privileges to the user.
user Name of the user to whom privileges are being granted. The user name must first have been introduced to the TimesTen database by a CREATE USER statement.
PUBLIC Specifies that the privilege is granted to all users.

Granting object privileges:

Parameter Description
ObjectPrivilege See "Object privileges" for a list of acceptable values.
ALL [PRIVILEGES] Assigns all object privileges to the user.
[owner.]object object is the name of the object on which privileges are being granted. owner is the owner of the object. If owner is not specified, then the user who is granting the privilege is assumed to be the owner.
user Name of the user to whom privileges are being granted. The user must exist in the database.
PUBLIC Specifies that the privilege is granted to all users.

Description

Examples

Grant the ADMIN privilege to the user terry:

GRANT admin TO terry;

Assuming the grantor has ADMIN privilege, grant the SELECT privilege to user terry on the customers table owned by user pat:

GRANT select ON pat.customers TO terry;

Grant an object privilege to user terry:

GRANT select ON emp_details_view TO terry;

See also


CREATE USER
ALTER USER
DROP USER
REVOKE
"The PUBLIC role"