Grants to only read the schema

Hi all

We want to create read only one schema with dynamic read-only access to a source schema.

We knew that the steps to create read only schema, but we would like to know, how grant us only read access for new objects created in the source schema?

Let's say, test pattern source today has 100 items. We have created reading scheme (test_ro) with select on / execute on for all 100 objects in the schema source (test).

After a week, another 30 new objects are created on the test. Now how we automate reading only grants for these 30 new items to read only one schema (test_ro) of the schema of the source (test)?

Thank you in advance...

Thank you

Dinesh.

A simple approach could be like below. Readonly_role is a user-defined. You can add any number of privileges in the execute stmt.

create or replace trigger .AUTO_ASSIGN_GRANT_READONLY
     after CREATE on .schema
      declare
      l_str varchar2(255);
      l_job number;
      begin
      if ( ora_dict_obj_type = 'TABLE' )
      then
      l_str := 'execute immediate "grant select on .'||ora_dict_obj_name ||' to READONLY_ROLE";';
      --execute immediate 'grant select on .'|| ora_dict_obj_name ||' to READONLY_ROLE;';
     dbms_job.submit( l_job, replace(l_str,'"','''') );
     end if;
     end;
  /

I copied this over the internet a few years back and I modified to suit my needs...

The unknown author is the one who should take the credit.

Tags: Database

Similar Questions

  • Narrator will not read word document it only reads the toolbars, why?

    When you use the Narrator, I can't get the Narrator to read text in my word document.  It says that the document is empty, when it is complete the text. The Narrator reads only the toolbars and other boxes out loud.  Can you give help step by step with this question. I tried to follow all the instructions under the Narrator, but not luck.  I have a version of the track window 7 and new computer could anyone.

    Hi LawDrKim

    Welcome to the Microsoft Answers Forum!

    We would like to know the problem happens only with Word documents. Try to use the Narrator with any other application as a text written on the Notepad or worpad and check.

    Try the steps listed in the link below and check if it will help: Narrator to solve problems

     http://Windows.Microsoft.com/en-us/Windows-Vista/Troubleshoot-Narrator-problems

    If the problem is only with the office application, then it might be a problem with the word application. Please visit the link below to find a community that will support what ask you

    http://www.Microsoft.com/Office/Community/en-us/FlyoutOverview.mspx

     

    Thank you, and in what concerns:

    Samhrutha G S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • D2KWUTIL Read_Registry - only reads the string values? How to read the binary?

    Hello, everyone!
    I use forms and reports 6
    D2KWUTIL,
    WIN_API_ENVIRONMENT. Read_registry
    to read the Windows registry values.
    The service works very well with string values (that is, type REG_SZ registry).
    but fails with NO_DATA_FOUND binary values, such as type REG_DWORD.

    D2KWUTIL is really unable to work with other types of chains?
    If so, what can be used instead?

    Appreciate all the guidance,
    Roman

    Published by: user9232995 on November 18, 2010 23:19

    Published by: user9232995 on November 18, 2010 23:20

    It's d2kwut60.dll.

  • MP3 Podcast... can ONLY read the markers?

    I know it's a long shot, but it will save a lot of production time.

    I have a bunch of audio chapter (assembled in Soundtrack Pro and Final Cut) exported in MP3 podcast format and wonder if there is a way to read the chapter markers as points of start/stop for navigation. I have no idea what to tell Actionscript watch dethrone doesn't seem like there is a corresponding MP3 ID3 seem property to indicate markers, but perhaps that I forgot something.

    Someone has it already done this or know where I can get the answers?

    Thank you!

    DOH! Too bad. AAFC is the format for podcasts with Bo chapter markers.

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

  • Only read the columns in planning Webform


    Hi all

    I create a form with the period (month jan, Feb and March) and members of the custom called Type dimension in the columns.

    Members of Type dimension I selelcted is Type1, Type2, Adj Type1 and Type2 Adj.

    My requirement is that I want to show Type1 and Type2 columns as READ ONLY where users should not enter data in these two coulmns.

    Is it possible to achieve this requirement.  I use 11.1.2.2 planning version.

    Any suggestion would be appreciated.

    Thanks in advance

    Hello

    Please follow the steps below to make columns read-only in Hyperion special 11.1.2.2.

    (1) to open the form in edit mode

    2) click on the Layout tab, the Layout tab is open. Please click on the underside of the column you want to do in 'read only' (A, B, C, etc.), if you have three columns, then you might see A, B and C.

    Note: The mouse cursors are very sensitive in the latest version, if you click on the right place, you will get the necessary decorum, otherwise it will appear not all properties.

    In this example, let B column read-only. Exactly to move the cursor to 'B' and click on the right side, you can see a lot of action, click on 'Properties of Segment' and under this 'Read only' option, select this check box to make the column read-only.

    Thank you

    Prakash

  • granting of privileges to the schema for several tables at the same time... any script?

    Hello gurus,

    I have about 25 tables in the ABC scheme

    I want to give all privialges to the XYZ schema for all tables of 25 which is in the pattern ABC... So is there is SQL statement or a script, I can run to grant privileges to all tables.

    Something similar to these...

      SELECT 'create synonym ' || table_name || ' for ' || table_name
      FROM user_tables  {code}
     
    So i get all the table names ....then i can run as a script.... U r help is greatly appriciated gurus!!!
    
    
    Thank you!!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Administrator:

    set head off
    set pages 0
    set feed off
    spool myscript.sql
    Select 'grant select, insert, update, delete on abc.'||table_name||' to xyz;'
      from dba_tables
     where owner = 'ABC';
    
    Select 'create synonym xyz.'||table_name||' for abc.'||table_name||';'
      from dba_tables
     where owner = 'ABC';
    
    spool off;
    

    Obviously this does not all new table that will be created in the future on ABC schema...

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

  • Only read the column in the form of planning

    Hi gurus,

    I want to do a red column in planning webform. How can I achieve this? If I give read access to this column for a user and assume that it is a computed column, the calculation is done for the user? To calculate a cell in the form, is that he needed centimeters to write to the user?

    Kind regards

    Hello

    Say you want to have Jan, Feb in your columns, but you want to make read-only Feb, that's what it takes

    In the columns/line under the column dimension tab

    Select period in the drop-down list, enter Jan as a member.

    Now click on add a column

    Enter Feb for the Member, click read-only.

    Ok?

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • my email is block I can only read the calibre

    When I log on my Inbox I have no new messages I is CAREB only the old and at the top a response of yours to thank you unlock the registered on the left is

    Hello

    See this page to select your language:

    http://support.Microsoft.com/common/international.aspx

    ====================================

    Or sorry that it is area English.

    Left click at the bottom of the Microsoft Community page

    English and set your language.

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Pls help. My Camera Raw, CS6, and Lightroom will only read the NAVE of D610 files.

    I've recently updated to Nikon D610 and NEF files were not readable from my old version of CS6, Camera Raw and Lightroom. So downloaded the recommended updates and I now have Camera Raw 8.4.0.199; Lightroom 5.3; CS6 13.01. But still has not read my D610 NAVE. Help, please. Thank you.

    Oh wait, I had. Just in case for those who have the same scenario. I downloaded my D610 NEF files using the old software ViewNX 2.1 and it was the cause of the incompatibility. So, I improved my ViewNX to 2.9 and downloaded my images again. And it worked this time.

  • I am owner of Age of Mythology Gold Edition and the product key is damaged I only read the first 7 keys from 25. What should I do now to download AoM Gold Edition?

    18 keys are missing from my product key, so I can't download AoM Gold Edition on my new PC. What do I do now?

    Hello

    Please follow the links below to solve the problem.
    How to replace Microsoft software or hardware, order service packs and replace product manuals
    Support for common issues of PC games
    I hope this helps.
  • the user can only read

    Hello
    Should I create a user who can only read the tables in another schema. (this schema has 65000 tables and I want to avoid execution grant select on table1, table2... to MYUSER).
    Then, I created a trigger:
    CREATE TRIGGER set_empno_ctx_trig AFTER LOGON ON DATABASE
         BEGIN
         IF USER='MYUSER' THEN
          execute immediate 'ALTER SESSION SET CURRENT_SCHEMA = SCHEMA';
         END IF
         END;
        / 
    Any way to restrict it to read-only? How can I revoke Insert or UPDATE?

    I published that follows, but does not work and the user can INSERT:
    CREATE TRIGGER set_empno_ctx_trig AFTER LOGON ON DATABASE
         BEGIN
         IF USER='MYUSER' THEN
          execute immediate 'ALTER SESSION SET CURRENT_SCHEMA = SCOTT';
          execute immediate 'REVOKE INSERT ANY TABLE FROM MYUSER';
         END IF
         END;
        / 
    
     
    Thanks for the help.

    user522961 wrote:
    I thank once again.

    For the first query cannot send the result. MY_WRITE role is a role with:
    GRANT SELECT, insert, update, delete any table. Without which MYUSER cannot see the tables in the SCHEMA. MY_WRITE revoked if:

    So, what's you want? You cannot revoke insert, update, delete the grant of the user, if they are granted by a role.

    Grant select any WHAT TABLE or SELECT ON .

    the role of the user and revoke.
    He will be able to choose, but not change data.

  • My Z500 won't read the dedicated graphics card driver.

    Or just got a new Z500, removed the BONE, it came with and Windows 8.1 is installed.

    First of all, I had a problem that the screen was too low, so I fiddled with the driver and after removing and re - install the graphics driver Intel HD4000, I managed to get back to normal.

    However, I tried to install PES 2011 on it, and everytime I open its settings, it would give a warning that my system does not meet the minimum requirements. It would show that he only reads the HD4000 Intel.

    So, normally, I try to re - install the nVidia drivers and install new and others, but to no avail. I tried to check in the BIOS, but I'm only given two options: switchable graphics or UMA and not knowing what UMA is I chose the switchable graphics option.

    Any ideas what to do?

    I'd be happy to offer more information, if necessary. It has a GT 740 M btw.

    Hello

    You can try checking this thread, see if this will allow you to force start your game with Nvidia graphics

    http://www.howtogeek.com/136123/Htg-explains-what-you-need-to-know-about-NVIDIA-Optimus/

    Hope this helps

    See you soon!

  • Grant read only to a user only with the role

    Legends of dear,

    Req: create user selection/read-only join specific 3-5 tables in a specific schema and no selection/read only access to the sys/system schema.

    After surfing and tried to grant the "read-only" access for a user as follows.

    create user readonly identified by readonly123;

    create read_only_role role identified by read_only_access;

    Grant connect, read-only resources.

    Grant select on applications. FND_PRODUCT_GROUPS read-only;

    Grant select on applications. FND_USER read-only;

    grant read_only_role read-only;

    The above statements

    1. created user, role

    2. granted to connect/create user session and I am able to run the following query

    logged in as readonly

    Select * from APPS. FND_PRODUCT_GROUPS;

    Where I am able to select even sys or system tables.

    But I'm not able to make the same read only access provided to a role and assign the role to the user subsequently,.

    create user readonly identified by readonly123;

    create the role of read_only_role identified by read_only_access;

    Grant connect to read_only_role;

    Grant select on applications. FND_PRODUCT_GROUPS to read_only_role;

    Grant select on applications. FND_USER to read_only_role;

    grant read_only_role read-only;

    Let me know your suggestions,

    Ref:roles and privileges of user management

    Roles of the Oracle

    GRANT statement

    https://forums.Oracle.com/thread/2223362

    Thank you

    Knockaert

    Hi, Karthik,

    If a role has a password (as in this case), then the user must activate this role during its current session in order to to use, like this:

    ROLE of the read_only_role IDENTIFIED BY read_only_access VALUE.

    If the role does not have a password, then it is enabled by default as soon as the user opens a session.

    Remember, the roles do not count inside procedures AUTHID DEFINE stored (which is the default type).  If you need to use the table inside an AUTHID DEFINER stored procedure, then the privileges must be granted directly to the user and not just a role.

    I hope that answers your question.

    If this isn't the case, after a complete test script that people can run to recreate the problem and test their ideas.  You started great: CREATE instructions you posted were perfect, but you need to add the CONNECTIONS and SELECT statements (and the SETTINGS, if necessary) to show how the error occurs.

  • Read-only subsidies on the schema

    Dear all,

    I created a user on the database, within this database, I want to give read only allowance (Select SELECT) the schema of objects such as tables and views. Number of tables being too high is possible if I can give grant SELECT on all tables so that the user only once? I mean any command?

    Thank you

    SQL > spool c:\script.sql
    SQL > SELECT 'GRANT SELECT ON SCOTT."| Table_name |' to NEW_USER;' from DBA_TABLES where OWNER = 'SCOTT ';
    SQL > spool off

    c:\>@ c:\script.sql

Maybe you are looking for