Access grant select on all tables in a diagram to another diagram

Hi all

I can grant select access on the tables of a schema (SAY USER1) to another (SAY USER2) by giving him a role and in turn grant this role to another scheme as below:

FOR x IN (SELECT * from user_tables)
LOOP
RUN IMMEDIATELY "SELECT WE GRANT | x.table_name | "To < < role1 > > ';
END LOOP;

Role1 Grant User2;

but my question is that suppose I create another table say "TEMP_TAB" in the scheme of USER1 after the execution of the block above user2 will be able to access the table TEMP_TAB. My guess is certainly not. If I'm wrong, I want a way to grant select on a table in the schema of user1 immediately as and when it is created to User2.

Please suggest a solution.

Thank you and best regards,
Vipin Kumar Rai

993280 wrote:
Knani,

but in this case the User2 can choose any table in any schema. I want only USER2 for the right to select for only User1 tables.

Thank you
Vipin

Oh sorry. Misinterpreted your post. What you did is the right way to do it. You must add the select role privilege whenever you create a new table. There is no "SELECT the TABLE all THE" specific to a type of data user privilege.

Tags: Database

Similar Questions

  • GRANT SELECT on a table to the user / role changes for the tab last_DDL

    Hello

    Is grant select (or any private object) to the user/role a DDL statement?

    GRANT SELECT on a table to the user / role changes the last_DDL to the table.
    1 > is this expected behavior?
    2 > no way in which we can grant select on a table by another user, without changing the DDL? (for example create view).


    The test is performed:

    Prior to the issuance:


    OBJECT_NAME CREATED TIMESTAMP LAST_DDL_TIME OWNER
    ------- ---------------------- ---------- ------------- --------------------
    AR HZ_CUSTOMER_PROFILES 8 MAY 00 13 MARCH 13 2003-06 - 26:12:41:29



    Grant statement:
    GRANT SELECT ON "AR". "' HZ_CUSTOMER_PROFILES ' TO 'AR_VIEW ';

    Note: AR_VIEW is a role, I tried granting also directly to the user.


    After the grant:

    OBJECT_NAME CREATED TIMESTAMP LAST_DDL_TIME OWNER
    ------- ---------------------- ---------- ------------- --------------------
    AR HZ_CUSTOMER_PROFILES 8 MAY 00 21 MARCH 13 2003-06 - 26:12:41:29



    Old thread, discuss whether Grant is DDL or not, but no documented conclusions.
    ( Re: Grant, revoke is DDL and DCL? )

    Please help in the assessment above.

    -Best regards,.
    Mani

    It's the DOF.

    After all, this isn't DML, it implicitly committed and you cannot use it directly in PL/SQL: features of DDL. :-)

  • Grant select on all the table schema in the role

    Hi, it is possible to grant is selected on all the table on a diagram to a role?

    Yes.

    SELECT 'GRANT ALL ON' ||TABLE_NAME || ' to ROLE_NAME;' from dba_tables where owner='SCHEMA';
    
  • Grant select on all of the views to the public

    How to tune the selection on the all views to the public? Thanks in advance.

    782150 wrote:
    How to tune the selection on the all views to the public? Thanks in advance.

    spool doit.sql
    select 'grant select on '||
              owner ||
             '.' ||
             view_name ||
            ' to public;'
    from dba_views;
    spool off
    

    run doit.sql

    That's how it's done. Whether or not it is wise is a different matter.

  • How to add a ROWDEPENDENCIES in all tables in a diagram

    Hello!

    I want to add ROWDEPENDENCIES in all tables to manage the issue of concurrency.

    Please tel me how to add in all the tables of a schema.

    Yours sincerely

    I guess the OP wants to use the information in the rowdependency to drive a model of optimistic locking?

  • Which granted select on a table and when?

    Hi all
    We are running Oracle 10 g. There are a few differences with an array of our production compared to development environments. The table on the development has also provided a grant and has also a synonym. My boss wants to know who was granted access to this table and when? I'm not a DBA. I asked our s/n, and he said that he doesn't think that Oracle keeps track of this type of information. Is it possible to follow these types of changes? Who created such synonym for this table and when? One last thing to add, is that checking is not turned on.


    Thank you for your comments,

    Seyed

    We can see when synonyms are created but not who created unless there is a check of all DDL

    SQL > select TIMESTAMP, CREATION, OWNER, LAST_DDL_TIME, OBJECT_NAME from dba_objects where type_objet = 'SYNONYM' and OBJECT_NAME ='-' and owner ='-';

    -Thank you

  • How to remove grant select to one user, if this table contains public subsidies.

    Hi all

    Owner of the table gave all access to a table to the public

    for example

    >

    grant all on table1  to public;
    

    But now for a user "user1" if we remove select grant

     revoke   select  on table1 from user1;
    

    I get the error ORA-01927: cannot REVOKE privileges you did not

    OK if I revoke all access to "user1."

    revoke   all  on table1 from user1;
    

    I get Revoke succeeded.

    But always in the connection of the User1, I can select data from table1.

    Why?

    Is it because I gave all subsidies to the public?

    Above scenario must revoke the access of a user to a table that has all government subsidies.

    Yes, it's because SELECT on the table access has been granted to the PUBLIC.  The user still has the option to SELECT the table after you have removed the direct subsidies because they can always access privileges granted by the PUBLIC.

    If you want all users to have access to the table, you shouldn't be granting access to the PUBLIC in the first place.  Create a new role, grant SELECT on the table for this new role and assign this role to all users need.

    If for any reason, you're stuck with the issuance to the PUBLIC, I suppose you could create a policy from the CAE on the table that prevents the user to see all the data.  But it's a lot more work to get grants of privilege correct in the first place.

    Justin

  • How to give the right to select for all objects of schema?

    Hello

    We have a lot of users and schemas.
    A user wants to execute 'select' for all tables in the other schema.

    For example: TEST user wishes to select the objects to TEST2. Test2 have hundreds of tables, TEST user cannot select other schema objects, so I don't want to give SELECT ANY TABLE privileges.

    How can do this at once? is it possible to give all the objects schema once subsidies?
    DB versin. 9.2.0.8

    greetings and thanks

    No, there are no subsidies. You must use hundreds of statements of grant.

    However, you can use dynamic SQL to do this automatically, i.e.

    CREATE ROLE test2_select;
    
    BEGIN
      FOR x IN (SELECT * FROM dba_tables WHERE owner='TEST2')
      LOOP
        EXECUTE IMMEDIATE 'GRANT SELECT ON test2.' || x.table_name || ' TO test2_select';
      END LOOP;
    END:
    /
    
    GRANT test2_select TO test;
    

    Justin

  • Grant 'select only "on the basis of data

    Hello

    10.2.0.2 Dim.

    I want to give a user with "Select any object in the database"

    Thank you
    KSG

    >
    I am also finding an alternative path to the query below. (since there are more than 100 patterns and n number of objects) ("grant select on any table of " is not a best choic)
    >
    You are the only person who can assess your security needs.

    But if you want to exercise a positive security measures do not TAKE SHORTCUTS. This means put in place restrictions known on well-known objects and not grant on a table or an object and any grants a single user or super role.

    Aman and others have already said a good security refers to the compartmentalization and a rigid hierarchy. The objective of the implementation process and standards is not to make developers work more easier or faster. Yes - do the work correctly on 100 patterns and a large number of objects in each scheme will be tedious. You can automatically generate basic subsidies and coil them to scripts. But don't try to automate the entire process from beginning to end. That will leave large enough for a bus through security holes.

    Create a hierarchy in the sense of

    1. a schema at a time
    a. purpose of subsidies - for tables, views, procedures, etc. to a role. Best is to use a separate role for each type of object
    2 grant the role of schema for users who need

    Build small pieces manageable and controllable. Then combine these pieces into a top-level component. Not just make a huge mess of subsidies.

  • Grant select any view privilege

    I want to grant a privilege to SELECT ANY VIEW user but not GRANT SELECT the ENTIRE TABLE. How can I make...

    Extract the query below and run it.

    Select ' grant select on ' | OWNER | '.' || view_name | « à » || ';' from dba_views;

  • imp exp/full FUL grant allows select u / drop all tables... How to avoid this?

    Hi all

    We do nightly exp as our backup for certain pattern... and shell script we used the password hardcoded in the script system and we want to avoid this... so I try to create another user who can make exp/IMP... and what's my user statement like... to give full grant create imp exp/full...

    CREATE test USER
    IDENTIFIED BY THE VALUES OF 'PASS '.
    DEFAULT TABLESPACE USERS
    TEMPORARY TEMP TABLESPACE
    DEFAULT PROFILE
    RELEASE OF ACCOUNT;
    -3 roles for test
    GRANT IMP_FULL_DATABASE TO test.
    GRANT CONNECT TO test;
    GRANT permission TO test;
    Test of ALTER USER DEFAULT ROLE;
    -1 privilege system for test
    GRANT UNLIMITED TABLESPACE TO test;

    but now, here's the thing... This test user is able to query every single table in any schema... or drop something... . How can I stop that...

    all I want to do for test user is exp/imp and nothing else... the user can select on any table but cannot modify or drop whatever it is... what according to give for it? some exp/IMP...

    If not, how can I avoid hard codding the password in my shell script? Can I have one parfile but then again who will need to have the password... and we try to avoid that...

    Anyone (with the appropriate privileges) can import the dump file later. You wouldn't need the TEST user to be able to import the file. If the only thing that the TEST user generates a FULL dump file = a, then the user would only need permission privileges. If the user does not have a full export because you're that concerned about a few diagrams, the user didn't even need permission privileges.

    Justin

  • What privileges granted to select from all the PDB files

    Why the two selected does not return the same result? Or if you want the broader question - what privileges granted to select from all the PDB files.


    I want to leave common user that I created to select and see all of the synonyms of all PDB files.


    conn / as sysdba

    create user c##nir identified by c##nir container=all;

    grant connect,dba,resource to c##nir container=all;
    grant select on cdb_synonyms to c##nir container=all;

    select CON_ID  from cdb_synonyms  group by CON_ID;

      CON_ID
    ----------
      
    1
      
    4
      
    11
      
    10
      
    14
      
    5
      
    8
      
    13
      
    3
      
    7
      
    15
      
    6
      
    12
      
    9

    conn c
    ##nir/c##nir

    select CON_ID  from cdb_synonyms  group by CON_ID;

      CON_ID
    ----------
      
    1

    select CON_ID  from containers(dba_synonyms)  group by CON_ID
      
    *
    ERROR at line
    1:
    ORA-00942
    : table or view does not exist

    You must use the CONTAINER_DATA clause:

    ALTER USER ##nir set container_data = container c all = current;

    After running the above command, try to select again to cdb_synonyms and you will see the data of all containers.

    Read more in my Post of Blog

  • 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.

  • Grant select privilege on the table column

    Hello
    I think that it is not possible to give the right to select level of column in a table.

    by example-grant select (col1, col2) on table1 to User1;

    Can anyone suggest what might be the way to achieve (apart from creating a view on the table).

    Hi, Anit,

    Anit says:
    Hi Frank,.
    Thanks for the reply. Nothing bad to see.

    Then use a notice. It is simpler and more robust.

    As that I knew WHAT EVP is used for the column data hide with a null value or other values. do not hide the entire column of the selection operation. Please correct me if I'm wrong.

    Maksing the column with a null value or another value is hide the column.
    Do what you should always do whenever you have a question. Post some sample data (CREATE TABLE and INSERT statements) and the results desired from these data. In this case, after an authorized user (that is, a user with all privileges) must get results and results that a user with lesser forge privileges.

    A view (or a copy of the table, as a materialized view) is the only way I know to prevent users to know that there is a column (for example) called credit_card_num.
    Use row-level security, you can return NULL when users not allowed to reference credit_card_num, or you can trigger an error if they try to refer to this column.

  • 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

Maybe you are looking for