Results 1 to 6 of 6

Thread: Granting and revoking privileges on the object

  1. #1
    Join Date
    Dec 2009
    Posts
    4

    Granting and revoking privileges on the object

    I have a stored procedure which can delete some specified tables from the database.After creating the procedure,I grant it to access to some user of database and I don't remember to whom I had given the privileges and may be that user can do anything without my permission and now I need release those privileges from him/her.Tell how would i find and release that privilege.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Granting and revoking privileges on the object

    If you have granted the privilege to particular users and don't remember to whom you had given this privilege.

    To find out,that to whom you have given this privilege some privilege you need to have like you have to access on some data dictionary object which is permitted by the database administrator but some views are also available for the normal user which is described below can help you to find out the user to whom and on which object you had given the privilege.

    The views are as follows:

    USER_TAB_PRIVS
    ALL_TAB_PRIVS
    ROLE_TAB_PRIVS
    DBA_TAB_PRIVS

    USER_ROLE_PRIVS
    ALL_ROLE_PRIVS
    ROLE_ROLE_PRIVS
    DBA_ROLE_PRIVS


    To execute all the views,you need to have some special privilege and if you are running as a normal user then you can use the view which has USER and ALL as a prefix of their name.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Granting privileges on the object

    Granting privileges on the object

    To grant the privileges,you have some objects to grant and the object should be created by you and you should be the owner of that object.

    To grant a particular object to another user of the database is depends on the name of the privileges like what type of operation you are going to allow him.

    To allow the select and update operation on a object for a particular user of the database.you have enter the below command:

    Code:
    GRANT SELECT,UPDATE on MY_TABLE to MARTIN;
    Where MY_TABLE is the name of the object and the user is MARTIN.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    revoking privileges on the object

    When we allow a user to make some desired or allowed operation for a time specified.he can do any operation and whenever the owner want to cancel the permitted privileges,the owner can release that privileges again.

    The statements which is used to allow the privileges to a user.the vice versa statement is being used to revoke or release the permission on the object from the database user.

    The statement used to revoke the privileges would be as follows:


    Code:
    REVOKE SELECT,UPDATE ON MY_TABLE FROM MARTIN;

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    With grant option with Grant statement

    With grant option with Grant statement

    The admin option is used to show that the privileges which is granted to particular user can be passed to different users of the database.Just add the with grant option word in the last of the grant statement that will take the following form:

    GRANT SELECT,UPDATE ON MY_TABLE FROM MARTIN WITH GRANT OPTION;

    Now the martin user can pass the same privilege (select,update) on the my_table object to another user of the database.
    Last edited by Zecho; 23-02-2010 at 10:11 PM.

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    With grant option with revoke statement

    The user to which the owner has permitted the privileges can revoke the same privilege whenever the owner need to revoke.

    If the owner will revoke the privilege from the permitted user and wouldn't mention the last parameter then the privileges would be incomplete and the statement can occur the error message or the privileges would be still available with the next granted user.The revoke statement would take the following form :

    REVOKE SELECT,UPDATE ON MY_TABLE FROM MARTIN WITH GRANT OPTION


    The permission of allowing to other database user to access on this MY_TABLE object would be revoked and no further transaction can be committed with this object.

Similar Threads

  1. Replies: 6
    Last Post: 06-06-2011, 01:34 AM
  2. Replies: 3
    Last Post: 08-01-2011, 06:20 AM
  3. Granting privileges to New database user
    By Ainsley in forum Software Development
    Replies: 4
    Last Post: 06-02-2010, 05:38 PM
  4. Granting mysql privleges in phpmyadmin
    By Chrisch in forum Software Development
    Replies: 5
    Last Post: 18-12-2009, 12:38 PM
  5. Granting Execute Permission on Scheduled Tasks
    By Sanjay Pais in forum Windows Server Help
    Replies: 2
    Last Post: 31-01-2008, 03:21 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,311,334.71335 seconds with 16 queries