How to grant table privilege to a user in oracle

Posted on 2010-01-07
Last Modified: 2013-12-18
I need to grant lock table table_name in share update mode privilege to a user in oracle. How do I do that. I want to grant the privilege to only one table.

Question by:happylife1234
    LVL 13

    Expert Comment

    Grant lock any table
    to user_id
    with admin option;
    LVL 76

    Accepted Solution

    >>grant the privilege to only one table

    The above grant will allow locks to ANY table (you also probably don't want to admin option).  Per the docs all you need to do is grant select.  This automatically grants 'lock'.

    --11g docs but I tested in in and it seems to work as described

    grant select on table to user;
    LVL 15

    Assisted Solution

    by:Franck Pachot
    If you want something more restrictive than wwhat can be doen with grant command, you can create a stored procedure with the required action (lock table...) and only grant execution on that procedure.
    Why do you need to do that ? maybe there is another solution.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
    This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now