Privilege to view Package DDL only

Hello Friends,
I need your help on GRANTS.
Oracle version: Oracle 11G R2
OS: AIX
I have three users in a database. Among these three users, two users, say USR1 and USER2 are having all database objects which is needed for my application and poses all system privileges equivalent to a DBA role.
The 3rd one I have created is a READ user. I want this user to view only source code of PACKAGES AND PACKAGES BODY objects of only USR1, not USR2. Also, I have more than thousand packages/package bodies in USR1. READ should not be able to CREATE or compile a procedure, just simply be able to view the source code.
FYI, GRANT EXECUTE enables me to see PACKAGE specific only, not PACKAGE BODY.
Which privilege should I grant to READ user to achieve this security?
Please help.

AshishGautam wrote:
Hello Friends,
I need your help on GRANTS.
Oracle version: Oracle 11G R2
OS: AIX
I have three users in a database. Among these three users, two users, say USR1 and USER2 are having all database objects which is needed for my application and poses all system privileges equivalent to a DBA role.
The 3rd one I have created is a READ user. I want this user to view only source code of PACKAGES AND PACKAGES BODY objects of only USR1, not USR2. Also, I have more than thousand packages/package bodies in USR1. READ should not be able to CREATE or compile a procedure, just simply be able to view the source code.
FYI, GRANT EXECUTE enables me to see PACKAGE specific only, not PACKAGE BODY.
Which privilege should I grant to READ user to achieve this security?
Please help.CREATE OR REPLACE PROCEDURE READ_MY_SOURCE ...
-- which SELECT TEXT FROM USER_SOURCE ORDER BY LINE
have this procedure owned be both USR1 & USER2
GRANT EXECUTE ON USR1.READ_MY_SOURCE TO READ;
GRANT EXECUTE ON USR2.READ_MY_SOURCE TO READ;

Similar Messages

  • Privilege to view package body

    Hi all,
    I have two users... user 'A' and user 'B' (real user names changed to protect the innocent). User A creates a package spec and package body.
    I want user B to be able to see the code in the package body that user A owns. Ideally I would like user B to be able to view the body code in TOAD via the schema browser or via a DESC. Is this possible?
    Thanks,
    Scott
    PS user B can see the package spec just fine...

    Having the execute privilege on a package should not give anyone the ability to see the source for the package body in all_source and if definitely does not give the user the ability to change the package. The privilege only allows them to execute the package.
    By default only the owner and DBA privileged users can read both the package specification and the body from all_source. Having execute privilege will allow a user to read the specification.
    One way to provide access is to create your own version of the all_source views and grant this to whoever needs the access. You can either write a very specific tailored view for the one user or create a user security table that you use to control who can see what via this special view. Plus you have to grant select access to the special view before anyone can use it.
    HTH -- Mark D Powell --

  • Privileges to view packages in Sql Developer

    I'm sure this has been covered before, but I cannot view a package (spec or body) unless Execute has been granted.
    Create any procedure will allow spec/body to be displayed.
    Is this as intended?
    I searched the forum and elsewhere, and found comments and workarounds. What I am looking for is the actual rules that determine when a package can be viewed.

    You could probably connect to the database with toad, have the session traced, and click around and view some packages to see what sql was run, then do the same with sql developer. My guess would be the views that each tool is using by default, perhaps toad goes ofter dba_objects/source and maybe sql developer goes after all_objects/source, something like that. so with a permission like select any view or select any table, you might see different results depending on the tool, Purely speculation on my part.

  • Issue with viewing Package Body  in SQL Developer 2.1 RC1

    Were anybody able to see the package body of other user in 2.1 RC1.
    I had an issue since 2.1 EA 1 so... just curious.
    - Oracle 9i
    - Windows XP SP3
    Please do let me know if there is any hint or setting that can be change to view the package body.
    Thanks!

    Thanks for your msg.
    Below is the info:
    1.
    SQL: SELECT * FROM v$version;
    Result:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    PL/SQL Release 9.2.0.8.0 - Production
    "CORE     9.2.0.8.0     Production"
    TNS for Solaris: Version 9.2.0.8.0 - Production
    NLSRTL Version 9.2.0.8.0 - Production
    2.
    Result:
    The account has 'EXECUTE' privilege on the package.
    3.
    SQL: SELECT username "User"
    ,granted_role "Granted_Role"
    ,initcap(admin_option) "Admin_Option"
    ,initcap(default_role) "Default_Role"
    FROM user_role_privs
    ORDER BY username
    ,granted_role;
    Result:
    User``````````Granted_Role```````````Admin_Option``Default_Role
    ~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~
    USER_NAME```SELECT_CATALOG_ROLE``No````````````Yes
    4.
    SQL:
    SELECT privilege "Privilege"
    ,initcap(admin_option) "Admin_Option"
    FROM user_sys_privs
    ORDER BY privilege;
    Result:
    Privilege````````````Admin_Option
    ~~~~~~ ~~~~~~~~~
    ALTER SESSION`````No
    CREATE SESSION````No
    CREATE SYNONYM```No

  • ORA-31600 when trying to view SQL DDL for a created public database link

    I created and committed a public database link and I can access the external database.
    When I try to view the DDL of the link, on the SQL tab, I'm getting following error:
    ORA-31600: invalid input value EMIT_SCHEMA for parameter NAME in function SET_TRANSFORM_PARAM
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 3900
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 4048
    ORA-06512: at "SYS.DBMS_METADATA", line 836
    ORA-06512: at line 1
    and
    ORA-31600: invalid input value LONGNAME for parameter NAME in function SET_FILTER
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 1980
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 3665
    ORA-06512: at "SYS.DBMS_METADATA", line 670
    ORA-06512: at "SYS.DBMS_METADATA", line 571
    ORA-06512: at "SYS.DBMS_METADATA", line 1221
    ORA-06512: at line 1
    Is this because of a bug in SqlDeveloper or because the db_link and host parameters have 33 characters?
    I'm using sql developer 1.5.3, build MAIN-5783
    tx,
    Roger Vermeir

    It's probably the length; really all sqldev does is calling:
    select DBMS_METADATA.get_ddl('DB_LINK',:NAME,:OWNER) FROM dual;So if you call it a bug, it's a database bug in the DBMS_METADATA package.
    But if you work with identifiers over 30 chars, I'd say that's a bug on it's own...
    FWIW, I can't reproduce this on our 10g DB; are you on 9i?
    Regards,
    K.

  • Issue with viewing Package Body in SQL Developer 2.1 EA1

    I was able to view the package body from different schemas after I log in with user account in SQL Developer 1.5.5.
    But with SQL Developer 2.1 EA1, I could view only spec and I can see the package body only if I log in with DBO account.
    Is there any setting that needs to be configured to be able to view the package body?
    Thanks!

    Thanks for replying my message.
    It's Oracle 9i.
    What I meant 'spec' is you can see only the headers you defined in spec. You can expend the package and be able to see the all functions and procedures but you won't be able to see the '%packagename% Body' where all the detail code were written.
    As I mentioned in my previous post, with SQL Developer 1.5.5 version, you can see spec and package body if you expend the package.

  • How to view the DDL script prior to object deployment in OWB 10g R2?

    How to view the DDL script prior to object deployment in OWB 10g R2?
    Here is what I' looking for: in 10gR2, let's say I've built dimension X, but it's not deployed yet. I've selected one of the deployment options, let's say: "Deploy to Catalog only". Now, I'd like to see a DDL script that will be executed at the deployment time. Where can I find this script? What screen? What menu?
    Thanks,
    vr

    Viewing the Scripts
    After you have generated scripts for your target objects, you can open the scripts and
    view the code. Warehouse Builder generates the following types of scripts:
    ■ DDL scripts: Creates or drops database objects.
    ■ SQL*Loader control files: Extracts and transports data from file sources.
    ■ ABAP scripts: Extracts and loads data from SAP systems.
    To view the generated scripts:
    1. From the Generation Results window, select an object in the navigation tree on the
    left of the Generation Results dialog.
    2. Select the Scripts tab on the right of this dialog.
    The Scripts tab contains a list of the generated scripts for the object you selected.
    3. Select a specific script and click the View Code button.
    Regards,
    Marcos

  • Tables, views, packages, etc. not showing for most users

    11.1.0.7
    trying sqldeveloper 2.1.1 & 3.0.02 (64 bit)
    jre 1.6
    Started getting blanks this morning when expanding the nodes of most of my local users (cleared filters). Seeing no tables, views, packages. However, if I login sqlplus as that user and select * from tabs, I CAN see all tables are there.
    I can use sqldeveloper to view all the SYSTEM user objects and one recent user that I imported (impdp) from a 10g database. However, every other user appears empty in sqldeveloper.
    I grant connect, resource to all users since this is just a development database. Also tried granting CREATE SESSION and even ALL PRIVILEGES, no luck. All tried restarting.

    self is also facing the same issue. workstation is install WINDOWS 7 Pro and 10g client is not available as of now for Windows 7 Pro so oracle client 11.2.0.1.0 installed. Database pertains to one datacenter is serving as desired but databases lying with remote data center, none of objects are shown even not as SYS also where as sqlplus is showing all objects. tried with TNS option and without TNS as well but objects not listed. don't understand the behavior of SQLDeveloper 2.1.1.64 Build-Main 64.45. for information all DBs are of 10.2.0.4 with mix flavour of non windows o/s.
    Edited by: 824691 on Dec 30, 2010 10:33 PM

  • Audit DDL only

    Dear DBAs,
    is there a way to use audit trail, instead of using triggers, to be able to audit only the DDL statements for a specific user ?
    Thx in advance

    Dear Pavan/Sybran,
    I would like to thank you first for your quick reply.
    I know so much about what you are saying and the documents you gave, but your solutions was to ruun the AUDIT statement and adding each system privilege (related to the DDL).
    what i'm thinking of, instead of listing all DDL statemments, a way to start auditing DDL statements using this kind of statement:
    AUDIT ALL DDL BY user
    is it possible?

  • I'm using iPhoto 11, and instead of seeing my images in the main view, I see only outlines. (Had same problem in iPhoto 10 before upgrade to Lion Help!

    I'm using iPhoto 11, and instead of seeing my images in the main view, I see only outlines. (Had same problem in iPhoto 10 before upgrade to Lion Help!
    I'm on a Macbook Pro and all of my software is up-to-date.
    The photos and events, etc. appear to be present in my photo library, but I cannot see the actual images--only an outlined placeholder.

    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Include the option to rebuild the thumbnails. This can take 3 or 4 goes to work.

  • Creating iphoto book and can't seem to view/ work on only one page at a time.

    I am creating an iPhoto book and can't seem to view/work on only one page at a time.  The Navigator, that allows you to focus on a part of the page is actually 1 1/2 pages in size so 1 1/2 pages are in view when trying to work on one page.  What am I doing wrong or how can I fix this.  It is very distracting viewing half of a previous page when trying to create a new page and write a story to go with the related pictures.

    My Navigator seems to be to large.  It covers 1 1/2 pages while in the training information it shows as the size of one page.  Is there a way to adjust the size of the Navigator?
    You can hover the mouse over the left border of the Navigator - then the cursor will turn into a resize cursor and you can drag the border and make the Navigator panel smaller by enlarging the source list.
    Or drag the lower right corner of the iPhoto window and shrink the appliaction window. This will only make the navigator smaller - the source list and information panel will stay the same size.
    Regards
    Léonie

  • All of a sudden I can't print my calendar in 'month' view.  It only does day or list.  Any thoughts.

    All of a sudden I can't print my calendar in 'month' view.  It only does day or list.  Any thoughts?

    Thank you so much... I put this in another thread too, but, through help I learned that it is the errors that's causing this. The problem is that I don't know enough to fix it. It happens in a nested table, (don't know CSS well enough either to use it instead) and I can't figure it out... its a full page table, 50% on each side, and a center cell that should contain a same-size nested table... as in, I want to put all the content in the center.
    The error:  "table" is not allowed within: "tr"
    <body>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="50%" valign="bottom"></td>
        <td width="980" align="center" valign="bottom"/><table width="980" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="980"> </td>
          </tr>
          <tr>
            <td width="980" align="right" valign="bottom"> </td>
          </tr>
        </table>   
        </td>
       <tr> <td width="50%" valign="bottom"></td>
      </tr>
    </table>
    </body>
    </html>

  • In my old OS I could press F11 and clear all the open windows from view to see only the desktop. How can I do that now in Mavricks?

    In my old OS I could press F11 and clear all the open windows from view to see only the desktop. How can I do that now in Mavricks?

    system preference > Keyborad >  click the box thast says  use all f1,f2,f2 keys as standard functiong Key and then the f11 key should casue all window fo fly to the side and you can see your desktop

  • Viewing print thumbnail only works after a TAB in adobe reader X

    Hello,
    Viewing print thumbnail only works after a TAB in adobe reader x.
    In adobe reader 9 when you go to a specified page (the red circle in the screenshot), the example on the right site directly go´s to that page,
    In adobe reader x when you go to a specified page nothing happend in the example, when you then use the TAB then de example wil go to the specified page.
    Is this a incident in Adobe Reader X ?
    On my

    PDF files have to be specially enabled for you to save the contents. It appears the old version of these files had this capability, but the new version does not. Without Acrobat you will be unable to save the files. If these are truly government files, you can try going to the government's website and see if you can download a copy that will allow you to save the form field data.

  • Sharing a view in read only mode

    Hi,
    I am new in this domain. I have made an application in which I made two local development projects. Through that I am using views of one into another with the help of "Used WebDynpro Components" concept. After deploying, I have got these two views.
    But the problem is that I want that view in read only mode which I have taken from other local development project and this view was not in read only mode in its local development projects.
    Please provide me the solution in detail so that I can understand easily.

    Hi Manish,
                   Say View1 is the view in main Component,View2 is the view in used Component.  Exactly follow these steps.
    Create a context attribute <b>enable </b>of type String in used Component's controller,used Component's Interface controller, View1 and View2.
    Using context mapping map these attributes  View2 ->  used Component's controller->  used Component's Interface controller -> View1 ( if you don't know how to map double click the  the Main component: Data navigation modeler is opened; In  the diagram, right side select small arrow  first select  View1 drag to used Component's Interface controller,in the wizard select right hand side <b>enable </b>attribute drag to left side)
    you can map similarly View2 ->  used Component's controller->  used Component's Interface controller.
    In View2 create another variable <b>edit </b>of boolean type.
    Open Layout tab of View2, bind this attribute to enable property of all the UI elements which you want to disable.
    In  implementation tab of View1 in method wdDoInit() write this code
    wdContext.currentContextElement.setEnable("display");
    In  implementation tab of View2 in method wdDoInit() write this code
    if(wdContext.currentContextElement.getEnable().equalIgnoreCase("display"))
    wdContext.currentContextElement.setEdit(false);
    else
    wdContext.currentContextElement.setEdit(true);
    Hope this helps for you.
    Best regards,
    Siva
    Message was edited by:
            Armin Reichert

Maybe you are looking for

  • When I got my new ipad, i lost access to my first cloud, how do I get it back?

    I cant access any of the photos or anything from my first ipad which I repalced because the screen broke- at the apple store. I backed up everything to the cloud and then switched over to a new device. Since then, I have never been able to get into t

  • Mail doesn't display full email text, only displays the subject line

    Mail doesn't display full email text, only displays the subject line. My preview shows first three lines of email, but when I chose the email specifically mail doesn't display any lines of text.  Been this way for about ten days.  Please help.  Ben

  • GZIP decompression of chunked data?

    I'm trying to decompress a chunked stream of GZIP compressed data, but I don't know how to solve this without major inefficient workarounds. The data is coming from a web server, and is sent chunked. This means that before each chunk, the size of the

  • Addition in PHP

    I have a simple PHP registration form, with a couple option boxes for different prices. I want to use the $_POST command to send me the total price. I know this is very simple, but I can't get it to work. I know this obviously doesn't work, but what'

  • Windows 7 RTM (Build 7600) and iTunes 9.0

    Been running iTunes 8 with no problems under Windows 7 RTM, But after installation of iTunes 9, Boy what a mess. Can only play one track at a time regardless of Albums origin (CD, Itunes store etc). Genius Doesn't work, iTunes DJ not working, Genius