Thursday, October 8, 2009

Granting And Revoking Permissions by anil nain


Granting And Revoking Permissions by anil nain
Permission on the objects created by the use
The objects created by one user are not accessible by another user unless the owner of those objects gives such permission to other user. These permissions cab be given by using the Grant statement. One user can grant permission to another user if he is the owner of the object of has the permission to grant access to other users.
Granting Permissions Using Grant Statement
The Grant statement provides various types of access to database objects such as tables, views and sequence. Granting And Revoking Permissions by anil nain
Syntax
GRANT {object privileges}
ON objectname
TO username
[WITH GRANT OPTION];
Object Privileges
Each object privilege that is granted authorizes the grantee to perform some operation on the object. The user can granto all the privileges or grant only specific object privileges.
The list object privileges is as follows:
· ALTER : allows the grantee to change the table definition with the ALTER
TABLE command
· DELETE : allows the grantee to remove the records from the table eith the DELETE
Command.
· INDEX : allows the grantee to create an index on the table with the CREATE INDEX
Command.
· INSERT : allows the grantee to add records to the table with the INSERT command.
· SELECT : allows the grantee to query to the table with the INSERT command.
· UPDATE : allows the grantee to modify to the records in the tables with the UPDATE
Command.
With Grant Option
The WITH GRANT OPTION allows the grantee to grant object privileges to other users.
Example 1
Grant all privileges on the table product_master to the user Pradeep
GRANT ALL
ON product_master
TO pradeep;
Example 2
Grant Select and Update privileges on table client_master to Mita.
GRANT SELECT, UPDATE
ON client_master
TO mita;
Example 3
Grant all privileges on the table client_master to the user Ivan with the grant option.
GRANT ALL
ON client_master
TO ivan
WITH GRANT OPTION;
Granting And Revoking Permissions by anil nain