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.

Tags: Database

Similar Questions

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

  • 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

  • Granting select permission on the view to the schema of the database different.

    Dear all

    I need schema view 'data_model_eb' APPS to grant select permission on a different database schema "HHS" on another server.

    Kindly help me to create the link to the db and grant the select permission.

    Thank you.

    You have two solution, but I think the second One is the best for you, what is your version of the database!

    create view  as select * from table_name@dblink
    grant select on  to USER;
    

    OR create a PUBLIC database link

  • How can I determine what were the privileges granted to the PUBLIC?

    I don't know 'out of the box' privileges by default Oracle, but rather the privileges that have been granted since the day 0.

    SQL > select * from dba_sys_privs where dealer = "PUBLIC";

    no selected line

    SQL > grant create any table to the public;

    Grant succeeded.

    SQL > select * from dba_sys_privs where dealer = "PUBLIC";

    DEALER PRIVILEGE SMA

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

    PUBLIC CREATE ANY TABLE NO.

    SQL > revoke create any table of public;

    Revoke succeeded.

    SQL > select * from dba_sys_privs where dealer = "PUBLIC";

    no selected line

    SQL >

    The PUBLIC role is a special role that each database user account is automatically when the account is created. By default, it has no privileges granted to it, but there are many grants, especially for Java objects.


    The same binding, which was provided by a member.


    DBA_ROLE_PRIVS - roles granted to users and roles

    ROLE_ROLE_PRIVS - roles that were granted to roles

    ROLE_SYS_PRIVS - privileges granted to the roles system

    ROLE_TAB_PRIVS - Table privileges granted to roles

    Concerning

    Girish Sharma

  • grant to the public

    Hello

    I did ocuploe of grant execute on sys to the public packages;

    but when I look at subsidies run individual users thrugh db consolse I do not see them, I also had a look at subsidies run public user nor her there...

    How to query the list of the system-no system grants the public in my DB?

    Please below

    select privilege from dba_tab_privs where grantee='PUBLIC';
    
  • 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

  • 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 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 the object a.a to user b to user test

    Hello

    I am logged in as user test.

    I would like to issue the following grant.

    grant select on a.a to user b;
    

    Unfortunately, this does not work with the test user. But it works with SYS. What permissions are required for the declaration works as a test.

    Best regards

    Stone

    Documentation, https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_9013.htm#SQLRF01603

    Prerequisites

    To grant a privilege to system, one of the following conditions must be met:

    • You must have obtained the GRANT ANY PRIVILEGE system privilege. In this case, if you grant the system privilege to a role, then a user who has been granted the role doesn't have the privilege unless the role is enabled in the user's session.
    • You must have been granted the privilege of system with the ADMIN OPTION . In this case, if you grant the system privilege to a role, then a user who has been granted the role has the privilege without worrying if the role is enabled in the user's session.

    To grant a role, you must either got the role with the ADMIN OPTION or have received the GRANT ANY ROLE privilege system, or you must have already created the role.

    To grant a privilege object, you must have the object, or the owner of the object must have a permission you privileges of the object with the GRANT OPTION , or you must have obtained the GRANT ANY OBJECT PRIVILEGE system privilege. If you have the GRANT ANY OBJECT PRIVILEGE , then you can grant the privilege of the object only if the owner of the object could have granted the same privilege of object. In this case, the GRANTOR column of the DBA_TAB_PRIVS view displays the owner of the object rather than the user that issued the GRANT statement.

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

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

  • Grant Select on sys.dba_role_priv to the user; error

    version 10204
    It's the user's request: Add: select sys.dba_role_priv to: ROLE vas_user;

    I was just wondering what I'm doing wrong? How to fix?

    SQL > grant Select on sys.dba_role_priv to vas_user;
    Grant Select on sys.dba_role_priv to vas_user
    *
    ERROR on line 1:
    ORA-00942: table or view does not exist

    I was just wondering what I'm doing wrong?

    incorrect spelling

    How to fix?

    Use the correct name

    SQL> desc dba_role_priv
    ERROR:
    ORA-04043: object dba_role_priv does not exist
    
    SQL> desc dba_role_privs
     Name                                                       Null?    Type
     ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     GRANTEE                                                   VARCHAR2(30)
     GRANTED_ROLE                                                  NOT NULL VARCHAR2(30)
     ADMIN_OPTION                                                   VARCHAR2(3)
     DEFAULT_ROLE                                                   VARCHAR2(3)
    

Maybe you are looking for

  • Help!  I got a pop up saying: Blue Screen of Death: Error Code 333

    What should I do?  I can't do chrome nearby.  I can force the computer to shut down, but when I boot it again it says that Chrome is not stopped correctly.  The pop up gives me a number to call at Microsoft, but I read about it, and I know not not to

  • Equium P300-190 - Question about upgrading the processor

    Hello I just have a question for my CPU PC Toshiba laptop, I have a can of Equium P300-190 full to give model number if necessary the cpu is one supplied with the laptop. My question is I want to upgrade the processor but do not know which would be t

  • Toshi SD-R5372 - not recog CD-R/Ws

    This message contains a very detailed description of my troubleshooting steps and is certainly a bit long. I wanted to be thorough so apologies right up front, OK? Also, I can't find a forum for North America! Here's an interesting situation. Have a

  • Certificate disappears from the Certification authorities store of trust roots

    Recently, I tried to connect to the network wireless protected at my University.  The process is to install the root certificate and specifying as trusted root certification authority when you configure the wireless authentication settings.  However,

  • Diagnose the reason why I can not run (or even remove) an exe (JDK Installer)

    I have a portable Win7 provided by my company.  I'm supposed to have "admin rights" on the box.  In the past I have never had any problem with the installation of things. Today, I tried to download an installer for a newer version of the JDK.  After