GRANT (Database Privileges) command

This command gives users database access rights.

Syntax

GRANT privilege., ..TO { grantee } IDENTIFIED by { password }
privilege ::= 
     { CONNECT 
     | DBA
     | RESOURCE }
Keyword Description
privilege Type of privilege to grant:
  • CONNECT - lets grantees connect to and read from the database
  • RESOURCE - lets grantees create objects in the database
  • DBA - implies both CONNECT and RESOURCE, and gives grantees total control over all tables in the database
grantee User name to allow privilege
password Password for user name

Use

Only database administrators (DBAs) can use the GRANT command. If you are a DBA, this command lets you give grantees the right to perform specified actions on the database. ( Grantee is the authorization ID that represents a user or group of users.)

You may use SET PASSWORD to change a password.

Example

GRANT CONNECT,RESOURCE TO CLERK IDENTIFIED BY MY42