How to revoke all grants given to a role

Hi,
I need a single sql query to revoke all grants given to a role. Dropping a role is not a option before me .
Can someone help me with the query:
Regds,
Kunwar

Hi Pawan,
I used this query to find out the grants given to a role.
But i dont know PL/SQL. Can you help me with the pl/sql code ? :)
++++++++++++++++++++
select 'ROLE' typ,
grantee grantee,
granted_role priv,
admin_option ad,
'--' tabnm,
'--' colnm,
'--' owner
from dba_role_privs
where grantee='KUNDBO91_ALL'
union
select 'SYSTEM' typ,
grantee grantee,
privilege priv,
admin_option ad,
'--' tabnm,
'--' colnm,
'--' owner
from dba_sys_privs
where grantee='KUNDBO91_ALL'
union
select 'TABLE' typ,
grantee grantee,
privilege priv,
grantable ad,
table_name tabnm,
'--' colnm,
owner owner
from dba_tab_privs
where grantee='KUNDBO91_ALL'
union
select 'COLUMN' typ,
grantee grantee,
privilege priv,
grantable ad,
table_name tabnm,
column_name colnm,
owner owner
from dba_col_privs
where grantee='KUNDBO91_ALL'
order by 1;
++++++++++++++++++++

Similar Messages

  • How to revoke all privileges?

    hi all. How to revoke all privileges from user? B-)

    For object privileges run :
    SELECT 'revoke ' || PRIVILEGE || ' on ' || table_name || ' from ' || grantee
    || ';\'
    FROM dba_tab_privs
    WHERE grantee = 'USERNAME'
    For system privileges run:
    SELECT 'revoke ' || PRIVILEGE || ' from ' || grantee || ';\'
    FROM dba_sys_privs
    WHERE grantee = 'USERNAME'
    Then run both results in Sql*Plus

  • How to find the grants given to user for package/procedure?

    Hi all,
    how to find the grants in oracle for what all are the grants a user is having for package and procedure?
    Thanks & Regards,
    M.Murali..

    M. Murali
    Questions like this are asked over and over again on numerous sites on the Internet, including this forum, and answered.
    You are aware this forum has a 'Search Forum' button?
    PLEASE USE IT and STOP asking FAQ and DOC questions!!!!!!!!!!!!!!!!!!!
    Sybrand Bakker
    Senior Oracle DBA
    Experts: those who did read the documentation

  • How to revoke and grant permission in java using Security Manager  ??

    I like to revoke and grant permission through java code..can anybody give me a sample code.

    Discussion is here:
    http://forum.java.sun.com/thread.jspa?threadID=731363

  • How to "revoke" privilege with dbms_xdb.changeprivileges

    Dear All!
    How to "revoke" privilege granted with the following code
    DECLARE
    r pls_integer;
    priv xmltype;
    priv_data varchar2(2000);
    BEGIN
    priv_data :=
    '<ace
    xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
    xmlns:dav="DAV:"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
    http://xmlns.oracle.com/xdb/acl.xsd
    DAV:http://xmlns.oracle.com/xdb/dav.xsd">
    <principal>DVLP</principal> <grant>true</grant>
    <privilege><all/></privilege>
    </ace>';
    priv := xmltype.createxml(priv_data);
    r := dbms_xdb.changeprivileges('/xdbconfig.xml', priv);
    END;
    This code is generated by Enterprise Manager
    I guessed that it is necessary to replace grant with deny
    But there is not schema defenition for deny is parent 'ace'
    Thank you in advance for help
    Regards
    Artem

    Dear Mark!
    Thank you for you reply
    I'll try and let you know about results
    Note that This code was generated by Enterprise Manager
    and it seems that it generates the same code when you try
    to grant and revoke privilege!
    Regards
    Artem

  • How to revoke call dbms

    How to revoke a privilege given with the following statement?
    call dbms_java.grant_permission('myschema','java.net.SocketPermission' ,'10.10.16.16' , 'connect,resolve');
    Thanks

    Wrong guess but did you check revoke_permission procedure in dbms_java.

  • How to list all files in a given directory?

    How to list all the files in a given directory?

    A possible recursive algorithm for printing all the files in a directory and its subdirectories is:
    Print the name of the directory
    for each file in the directory:
    if the file is a directory:
    Print its contents recursively
    else
    Print the name of the file.
    Directory "games"
    blackbox
    Directory "CardGames"
    cribbage
    euchre
    tetris
    The Solution
    This program lists the contents of a directory specified by
    the user. The contents of subdirectories are also listed,
    up to any level of nesting. Indentation is used to show
    the level of nesting.
    The user is asked to type in a directory name.
    If the name entered by the user is not a directory, a
    message is printed and the program ends.
    import java.io.*;
    public class RecursiveDirectoryList {
    public static void main(String[] args) {
    String directoryName; // Directory name entered by the user.
    File directory; // File object referring to the directory.
    TextIO.put("Enter a directory name: ");
    directoryName = TextIO.getln().trim();
    directory = new File(directoryName);
    if (directory.isDirectory() == false) {
    // Program needs a directory name. Print an error message.
    if (directory.exists() == false)
    TextIO.putln("There is no such directory!");
    else
    TextIO.putln("That file is not a directory.");
    else {
    // List the contents of directory, with no indentation
    // at the top level.
    listContents( directory, "" );
    } // end main()
    static void listContents(File dir, String indent) {
    // A recursive subroutine that lists the contents of
    // the directory dir, including the contents of its
    // subdirectories to any level of nesting. It is assumed
    // that dir is in fact a directory. The indent parameter
    // is a string of blanks that is prepended to each item in
    // the listing. It grows in length with each increase in
    // the level of directory nesting.
    String[] files; // List of names of files in the directory.
    TextIO.putln(indent + "Directory \"" + dir.getName() + "\":");
    indent += " "; // Increase the indentation for listing the contents.
    files = dir.list();
    for (int i = 0; i < files.length; i++) {
    // If the file is a directory, list its contents
    // recursively. Otherwise, just print its name.
    File f = new File(dir, files);
    if (f.isDirectory())
    listContents(f, indent);
    else
    TextIO.putln(indent + files[i]);
    } // end listContents()
    } // end class RecursiveDirectoryList
    Cheers,
    Kosh!

  • How to revoked 'ANY' privileges being granted to user or role

    Hi all,
    I need to be revoked all 'ANY' privileges that have been granted to all non-DBA user or Role in the database.
    To achieve this what i assume is
    1> i need to find out Role as well all user who are non-DBA
    2> For all non-DBA user i need to find out and revoked 'ANY' privileges if they would have.
    Here i need some information about all tables related to privilieges and non-DBA users
    The below are some example as a reference.
    USER Privileges
    CTXADMIN SELECT ANY TABLE
    PUBLIC MERGE ANY VIEW
    LAXORA ANALYZE ANY
    EXECUTE ANY PROCEDURE
    GRANT ANY ROLE
    INSERT ANY TABLE
    SELECT ANY TABLE
    LAX_NEW ANALYZE ANY
    CREATE ANY TABLE
    DELETE ANY TABLE
    DROP ANY TABLE
    INSERT ANY TABLE
    SELECT ANY TABLE
    USER_NEW SELECT ANY TABLE
    Thank n reagrds
    Laxman

    Hi,
    LAX_ORA wrote:
    Hi all,
    I need to be revoked all 'ANY' privileges that have been granted to all non-DBA user or Role in the database.
    To achieve this what i assume is
    1> i need to find out Role as well all user who are non-DBA
    2> For all non-DBA user i need to find out and revoked 'ANY' privileges if they would have.
    Here i need some information about all tables related to privilieges and non-DBA users
    The below are some example as a reference.
    USER Privileges
    CTXADMIN SELECT ANY TABLE
    PUBLIC MERGE ANY VIEW
    LAXORA ANALYZE ANY
    EXECUTE ANY PROCEDURE
    GRANT ANY ROLE
    INSERT ANY TABLE
    SELECT ANY TABLE
    LAX_NEW ANALYZE ANY
    CREATE ANY TABLE
    DELETE ANY TABLE
    DROP ANY TABLE
    INSERT ANY TABLE
    SELECT ANY TABLE
    USER_NEW SELECT ANY TABLE
    Thank n reagrds
    LaxmanYou can fiind out all the users and roles who have been granted system privileges by querying dba_sys_privs.
    For example:
    SELECT     grantee
    ,     privilege
    FROM     dba_sys_privs
    WHERE     privilege     LIKE '% ANY %'
    ;The grantee column includes users and roles together.
    If you want to find which users have the dba role, then query dba_role_privs.

  • How to revoke everything from a user when opening a new session.

    HI,
    I am using oracle 10g Express Edition and SQL Developer.
    I have 2 user, 2 database connections in my SQL Developer.
    First user is Oracle and its database connection is called TCF.
    Second user is SMITH and its database connection is called TCF_SMITH.
    Oracle user has privileges to do anything.
    SMITH user has no privileges except for CREATE SESSION.
    What I am trying to achieve is assign a user to a role (this role will have grants to select, insert , update from tables) for the current session (this step is successful), and then revoke
    The role from that user (set it back to its default/or revoke everything from it) if opening another session, or session has been terminated (what I am trying to achieve).
    From TCF I was able to do the following:
    CREATE synonym SMITH.EMP_IOD FOR EMP_IOD;
    CREATE ROLE TCF_I;
    GRANT SELECT, INSERT, UPDATE ON EMP_IOD TO TCF_I;
    GRANT TCF_I TO SMITH;In TCF_SMITH
    SMITH has the same privileges as TCF_I.
    so, smith now can select, insert , and update from EMP_IOD table.
    If I open another TCF_SMITH session, and select * from EMP_IOD I should not be able to see any of the records.
    I am trying to make this session base only. Unfortunately when opening another session I am able to select, update and insert records in the new session.
    Is there a way to make this session based ?
    How can I revoke everything from user SMITH from TCF connection ?
    Thanks,

    Oh My Good Lord!
    Rooney,
    What are you attempting to do ?
    In programming anything can be achieved, but there are speicifc tools to solve specific problems .
    I think you are trying to use fork to paint a wall* (If painting the wall indeed is your requirement).
    The "need" as you say...
    +The need for this is to grant the user different roles each time the user logs in.
    for example I can log in 5 different time in one week with different role each time.
    Moday I could have access to X,Y,Z,
    Tuesday I could have access to X,A,B
    Wednesday I could have access to A,B,C.+
    ... is to solve WHAT PROBLEM?
    Please describe your original requirement , not what you think should be the solution/tool to satisfy the requirement.
    In your previous thread you "solved" privilege/role problem by creating SYNONYM. That does not compute at all.
    Re: database roles seems like its not working for me - your help is appreciated
    Think about it. We are here to help each other as best we can.
    Please read more* about Oracle capabilities and "tools" it provides.
    http://tahiti.oracle.com/
    Especially the Oracle Concepts Guide ...
    http://download.oracle.com/docs/cd/B14117_01/server.101/b10743.pdf
    Also, please take time to respond as "helpfully" as possible. each response from you should take you closer to the solution.
    Hopefully, your original requirement will be solved.
    vr,
    Sudhakar B.

  • How to see all sql statements on sql commands under history link

    Hi All,
    How to see the all the sql history on sql commands tab.
    I want see all sql statements.
    Where to set if we need to store more sql statments in history.
    We are using Apex3.2 and 10g database(EE).
    Thanks,
    Nr

    I just checked the source code of the SQL commands history region and that report fetches a maximum of 1000 records. I don't know if you change the setting somewhere in the builder, but seeing the code it looks as though 1000 is hard-coded in the report definition(apex 4.0).
    If you need to see all the command history,you can query the original table: APEX_040000.WWV_FLOW_SW_SQL_CMDS
    Note that is an internal table used by apex and hence you might not find any documentation about it(google got me one valid hit: Identifying Inactive Workspaces which seem to confirm the table's use).
    Anyway, here's what you need to do, ask your dba to grant your workspace user select access on this table
    Connect as dba user and run
    GRANT SELECT ON APEX_040000.wwv_flow_sw_sql_cmds to '<WORKSPACE SCHEMA>'Now you can run the following command from your workspace to see the entire command history using
    select * from APEX_040000.WWV_FLOW_SW_SQL_CMDS where parsed_schema = '<WORKSPACE SCHEMA>';You might want to revoke the grant once you have seen the data/taken out an export due to security issues.

  • Grants given to a user give to another as well...

    How is it possible the grants given to a user , given also to another....
    For example :
    connect scott/tiger;
    grant select on dept to x;
    grant insert on dept to x;
    Many thanks,
    Simon

    As yingkuan points out, the table you're looking for is, presumably DBA_TAB_PRIVS.
    I would point out, though, that 9 times out of 10, writing a script to duplicate the grants for a user from DBA_TAB_PRIVS is a bad idea. The proper approach is almost always to create a role, have the table owner (SCOTT in your last post, USER_A in the original post) grant privileges on the tables to the role, and grant the role to the end users. That is far, far easier than trying to keep grants in sync among multiple users.
    Also, be aware that DBA_TAB_PRIVS only accounts for object-level privileges, not system-level privileges and that it only accounts for privileges granted directly to a user, not those granted to a role (DBA_SYS_PRIVS, ROLE_SYS_PRIVS, ROLE_TAB_PRIVS, ROLE_ROLE_PRIVS, and DBA_ROLE_PRIVS would all come into play for those).
    Justin
    Justin

  • HELP NEEDED: revoked all privileges on form

    how dumb can one be?
    i revoked all privileges of everyone on a form so now i cannot even delete it. is there a way to grant access to the form again?
    thank you,
    Ralf Schmitt

    I know this is an old post to update, but I found it helpful and wanted to note that Sharmila's solution does work.
    If you have problems, go to the procedure itself and follow the directions on what to pass into the procedure. I did change it to specify the variables I was passing but that is a minor change.
    Also, I had to log out of SQLNav before the change took effect, which is weird, but I have had to do that when using other API's as well so it was not entirely unexpected.

  • How to capture the values given in SSC1 transcation?

    Hello All,
    Can anyone suggest me, how to capture the values given in SSC1 transaction?

    Hello Clemens Li,
    Requirement: Integration of SAP Appointment Calendar with Gmail Calendar
    If I create an appointment in SSC1 transaction, it will appear in SAP Appointment calendar. The same thing should get updated in Gmail calendar of SAP user and also in the guest Gmail calendar if exists in appointment.
    So, I have to capture the input values given in SSC1 transaction while creating an appointment in SAP and try to export those values to web services using some function module.  Sending those values to web services completes my task.
    Means, if I create an appointment in SAP, at the same time, the values which I gave must get exported to some object. So that I can send them to web services.
    But my actual problem is with capturing the input values given to SSC1 transaction.
    How can I get those values out to some internal table?
    Another one is, I did not found any BADI to enhance SSC1 transaction so that I can include my code there.
    If you know any enhancements in SSC1, please let me know.
    If you want any more clarification, please let me know.
    Thanks for the response
    DNR Varma

  • How to find all solutions for reordering of vector

    hello everyone
    -I have problem in finding all possible solutions for reordering of vector.
    -I have vector named (vect_temp) and I want to find all possible reordering of this vector.
    -I have function named Min_diff(vect_temp,next_point) works as follows : I should gave it an element (next_point) in the vector (vect_temp) and it must generate the vector (vect_diff) that contains all possible elements next elements.
    -The function nex_min(vect_temp,next_point) works as follows : I should gave it an element (next_point) in the vector (vect_temp) and it must generate the vector (vect_min) that contains all possible elements next elements.
    -reordering critriea:
    -Min_diff(vect_temp,next_point) and nex_min(vect_temp,next_point) and (next_point) in this first iteration is equal to any selected element in the (vect_temp). after calling the functions, if element in the (vect_diff) is equal to the element in ( vect_min) then add this element into the ordered set [ vec_ordering] and call functions Min_diff(vect_temp,next_point) and nex_min(vect_temp,next_point) again , next_point now is the equal to the element that we have been added in the previous step into the ordered set [ vec_ordering] and repeat this process until all elements in (vect_temp) are ordered according to this criteria.
    - I'm able to do reordering according to the cirtira above and find one solution. but the problem is that if (vect_diff) contains many elements that equal to many elements in ( vect_min), in this case I need to do reordering for the first equal element and this will be one solution and then find reordering for the next equal element and so on.
    let's consider this example:
    - let (vect_temp) contains element [5,9,7,3,1]
    - for the firs iteration let the next_point equal to 7
    - after calling function Min_diff(vect_temp,next_point), then (vect_diff) will contain [ 5,9,3]
    - after calling function nex_min(vect_temp,next_point), then ( vect_min) will contain [ 5,9]
    so for now (vect_diff) and ( vect_min) will have two equal elements.
    - the first solution must be that fist take the first equal element and do reordering such that ordered set [ vec_ordering] will equal to [7,5] then call functions Min_diff(vect_temp,next_point), and nex_min(vect_temp,next_point) again. the( next_point) in this iteration is qual to 5, these funtions will find next elements, let's consider that (vect_diff) and ( vect_min) will have equal element [3] then add this element to the ordered set [ vec_ordering] and repeat calling functions util all elments in (vect_temp) are added to the ordered set [ vec_ordering]. This will be one solution. now the second solution will be is to take second equal elment [9] instead of [5] and continue calling functions and finding ordered list.
    so that each time vect_diff and vect_min will have many equal elements, then do reordering for first equal element this is one solution and then do reordering for the second equal element and so on.
    -my code that can only find one solution that takes only first equal element in (vect_diff) and ( vect_min) and continue ordering is below
    for (int y = 0; y < vect_temp.size(); y++) {
         Min_diff(vect_temp);
         nex_min(vect_temp, next_point);
        for (int i = 0; i < vect_diff.size(); i++) {
         String element_min = vect_diff.get(i).toString();
         if (vect_min.contains(element_min)) {
           vec_ordering.add(element_min);
         _2nd_min_element = element_min;
          vec_temp.removeElement(next_point);
          next_point = _2nd_min_element;
          i = vect_diff.size();
         }// end if condition
        } // end for (i)loop
    }// end for (y) loop
    I hope that someone can answer me how to find all posssible reordering set it is urgent pleasssssse

    DarrylBurke wrote:
    Two months on and you still haven't done your own homework?
    [http://forums.sun.com/thread.jspa?threadID=5423090]
    dbWell, nobody has given the answer yet, so how can (s)he?

  • How to display all tables residing in my database

    i'm using 10g express edition.
    i'm developing a .net application using oracle
    i want display table infomation in a datagrid
    for that i need to select tables fromthe database using the interface given by them
    in that i found server name field.....what it actually means?
    also how to create a new database in 10g and how to display all tables residing in the database?
    pls help me
    thanking u
    chaitanya

    user11359516 wrote:
    i want display table infomation in a datagrid
    select owner||'.'||table_name owner_table_name
      from all_tables   
    user11359516 wrote:in that i found server name field.....what it actually means?i'm not sute what you mean by server name field? if you refer to table column name see this code below:
    select owner||'.'||table_name||'.'||column_name table_column_name,
           decode(data_type,'VARCHAR',data_type||'('||to_char(data_length)||')',
                            'VARCHAR2',data_type||'('||to_char(data_length)||')',
                            'NUMBER',decode(data_scale,0,data_type||'('||to_char(data_precision)||')',
                                                      null,data_type,
                                                      data_type||'('||to_char(data_precision)||','||to_char(data_scale)||')'),
                            data_type) type,
                            nullable
      from all_tab_cols
    order by table_name, column_id

Maybe you are looking for

  • Unable to place a value in Flex Field in OAF page

    Hi all, I am unable to place this flex value in the flex field, but i can do this same thing in a normal "Text Field" am able to reterive that number and place in that text field . Problem is placing the same in Flex field , please suggest me how to

  • Error rectification required

    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "6489FDA0649A9A4A45273BCEED518176", item checksum = "1BCA6E3

  • SSRS Date and time Parameter

    Hi Forumers' Im trying to design a report in SSRS with date and time parameters I would like to combined the fromdate,fromtime and stored the value to @Fromdatetime and same with also todate,totime into @ToDatetime. i will used this in a where clause

  • PHP Soap error Could Not connect to host

    Hi all, this is my first time on this forum so I hope I am not doing anything stupid. I have a wsdl file in my local server, when I try to access the code I get error could not connect to the host each time. I thought this was my programming mistake

  • Video calling can't see the person face clearly

    Using Lumia 535, the person that use skype can see me clearly but I see her in double aspect ratio sound like see a big face in front of me. Who can tell me what's going on with my phone?