Select any table except a few tables

Database 11g:

--------------------

I would like to give a right to select user on all the tables, except in a few tables.  I thought to give "Select any table", but this does not also some paintings, should not access.

2nd way is to go... one by one, select wise schema and grant privileges using script.  But it's a lot of time because we have the very large number of tables.

Is there another way by which we can accomplish this easily.

You must grant select to each table. Please do not choose any table - which is almost never appropriate.

If it's so hard, just write a query like:

Select "grant select on" | table_name | "from some_user '.

from user_tables

where table_name not in ('FOO', 'BAR', "Etc.")

and reel the results to a file.

If it is necessary, consider granting privileges to a role and then assign this role to a user - will make it easier to manage if you ever have to do the same for other users.

Tags: Database

Similar Questions

  • Access control table and select any table privs

    Can we restrict access to a table of other users that have select any table privs? I think of the CAE, but not familiar with it. Not sure VPD can ensure the owner have access fulll and others not. Any idea?

    -Denis

    >
    Can we restrict access to a table of other users that have select any table privs? I think of the CAE, but not familiar with it. Not sure VPD can ensure the owner have access fulll and others not. Any idea?
    >

    Yes it is possible with the SRM. Users with SELECT ANY TABLE would see no lines with the following method, which assumes that the owner of the table is HR:

    connect system/pwofsystem
    create or replace function only_owner (schema varchar2, tab varchar2) return varchar2 is
    begin
    return 'user=''HR'' ';
    end;
    /
    
    BEGIN
      dbms_rls.add_policy(object_schema => 'hr',
      object_name => 'departments',
      policy_name => 'hr_policy',
      function_schema =>'system',
      policy_function => 'only_owner'
    );
    END;
    /
    

    Only the DB HR user is now able to see the rows in the table.
    And sys, which has the privilege of POLICE TAX-FREE ACCESS.

    Kind regards
    Uwe

    http://uhesse.WordPress.com

  • Impossible to revoke 'select any table' system priv

    I created a new user and could revoke it select all table permissions. It seems that any new user oracle, I create a select it the permissions on the tables. I want only alow this new user to choose among 5 tables and not others. It seems that there is a global setting on the database to allow selection of any table. I can't change that, if this is the case, but I would like to create this limited user.

    How can I change the permissions on my new user oracle does not allow to select any table?

    Any help would be appreciated

    No, it is not possible. As the name suggested, the PUBLIC is everyone in society. You cannot exclude a person from the public.

  • How to prevent a user not to access a table of perticular? This user has select any table privilege. Please help me solve this problem.

    Hello

    How to prevent a user not to access a table special (xxx)?

    This user has SELECT a TABLE ALL privilege. I need to restrict to only not for access xxx to the table, but this table is not existed in its own schema.

    But there is access able as select * from schema.table;

    How can I revoke this privilege.

    Please help me solve this problem.

    Thank you

    Lacombe

    1623609 wrote:

    How can I select privilege on specific tables at the same time?

    I want to create a new user and grants the right to select for tables, except a table (xxxx).

    It will be possible without the keystone of the database?

    One way, in several sql

    coil doit.sql

    Select ' grant select on ' | owner: '. ' || table_name |' to someuser. »

    from dba_tables

    where

    spool off

    Then sanity check "doit.sql" and execute it.

  • How to grant the right to select any database to a particular user

    Hi gurus,

    I need to give the right to select all tables in a database to a particular user, in my opinion, there is no way to do it. Please confirm if this is possible.
    If it is not possible, so please let me know if there is any way I can grant select on all tables in a particular pattern (for example - select funding on all the tables under apps)

    Thank you
    Sadiq.

    I need to give the right to select all tables in a database to a particular user, in my opinion, there is no way to do it. Please confirm if this is possible.

    You can issue the command "grant select any table of .

    Alternatively, you can refer to this thread.

    How to GRANT SELECT on all tables 1 GB?
    How to GRANT SELECT on all tables 1 GB?

    If it is not possible, so please let me know if there is any way I can grant select on all tables in a particular pattern (for example - select funding on all the tables under apps)

    It is possible as shown above. If you want to grant select on the specific schema, again see the same thread and add a condition where clause in select only the tables under scheme APPS (i.e. where owner = 'APPS').

    Thank you
    Hussein

  • Of FUNDING and dynamic SQL CREATE ANY TABLE

    Hi gurus,

    I have a dynamic SQL code in a procedure where a table to an existing table without data will be created.

    strSQL: = "create table ' | strTemp | ' in select * from '. strArc. "where 1 = 2"; "
    Execute immediate strSQL;


    without GRANT CREATE ANY TABLE to user, * "ORA-01031: insufficient privileges" * error executing. "."

    Is there a way to tackle this problem without providing a GRANT CREATE ANY TABLE privileged?


    Thank you very much
    Charles

    (1) why you are creating a table to run? Which seems to me very concerning. If you create a temporary table and you're accustomed to work how temporary tables in other databases, I would strongly suggest you look at how Oracle manages global temporary tables. If temporary storage is really necessary (99% of the time is not because of the consistent reading multi-version), you should be able to create global temporary tables a few during execution.

    (2) the owner of the procedure should just need the CREATE TABLE privilege granted directly to the user (not granted through a role), assuming that it is in stored procedure a standard DEFINER rights.

    Justin

  • Audit to create any table

    SQL > select * from v version $;

    BANNER

    --------------------------------------------------------------------------------

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

    PL/SQL Release 11.2.0.1.0 - Production

    CORE 11.2.0.1.0 Production

    AMT for 32-bit Windows: Version 11.2.0.1.0 - Production

    NLSRTL Version 11.2.0.1.0 - Production

    SQL > select audit_option in the dba_stmt_audit_opts;

    no selected line

    SQL > see the parameter checking.

    VALUE OF TYPE NAME

    ------------------------------------ ----------- ------------------------------

    audit_file_dest string C:\APP\ADMINISTRATOR\ADMIN\ORC

    L\ADUMP

    audit_sys_operations boolean FALSE

    AUDIT_TRAIL DB string

    SQL > select count (*) in the dba_audit_trail;

    COUNT (*)

    ----------

    4132

    SQL > audit create any table Scott.

    Verification succeeded.

    SQL > select audit_option in the dba_stmt_audit_opts;

    AUDIT_OPTION

    ----------------------------------------

    CREATE A TABLE

    SQL > create table dummy (a number);

    Table created.

    SQL > insert into values dummy (1);

    1 line of creation.

    SQL > commit;

    Validation complete.

    SQL > select count (*) in the dba_audit_trail;

    COUNT (*)

    ----------

    4132

    SQL >

    So, my question is why I see no + 1 in dba_audit_trail while the user scott has been audit to create any table that is before activation of the audit and creating the table there are 4132 lines in dba_audit_trail and they are same even after activation of the audit and create the table. Kindly help me to understand.

    Thank you.

    It seems the user scott created table in its own schema, you must check create table as well.

    Thank you

    Bigot

  • Problem with "select * from table" for dynamic IN the list

    I have a 'for loop' based a query that does not work. The query is supposed to return the name of the table, the data type and the name of the column in the columns poses a number of name filters. The problem I have is when I run the query into a TOAD with:

    schema_list value SCOTT, MED and the clause of 'in' as ' to (select * from table (DATAPUMP_UTIL.in_list_varchar2 (:schema_list))))»

    The query returns the expected lines.

    When I have it in my code as shown below it returns no rows. I don't know what hurts me, but any help would be great! I'm on Oracle 11.1.0.6.0.
    PROCEDURE export_schema_ondemand (schema_list VARCHAR2, encrypt_file NUMBER default 0, mask_sensitive_data NUMBER default 0) IS  
        ...
        schema_list_t := my_package.in_list_varchar2(schema_list);
        ... 
        for c1 in
           (
            with ok_to_mask as (
            select 
                owner,
                table_name, 
                column_name
            from   
               all_tab_columns
            where
                owner in (select * from table(schema_list_t))
            minus
            (SELECT 
                c.owner,
                p.table_name,
                cc.column_name
            FROM 
                all_cons_columns cc, 
                all_constraints p,
                all_constraints c
            WHERE 
                c.owner in (select * from table(schema_list_t))
                c.constraint_type = 'R'
                AND p.owner = c.r_owner
                AND p.constraint_name = c.r_constraint_name
                AND cc.owner = c.owner
                AND cc.constraint_name = c.constraint_name
                AND cc.table_name = c.table_name
            UNION ALL
            SELECT 
                c.owner,
                cc.table_name,
                cc.column_name
            FROM 
                all_cons_columns cc,
                all_constraints p,
                all_constraints c
            WHERE
                p.owner in (select * from table(schema_list_t))
                AND p.constraint_type in ('P','U')
                AND c.r_owner = p.owner
                AND c.r_constraint_name = p.constraint_name
                AND c.constraint_type = 'R'
                AND cc.owner = c.owner
                AND cc.constraint_name = c.constraint_name
                AND cc.table_name = c.table_name))
            select 
                atc.table_name as mask_tab, 
                atc.column_name as mask_col, 
                atc.data_type as mask_type
            from   
                all_tab_columns atc,
                ok_to_mask otm
            where
                atc.owner = otm.owner
                and atc.table_name = otm.table_name
                and atc.column_name = otm.column_name
                and atc.owner in (select * from table(schema_list_t))
                and 
                (
                atc.column_name like '%LAST%NAME%'
                or atc.column_name like '%FIRST%NAME%'
                or atc.column_name like '%NAME_LAST%'
                or  atc.column_name like '%NAME_FIRST%'
                or  atc.column_name like '%ENAME%'
                or atc.column_name like '%SSN%'
                or atc.column_name like '%DOB%'
                or atc.column_name like '%BIRTH%'
                )
                and atc.column_name not like '%PHYSICIAN_%'
                and atc.column_name not like '%DR_%'
                and atc.column_name not like '%PROVIDER_%'
                and atc.column_name not like 'PRESCRIBER_%'     
           )
          loop
             ...
    
    FUNCTION in_list_varchar2 (p_in_list  IN  VARCHAR2)  RETURN VARCHAR2_TT is
    
        l_tab   VARCHAR2_TT := VARCHAR2_TT();
        l_text  VARCHAR2(32767) := p_in_list || ',';
        l_idx   NUMBER;
            
    BEGIN
        LOOP l_idx := INSTR(l_text, ',');
            EXIT WHEN NVL(l_idx, 0) = 0;
            l_tab.extend;
            l_tab(l_tab.last) := TRIM(SUBSTR(l_text, 1, l_idx - 1));
            l_text := SUBSTR(l_text, l_idx + 1);
        END LOOP;
    
        RETURN l_tab;
            
    END in_list_varchar2;
    Published by: BluShadow on June 29, 2011 16:11
    addition of {noformat}
    {noformat} tags.  PLEASE READ {message:id=9360002} TO LEARN TO DO THIS YOURSELF.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Hello

    If you have a query that works well when you launch it directly, and that breaks down when you start with a procedure, this can be a problem of privileges.

    Points of view ALL_ * shows only the objects you have access, but using a procedure, privileges must be granted directly to the user and not with a role.

    You should check the SELECT privileges to your user through roles and give them directly to the user.

    Hope this will help.

    Sylvie

  • eul5 - any table lists the folders used by each query

    Hello world

    Hope all is well,

    We use the discoverer to the Sungard banner (universities) data report
    We report out of an ODS, not directly on the production system.

    We are moving from 3.1 to 8 ODS ODS.

    I learned here recently EUL5_DOCUMENTS to empty a list of the existing queries.
    There is a table that lists folders for each query, which uses the query?

    Recently I learned here that when you create an OUTER join in the Admin, there is a desc. field
    to describe the join. We do this now, but we have previous joins that are not documented in this way.

    If I could create a query with all the tables that uses a query, I could use this query as a kind of checklist
    as we create the joins in 8 ODS.

    Please advise with your thoughts and ideas, tx, sandra

    Hi Sandra,.

    I am not aware of any table schema layer end user which includes the worksheet, the file and the items in folder used, but the EUL V5 business district it has a folder called "EUL5 user requests ', which has it all. This file uses the EUL5_GET_OBJECT_NAME function (as opposed to that seen in other tables) to get all the folder and the folder item information.

    You probably want to consider the installation of the business district of EUL V5 (if you do not already). Guidelines are provided in chapter 19 of the Oracle Business Intelligence Discoverer Administration Guide. Just a few steps, and I think that would greatly help your project.

    Patrick

  • Insert into select * from table 3. -is on the agenda by the needless?

    I've got an example of script, it will work for any table, so I don't bother with the full ddl.

    ----------------------------------------------------------------------------
    create table test in select * from hotels where 1 = 2;

    Insert into test select * from Hotels by city;

    Select the city from the trial;

    -drop table test is serving;
    -----------------------------------------------------------------------------

    The amazing thing is, that the city is ordered alphabetically,
    but you would say it is that an operation order is irrelevant.

    Any ideas on that?

    This will still work?

    Edited by: FourEyes on December 8, 2008 22:55

    Edited by: FourEyes on 8 December 2008 22:56

    Edited by: FourEyes on 8 December 2008 22:56

    Hello

    The [SQL Oracle 10 language reference | http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#sthref9371] manual says:

    «In regards to the ORDER BY clause from the subquery in the DML_table_expression_clause, you place your order is guaranteed only for the inserted rows and only within each extension table.» Orders new lines with regard to existing lines is not guaranteed. »

  • Insert into MDQ_OLD select * from table (lt_monitorMdq);

    I'm trying to insert into a table that has only a single column, which is a column of a user defined type (UDT). The UDT is nested, that is one of the attributes of the UDT is an another UDT.

    I aim to insert into the table like this pseudo-code:

    INSERT INTO T1 SELECT * FROM THE UDT;

    CREATE TABLE MDQ_OLD (myMDQ UDT_T_MONITOR_MDQ)

    NESTED TABLE myMDQ

    (T1_NEW) ACE STORE

    THE NESTED TABLE MONITOR_MDQ_PRIM_RIGHTS

    STORE AS T2_NEW);

    The MONITOR_MDQ_CLI procedure. Read below returns the parameter lt_monitorMdq which is a UDT type as announced. The statement "insert into select MDQ_OLD * table (lt_monitorMdq);" fails, while the second insert statement works.

    Is it possible to get the first statement of work?

    I'm on Oracle 11 g 2.

    DECLARE

    lt_monitorMdq UDT_T_MONITOR_MDQ;

    BEGIN

    MONITOR_MDQ_CLI. Reading (TRUNC (SYSDATE),

    TRUNC (SYSDATE),

    NULL,

    NULL,

    "MILLION BTU.

    lt_monitorMdq); -Note lt_monitorMdq is an OUT parameter

    -This insert does not work

    Insert into MDQ_OLD select * from table (lt_monitorMdq);

    BECAUSE me in 1... lt_monitorMdq.count

    LOOP

    Dbms_output.put_line ('lt_monitorMdq: ' | .mdq_id lt_monitorMdq (i));

    -This integration works

    INSERT INTO MDQ_OLD (MYMDQ)

    VALUES (UDT_T_MONITOR_MDQ (UDT_R_MONITOR_MDQ)

    lt_monitorMdq (i) .gasday,

    1,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    () UDT_T_MONITOR_MDQ_PRIM_RIGHT

    () UDT_R_MONITOR_MDQ_PRIM_RIGHT

    1,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    NULL,

    (NULL)));

    END LOOP;

    END;

    have you tried:

    INSERT INTO MDQ_OLD (myMDQ) VALUES (lt_MonditorMDq);

    curiosity:

    Is there a particular reason, why you have created a table with a single column of type UDT instead of:

    CREATE TABLE... OF UDT_T_MONITOR_MDQ;

    I can tell you from experience that using a nested table, you can easily query the data in the nested table.

    MK

  • Script to select several tables in indesign and editing

    Hi and I hope you can help.

    I need a script that will select all the tables in a doc great indd with tables imported from word.

    I read another question on here need to select all tables simliar

    but I don't have the knowledge of script to modify it according to my needs. I hope someone can help. Hope also I ask not too much either, but here goes.

    I need to select all the tables and the weight of the 0.25pt race

    Then select the row of the top of each column and fill it with 10% black, and make the top line (or cell heights) 'exactly' (not ' at least') height 5.09 mm

    That would make me really, but is it possible to adjust the width of the columns of these tables too using a script and style of cell?

    It would be rank 1 'exactly' mm 112,956 1 cell (cell style 1) and cell 2 row 1 'exactly' 4,956 (cell 2 style)

    Cell 1 (single cell) line 2 117.912 mm (cell style 3)

    1 (single cell) tier 3 the cell (cell 3 style)

    I really hope you can help, because it will allow me to win a load of time.

    Thank you 1 million - in the meantime I will continue to walk through them all manually hoping someone can help before I did all - but it seems that taking me days.

    Thanks again

    Andy

    Password: (ignore the bit of text that says I Anson v Stuart '-c' is just the beginning of the next table)

    start_zpsiby9gwys.jpg

    Finished format:

    finished%20look_zpsjukz9xeo.jpg

    I added the number 2 in the second row of cell 1 all on my own

    Hello

    Use the update below for the height of the top row.

    app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().bottomEdgeStrokeWeight = "0.25pt";
    app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().topEdgeStrokeWeight = "0.25pt";
    app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().leftEdgeStrokeWeight = "0.25pt";
    app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().rightEdgeStrokeWeight = "0.25pt";
    try
    {
    app.activeDocument.colors.item("Black10%").name;
    }
    catch (e){
    app.activeDocument.colors.add({name:"Black10%", model:ColorModel.process, colorValue:[0, 0, 0, 10]});
    }
    app.activeDocument.stories.everyItem().tables.everyItem().rows[0].fillColor = "Black10%";
    app.activeDocument.stories.everyItem().tables.everyItem().rows[0].properties = {autoGrow:false, minimumHeight:"5.09mm", maximumHeight:"5.09mm"};
    

    Thank you

    Kitty

  • Grant select on Tables

    Friends

    What would be the easiest way to give a user access to SELECT a table, but excluding him a specific column?

    TKS!

    Hello KeenOnOracle

    Yes. You can see the contents of the table in real-time in a view.

    Docu to version 11.2

    http://docs.Oracle.com/CD/E11882_01/server.112/e26088/statements_8004.htm#SQLRF01504

    Best regards, David

  • Resize the width of the columns of several stories selected with tables

    I found this wonderful script that matches the width of all tables to the width of their text frames

    It's great because we have several layers, each layer containing the tables in their own language. If the script helps a lot.

    There is only one thing, I would change:

    In this case, the script runs through the entire document. I would like to change that to the framework only we choose (to optimize control and avoid mistakes).

    ----------------------------------------------------------------------

    var myDocument = app.activeDocument;

    for (s = 0; s < myDocument.stories.length; s + +) {}

    for (t = 0; t < myDocument.stories [s].tables.length; t ++) {}

    var myTable is myDocument.stories.item (s).tables.item (t);.

    var myTableParent = myTable.parent;

    var parentWidth = myTableParent.geometricBounds [3] - myTable.parent.geometricBounds [1];

    var factor = parentWidth/myTable.width;

    for (col = 0; col < myTable.columns.length; col ++) {}

    myTable.columns [col] .width * = factor;

    }

    }

    }

    Hello

    Try this,

    var selection = app.selection;

    for (var j = 0; i)<>

    var myTable = selection [j].tables.everyItem () .getElements ();

    for (var i = 0; i)<>

    {

    var myTableParent = .parent myTable [i];

    var parentWidth = myTableParent.geometricBounds [3] - myTable [i].parent.geometricBounds [1];

    var factor = parentWidth/myTable [i] .width;

    for (col = 0; col

    {

    myTable [i] .columns [col] .width * = factor

    }

    }

    }

    Kind regards

    Cognet

  • Syntax of GRANT: grant SELECT on table privileges to a user on a remote database

    Hello
    I have two databases: DEV1 and DEV2. Dev1 is my source database and DEV2 is the target database. There is a table in the diagram A on Dev1. I created a DBLINK PUBLIC 'TESTDBLINK' in the diagram B on DEV2 that connects to figure A on DEV1.

    Machine of Table for the database schema
    DEV1 AN EMP 192.168.210.10

    Database Machine Lik database schema
    DEV2 B TESTDBLINK 192.168.210.11

    How to SELECT on the schema Table EMP (DEV1) diagram b the DEV2 privileges? What is the syntax?


    Sign up for example in the form of scheme A on DEV 1

    SQL > GRANT SELECT ON EMP to? * *

    Thanks for your contributions
    Harry

    Do not give this table in diagram A diagram B.

    Inside the diagram B, you can just issue a select statement as follows:

    select *
    from table@db-link-to-A
    

    Oracle connects to the remote instance by using the credentials of the scheme A, and since A is the owner of this table, Oracle can already access the table.

Maybe you are looking for