|Lesson 3|| GRANT Command|
|Objective||Grant other Users Access to your Tables|
Oracle GRANT Command
When you create a table or view, you are automatically given access to the data contained within the object.
If you want to grant access privileges to another user, you have to explicitly give them access to the objects through the
The syntax used to grant privileges for a table or view is shown using the syntax below.
Granting privileges in Oracle
GRANT privilege/ALL ON object TO user/PUBLIC
- Privilege is the name of a specific privilege. The ALL keyword means that all privileges will be granted on the target object to the specified user
- The name of the table or view to which the privileges apply.
- User is the name of an existing Oracle user. The keyword PUBLIC refers to a special user group that applies the privilege to all users of the database.
Grant Privilege on Object to User
You may notice that you can grant privileges to something called
is a special keyword that is explained at the following link.
Oracle Database Public Privileges
privileges to a specific column in a table, you use the same syntax as described in the MouseOver, except that you insert the name of the column between the list of privileges and the keyword
If you wanted to grant all privileges to a user called "
ADMIN" for the table
you would use the following syntax:
GRANT ALL ON
If you wanted to grant
privileges for the
column in the
table to the user called "
", you would use the following syntax:
GRANT INSERT winning_bid ON LOT TO AUCTIONEER;
The next lesson exploresusing Security Manager to assign object privileges.
grant Command - Exercise