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.

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

  • 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

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

  • 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

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

  • 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

  • How to wrap a package body in the Oracle Cloud

    Does anyone know if it is possible to wrap a PL/SQL package body in the Oracle Cloud? I tried to wrap it on my local machine and then upload it but when I ran it, it said the wrapped package was corrupt. DBMS_DDL is a lot of extra work and only works for packages <= 32K. Is there any other way to do this?
    Maybe in the SQL Workshop, upload script section, there could be an option to wrap code when you run it?
    Thanks,
    Steve

    Rick,
    Thanks for the quick response. I used the SQL Workshop, script upload function (in Apex) to upload a package that I wrapped on my pc (Windows 7) using the wrap command line utility (11g). It uploaded fine but when I tried to run it, it returned a message like "Wrapped code is invalid or corrupted". This was not what I would have expected since I know you can import/export wrapped code between systems (different OS) without issue. Perhaps the command line wrap is OS specific and the import/export is doing some kind of translation?
    Anyway, I know you cannot use the command line option directly in the cloud because, as you say, you don't have access to the command line. DBMS_DDL is too tedious to use and has the 32K limit and unfortunately, there is no command like, "Alter package body xxx compile wrapped". So that leaves using the SQL Developer Cart option to move wrapped code from a local db to the cloud db. Unfortunately, I'm still having roles and permissions issues with my account which Oracle Support hasn't been able to fix over the last few weeks so I can't try this option (or even login using SQL Dev). Has anyone tried to do this? Does anyone know of another way to do this that I'm not thinking of?
    Thanks,
    Steve

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

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

  • 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

  • Viewing a LARGE Package Body

    Hello!
    I uploaded the Document Library packaged application but I am unable to view or compile the DOCLIB package body. When I view the pkg body, the last 100 lines of the code appear outside of the body window (green section - location of code). The pkg body has 1,488 lines of code (62,192 characters). I uploaded the Doc Lib package on apex.oracle.com and I am able to view the code in it's normal state (all 1,488 lines of code are in the green section). When I try to compile the code I get 'PL/SQL: numeric or value error: character string buffer too small ' error, but I get that error on apex.oracle.com too.
    We think there is a server setting that needs to be modified, just not sure what that setting is. We're running Oracle 10g, installed 'out of the box' with the exception of changing the server output file pointer (I think that's what it's called) and Apex 3.1.
    Does anyone know what might be causing this behavior?
    Thank you,
    T

    Thank you both for checking that...glad to know I'm not just seeing things! :)
    What's weird is...I can view the body just fine (in myplayground workspace, not on our development network) but you both are getting the jibberish that I'm getting on our development network when vieiwing the body.
    Hopefully at least one of the developers is reading this and will post their findings. The DOCLIB is a great application and we would love to use it...we just need access to the package! :)
    Thank you,
    T

  • SYSDBA - problem with viewing other users package body texts on sys account

    Hi,
    SQL Dev 1.0.0.15.27 has problem with correct display of other users package body texts on sys account. All bodies have "create or replace" text instead of all pck. bodies text.
    I guest it's problem with SYSDBA role. On system account text is displayed correctly. Quest SQL Navigator 5.x has no problem with this. Any ideas ?
    Regards,
    MM

    Hi Everyone,
    Just so I can close the case on this issue, although I was successful in
    using CSS to resolve the issue, actually, the issue was not really
    resolved. There was (for me) still the problem of rollover images not
    working in IE, and if I were ever to get another good night's sleep, I
    would need to resolve it -- so I did. Recall me saying earlier about the
    sizes being brought in to the javascript code by Dreamweaver? The original
    issue with having the size of the small image in the code caused the code
    to see the larger image as small also! However, when I deleted those size
    attributes' numbers, I failed to delete the words "width" and "height"
    along with the double quotes following each. So, while the other browsers
    ignored these "blank" attributes within these double quotes, IE apparently
    didn't, reading these "blank" values as some very small value, thus
    displaying the image in the absolutely smallest size possible! Wow! When I
    removed these two blank attributes, my problem went away! Live and learn!
    So, to all who were desperately trying to assist me, please accept my
    deepest and most sincere apologies. All the while I was blaming IE, I was
    the guilty one!!! Shame on me, and thanks for the wonderful responses I
    received from the Dreamweaver forum team. I will go and stand in the corner
    for 8 hours with my dunce cap on...
    Joe Dardard

  • How do I view a FUNCTION within a Package Body

    I can see the FUNCTION being executed within the Package...
    FUNCTION Stop_Refresh_AsBilled
    RETURN Number;
    And within Oracle SQL Developer and using the Connection and "Packages" part of the Schema, I see the Function Name. However, when I <Double-Click> on the FUNCTION Name within the Schema, it is taking me to where the FUNCTION is executed within the Package and NOT to the PL/SQL Code that actually makes up the FUNCTION.
    Am I missing something here??? Maybe in my Preferences??? How can I drill down further to actually find the FUNCTION Definition and PL/SQL Code that makes up the FUNCTION within the Package Body???
    I can bring up the Package Body and Search on the FUNCTION that way. I'm hoping there is an easier way however to drill down to the actual PL/SQL Code that makes up the FUNCTION.
    I hope I am being clear in my explanation here.
    Thanks for your review and I am hopeful for a reply.
    PSULionRP

    Jim, opening the body node to see all functions and procedures sometimes does not work in 3.0
    I have many packages generated by Feuerstien's CodeGen utility. The Query package appears just fine with every function and procedure appearing as expected in both header and body nodes. However, the Change Package fails miserably. Header shows all functions and procedures fine, but the body node only shows the top private declarations of variables and types. Not one function or procedure appears in the expanded node.
    The only thing I can figure is that the Change package of about 30 named items has many of the same name+ with overloaded parameters. I think SQL Dev is having problems parsing the names in the body even though it does fine with the names in the header of the package--perhaps because of many private variables and PRAGMA's declared at the top of the body.
    Both packages have about 30 functions, but the Change package body has over 2000 lines while the Query package has fewer than 500.
    Just adding to the mystery--but I think it merits a bug report (gotta figure out where to report it now).

Maybe you are looking for

  • ERROR MESSAGE  Can't open file in DW8

    After downloading Dreamweaver 8 trial version. Download was sucessful. Installation was successful. I opened the program to proceed to build a webpage. I was able to open a HTML file. and I was UNABLE to open any image file... I attempt to open jpg f

  • How can I adjust iPad settings when I get message, "Sender rejected by server"?

    I have recently had difficulty sending and receiving mail on my iPad, but not at the same time! This was NOT the case for the first 8 months I had my iPad. I changed nothing but suddenly (Oct 6th, 2011) could not get my mail. Bellsouth said, "User na

  • Pk files no longer being drawn

    Hello, First time poster here. I tried to read as many posts as possible about my issue, but unfortunately, I didn't see anything that might help me out. I recently noticed last night that each time I would import a stereo wave file in AA3, it would

  • Error Handling in File Adapter

    I have been working on a requirement where the file adapter picks up the file and gives to the BPEL for processing the data. So, in order to do Error Handling for file adapter, i have been reading the Oracle documentation for technology adapters. In

  • Variable entry warning with RRMS_MESSAGE_HANDLING

    Hi, If I post a message in the Variable Exit (I_STEP = 3) with the function module RRMS_MESSAGE_HANDLING, the user cannot execute the variable until a valid entry exists. I would like to only raise an information that appears only once and the user c