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

Similar Messages

  • Why i cant view package body ?

    hi all,
    i cant view package body in my pl/sql.
    pls help.
    tks.

    It'isn't yours then!!
    So try this
    SELECT TEXT
    FROM ALL_SOURCE
    WHERE ( OWNER,NAME ) IN (
         SELECT OWNER,NAME
         FROM (
                   SELECT USER AS OWNER,OBJECT_NAME AS NAME
                   FROM USER_OBJECTS
                   WHERE OBJECT_NAME = :NAME
                        AND OBJECT_TYPE <> 'SYNONYM'
                   UNION ALL
                   SELECT TABLE_OWNER,TABLE_NAME
                   FROM USER_SYNONYMS
                   WHERE SYNONYM_NAME = :NAME
                   UNION ALL
                   SELECT TABLE_OWNER,TABLE_NAME
                   FROM ALL_SYNONYMS
                   WHERE SYNONYM_NAME = :NAME
                   AND OWNER = 'PUBLIC'
         WHERE ROWNUM=1
    ) AND TYPE = 'PACKAGE BODY'
    ORDER BY LINEBye Alessandro

  • 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

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

  • Privilege(s) on package body

    How can I allow other users to view a package body stored in my schema? What privileges I need to grant?

    Hi,
    Your dba should give you select privilege on dba_source to you.
    From dba_source you can view the text of package body of any user.
    Hope this helps.
    Raghu

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

  • View package body in another schema

    I have developers who want to view the code in the package body in another's schema.
    I know select text from all_source/ user_source works only for packages in your own schema.
    Granting system privelege 'create any procedure' allows the developer to view as well as update priveleges.
    As the owner of the objects what grants do I need to give to developers so that they can only view the code.

    You can grant select_catalog_role permissions to your developers. This will give your developers select access to all of the V$ views and DBA_% views. Then they can view the dba_source table to view other schema's package code..
    Regards,
    David

  • How to view package body in sqlDeveloper

    Hi everyone, I am able to use popup describe to view a PL SQL package definiton in SQL developer.
    My problem is how to view the package body easily. In TOAD, say I have a package called XX_TOAD with a procedure get_name, I can type in XX_TOAD.get_name in the editor and describe it to show the package body.
    Is there an easy way to view the package body in SQL developer without having the browse the database objects?
    Thanks

    Type the package name in the Sand select the package /procedure and press SHIFT + F4. A new window will open displaying the package script
    --rsrini                                                                                                                                                                                                                                                                                                           

  • Grant command to view package body

    I sent a request for the DBA's to grant me rights to the package body but I only see the spec with the grant execute command.
    Here is the command I just sent:
    grant create any procedure to DEVELOPER1;
    But the DBA changed my grant command to:
    grant create procedure to DEVELOPER1;
    But I still cannot see the package body. This is on a test environment.
    Would the "create any procedure" command help me see the package body of different schema owners package bodies?
    Or is there another grant command to see different schema package bodies?

    primefsu wrote:
    My dba say that you cannot use debug in this grant because session belongs right after debug.I have no clue what your dba is talking about. Anyway:
    SQL> create or replace
      2    package pkg1
      3      is
      4        procedure p1;
      5  end;
      6  /
    Package created.
    SQL> create or replace
      2    package body pkg1
      3      is
      4        procedure p1
      5          is
      6          begin
      7              null;
      8        end;
      9  end;
    10  /
    Package body created.
    SQL> grant execute on pkg1 to u1
      2  /
    Grant succeeded.
    SQL> connect u1@orcl
    Enter password: **
    Connected.
    SQL> exec scott.pkg1.p1;
    PL/SQL procedure successfully completed.
    SQL> select  text
      2    from  all_source
      3    where owner = 'SCOTT'
      4      and name = 'PKG1'
      5      and type = 'PACKAGE BODY'
      6    order by line
      7  /
    no rows selected
    SQL> connect scott@orcl
    Enter password: *****
    Connected.
    SQL> grant debug on pkg1 to u1
      2  /
    Grant succeeded.
    SQL> connect u1@orcl
    Enter password: **
    Connected.
    SQL> select  text
      2    from  all_source
      3    where owner = 'SCOTT'
      4      and name = 'PKG1'
      5      and type = 'PACKAGE BODY'
      6    order by line
      7  /
    TEXT
    package body pkg1
        is
          procedure p1
            is
            begin
                null;
          end;
    end;
    8 rows selected.
    SQL> As you can see, package body became visible to user U1 as soon as user U1 was granted DEBUG on package.
    SY.

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

  • Problem in viewing package body methods

    Hi,
    Methods are showing in object browser in the package header only but not in the body where I think it is the most useful. On clicking the desired method, the right window should also scroll to the selected method.
    Thanks.
    JC

    Hi Mithu,
    CAF service browser is based on CAF Web Dynpro model which has several limilations. Check the SAP note <a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_caf/~form/handler">1030595</a> and <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/20063659-4f03-2a10-6a8a-d88786c39b71">this</a> document for more details on the limitations of CAF Web Dynpro model. To check the operations working properly create a web service for the app service test from the wsnavigator.
    Thanks,
    Dipankar

  • Mapping deploy : ORA 06550 PACKAGE BODY... 101031:insufficient privileges

    Hi All,
    I am using OWB11.2,
    When i deploying a very simply mapping.
    i met the following error
    ORA 06550 PACKAGE BODY line 15 column 13: PL/SQL: 101031:insufficient privileges
    ORA 06550 PACKAGE BODY line 11, column 2: PL/SQL: SQL statement ignored
    i have grant source's 'select' privilege to target schema
    i have add the target schema to owb user group and from 'security' i tick all privllege to target schema
    don't know what else privilege do i need to add to target schema.
    Thanks for you attention.

    Hi,
    if your error statement is
    FROM
    "SCHEMA_SOURCE"."TABLE_NAME_SOURCE" "ALIAS"
    then you need direct grant on object "TABLE_NAME_SOURCE" from "SCHEMA_SOURCE"-user to target user (package owner).
    GRANT SELECT /* ALL */ ON "SCHEMA_SOURCE"."TABLE_NAME_SOURCE" TO package_owner.
    Best Regards,
    IM
    Edited by: user9014055 on 21.02.2012 06:26

  • VIew of Package body in another schema in EA 3.0

    I would like the ability in SQL Developer to view the package body of another schema with the CREATE ANY PRIVILGE.
    For instance, in TOAD you can grant access to DBA_SOURCE or SELECT_CATALOG_ROLE and then be able to view another schema's package body.
    This is long overdue without having to log into that schema or granting CREATE ANY PRIVILEDGE to user.
    This one is really needed

    "CREATE ANY PRIVILEGE" is irrelevant to the ability of viewing the source owned by other users.
    Please provide exact script for creating a user, which is able to see the code, say in HR schema, via the query
    select * from all_source
    where owner = 'HR'
    and yet missing the nodes in the OtherUsers->Packages->PKG_A->PKG_A Body in the navigator.

  • What is the GRANT or permission setting that allows viewing of package body

    For purposes of SOX and security/audit control, we log in under our network id's in our production environment. We have sourcecode compiled into Oracle seeded schemas ( APPS ) so that scheduled jobs are able to run with submitted from the Oracle Applications environment. We don't compile code into our personal network account areas.
    I know how to GRANT EXECUTE privs so that we can execute a package in another schema, but what I want to do is to be able to view the sourcecode in another schema. Compile into APPS but be able to see the package body from my network id schema account.
    I can't seem to find what the correct permission is anywhere. Granted I can look at DBA_SOURCE to get to it, but I want to use a tool like SQL Developer or TOAD to look at the code in a more presentable and easier to debug manner.
    Any help ?

    I guess you need GRANT DEBUG ON SCOTT.PKG TO U
    SYS@LSC01> create or replace package scott.pk is procedure p; end pk;
      2  /
    Package created.
    SYS@LSC01> create or replace package body scott.pk is procedure p is begin null; end; end pk;
      2  /
    Package body created.
    SYS@LSC01> grant create session to u identified by u;
    Grant succeeded.
    SYS@LSC01> grant execute on scott.pk to u;
    Grant succeeded.
    SYS@LSC01> connect u/u
    Connected.
    U@LSC01> select text from all_source where name='PK';
    TEXT
    package       pk is procedure p; end pk;
    U@LSC01> connect / as sysdba
    Connected.
    SYS@LSC01> grant debug on scott.pk to u;
    Grant succeeded.
    SYS@LSC01> connect u/u
    Connected.
    U@LSC01> select text from all_source where name='PK';
    TEXT
    package       pk is procedure p; end pk;
    package body       pk is procedure p is begin null; end; end pk;

  • R12 - Compile Invalid objects (Fast Formula, Package Body and View) Urgent

    Invalid objects about 43, in this Fast Formula 2 AP Package object, and 1 view
    OWNER     OBJECT_TYPE     COUNT(*)
    APPS     PACKAGE BODY     37.00
    APPS     PROCEDURE     1.00
    SCOTT     PACKAGE BODY     1.00
    APPS     VIEW     1.00
    APPS     FUNCTION     3.00
    any one can give idea to make it valid.
    Awaiting for your reply.
    FYI
    the object list is below.
    OWNER     OBJECT_NAME
    APPS     FFP52474_01010001
    APPS     FFP61059_01010001
    APPS     FFP56168_01010001
    APPS     FFP56167_01010001
    APPS     FFP58579_01052004
    APPS     FFP56169_01010001
    APPS     FFP56170_01010001
    APPS     FFP56171_01010001
    APPS     FFP56172_01010001
    APPS     FFP56173_01010001
    APPS     FFP60309_01010001
    APPS     FFP60306_01010001
    APPS     FFP60308_01010001
    APPS     FFP60310_01010001
    APPS     FFP60307_01010001
    APPS     AP_IMPORT_VALIDATION_PKG
    APPS     FFP58576_01011951
    APPS     FFP60357_01011951
    APPS     FFP57511_01010001
    APPS     FFP57510_01010001
    APPS     FFP52473_01010001
    APPS     FFP60305_01010001
    APPS     FFP60545_01042004
    APPS     FFP60342_01010001
    APPS     FFP58887_01042004
    APPS     FFP58888_01042004
    APPS     FFP58870_01042004
    APPS     FFP58885_01042004
    APPS     FFP58907_01010001
    APPS     FFP58906_01010001
    APPS     FFP58861_01042004
    APPS     FFP61122_01010001
    APPS     FFP58871_01042004
    APPS     FFP58857_01042005
    APPS     FFP60917_01032006
    SCOTT     MK_PLS_XML_REP_TEST
    APPS     MK_PLS_XML_REP_TEST
    APPS     AP_FSX_PAYMENT_ADVICE
    APPS     RA_SITE_USES
    APPS     ZDBAR_CONTACT
    APPS     ZDBAR_FAX
    APPS     ZDBCLOAD
    APPS     ZDBAP_DV_PAYMENT_TYPE
    Advanced thanks for reading and giving solution for this.
    Thamaraiselvan

    any one can give idea to make it valid.Run "Compile APPS Schema" from adadmin.
    For Fast Formulas, refer to:
    Note: 155737.1 - How To Compile Oracle Fast Formulas
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=155737.1

Maybe you are looking for

  • Photoshop CC crashing while using gradients.

    While using PS CC on a Macbook Pro with Mavericks, 16gb of RAM and 80gb of space on an SSD I get crashes while using the gradient tool. I'll make a curve, fill the mask and select the gradient tool to use in the mask. If I switch from black to white

  • How to use an image as button?

    I want to set an image as the background of a frame, and also want use four regions of the image as four buttons. How?

  • Burning itunes movies to DVD

    Hi Is it possible to create a DVD of TV/movies purchased from the apple store. Its not always preferable to watch them on the MacBook

  • SimpleDateFormat Parse Exception

    I am trying to convert a string "20070423" to a Date and I am getting a parse exception. Can I not parse this format("20070423")? This is my method public static Date convertStringToDate(String strDate)                throws ParseException {         

  • Playlist in RealOne Player on N93

    Hello everybody, Could someone help me, please. how can I create a video playlist for real player in nokia N93 ?? thank you in advance, regards, Lukasz