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.
Similar Messages
-
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 do I view package bodies in another schema ?
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 did some more searching on the forum... seems its already a request... TOAD gives access to DBA_Views to resolve the issue... SQL Developer has not integrated that functionality yet, but forum entries seem to indicate that it is on the horizon.
Thanks for responding though.
~Barry -
Access package body in once schema by another
I have package defined in one schema (A). How can another user (B) access the body of that package logged in as B?
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> connect o/o
Connecte.
SQL> create or replace package p is procedure p; end;
2 /
Package cree.
SQL> create or replace package body p is procedure p is begin null;end; end;
2 /
Corps de package cree.
SQL> grant execute on p to u;
Autorisation de privileges (GRANT) acceptee.
SQL> connect u/u
Connecte.
SQL> select * from all_source where owner='O';
OWNER NAME TYPE
LINE
TEXT
O P PACKAGE
1
package p is procedure p; end;
O P PACKAGE BODY
1
package body p is procedure p is begin null;end; end;
OWNER NAME TYPE
LINE
TEXT
SQL> -
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; -
Invalid package body for flows_010500 schema
The following package body will not compile, I ran the utlprp.sql script to recompile as sysdba and they still compile with errors. Is this the schema for version 1.5 and no loner needed if we are using 1.6 htmldb? if so can the flows_010500 be dropped?
wwv_execute_immediate
wwv_flow_audit
wwv_flow_builder
wwv_flow_collection
wwv_flow_disp_page_plugs
wwv_flow_imp_item
wwv_flow_item
wwv_flow_load_data
wwv_flow_query
wwv_flow_svg
wwv_flow_svg
wwv_flow_sw_api
wwv_flow_util
wwv_flow_temp
wwv_flow_utilities
wwv_flow_upgrade
wwv_flow_wizard_api
wwv_render_calendar2
wwv_render_chart2
wwv_render_report3Janice,
If you have installed 1.6 and upgraded your 1.5 applications, you technically no longer need the FLOWS_010500 schema, and you can drop it.
To be super conservative, you can take an export of it before dropping it, should you find the extremely unlike scenario where you would need to revert back to 1.5.
Thanks,
- Scott - -
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. -
SQL developer 3.1 in schema browser doesn't show package body
Hi,
When i search a package with schema browser, i can't see the package body of other owner, the menu "edit body" is disabled.
My user as select any dictionary et select_catalog_role
When i connect with a DBA's user, i can see all.
I'am on windows with sqldev 3.1
ThanksHi erifet,
This one seems to go back and forth. It was originally fixed in Schema Browser for 3.0. The "Edit Body" was greyed out, but an "Open Body" icon in the code editor toolbar for Package Spec was enabled. Here is the forum reference:
30EA1 package bodies missing in schema browser still not fixed
In 3.1, both "Edit Body" and "Open Body" are greyed out, and that applies both to Schema Browser and Connection Navigator for Other Users packages, so at least 3.1 is consistent. The difference between the Browser and the Navigator is Schema Browser has no option to display a Package Body type (must go through Package Spec type), while the Connection Navigator displays a Package Body node type in the tree beneath the Spec node. In the forum thread AM references, Vadim explains what 3.1 does: it uses the ALL_OBJECTS view, which apparently does not include package bodies. Off-hand I'm not sure why it does not include them, and the following link doesn't shed any light:
http://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_1001.htm
Adding the execute privilege on the package does not help either. At least you have the workaround of using the Connection navigator to view the package body metadata (code) of Other Users if you have been granted either SELECT_CATALOG_ROLE or SELECT ANY DICTIONARY. As for returning to the 3.0 Schema Browser behavior, perhaps Vadim will notice your post and have some explanation as to why or why not that may be possible.
Regards,
Gary
SQL Developer Team -
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. -
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 -
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?
ThanksType the package name in the Sand select the package /procedure and press SHIFT + F4. A new window will open displaying the package script
--rsrini -
Describe (Shift-F4) For Package Body
Hi Experts,
Just a quick query if there is an quick way of getting to view the package body from an SQL Worksheet via Shift-F4 or similar ?
MY_CUSTOM_PACKAGE (Highlight & Shift-F4) gives me the spec, I would like to view the body (preferably have the option of viewing either spec or body/have both displayed in popup window)
The only way I have found is to use Connection navigator, create a filter on packages with the package name and then open up the top level navigate to the body node and click to open it in another window.
I am using ebusiness suite with 10,000's of packages in the schema, so a simple open of packages and a manual scroll is not really an option.
ThanksHi Jim,
I have used the search however the key point is being able to select an object already in the editor or type it in and then describe and edit it from there. For example, I have a saved SQL which contains an anonymous block calling a packaged procedure that I have written. I have the package right in front of me in the SQL Worksheet, however all I can do with it at the moment is view the package spec...
In my experience there seems to be two types of development styles out there, those who like to browse thru gui-based navigators to find things, and others who are more editor-centric in their approach (usually people who have been developing since SQL*Plus days or people who are familiar with TOAD). At the moment SQLDev while constantly improving is very much orientate towards the former.
regards,
Brenden -
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 -
Package Body from SQL Developer ?
Team I am using SQL Developer Version 2.1.1.64 But I can not able to see the package body.
Right click on the package provides an option to 'Save Package Spec and Body', but when I save it .. it only store the package spec ..
Is it not possible to view the package body from SQL Developer ?
Can anyone confirm ... how to get code of package body ... ?Hi Bipul,
Although there might be people here using that specific tool, there is still the dedicated SQL Developer forum to ask in:
SQL Developer
Regards
Peter -
Unable to compile a package calling a package procedure in different schema
Hello,
I'm unable to compile a package referencing a package located in another schema. I get the message: PLS-00201: identifier 'pkg1' must be declared
Facts:
0. I'm running Oracle DB 10.2.0.4.0 Enterprise Edition
1. There is one schema ('schema1') containing a package ('pkg1').
2. This package 'pkg1' has a public synonym ('pkg1' as well).
3. The EXECUTE grant is given to a role ('role1').
4. There is another schema 'schema2', which is granted the role 'role1' (and set as default).
5. This schema 'schema2' contains a package ('pkg2').
6. This package 'pkg2' calls a procedure of 'pkg1'.
7. When compiling 'pkg2', I get error message saying 'pkg1' does not exist.
Of course, if I execute 'GRANT EXECUTE ON pkg1 TO PUBLIC' or 'GRANT EXECUTE ON pkg1 TO schema2', I can compile the package 'pkg2'. But I don't want this.
And what's weird is that, connected as 'schema2', I can execute the statement 'execute pkg1.proc1' without any trouble. So I guess the role setup is okay.
What would let me compile 'pkg2' properly?
Regards,
Arnauduser3347638 wrote:
Hello,
I'm unable to compile a package referencing a package located in another schema. I get the message: PLS-00201: identifier 'pkg1' must be declared
Facts:
0. I'm running Oracle DB 10.2.0.4.0 Enterprise Edition
1. There is one schema ('schema1') containing a package ('pkg1').
2. This package 'pkg1' has a public synonym ('pkg1' as well).
3. The EXECUTE grant is given to a role ('role1').
4. There is another schema 'schema2', which is granted the role 'role1' (and set as default).
5. This schema 'schema2' contains a package ('pkg2').
6. This package 'pkg2' calls a procedure of 'pkg1'.
7. When compiling 'pkg2', I get error message saying 'pkg1' does not exist.
Of course, if I execute 'GRANT EXECUTE ON pkg1 TO PUBLIC' or 'GRANT EXECUTE ON pkg1 TO schema2', I can compile the package 'pkg2'. But I don't want this.
And what's weird is that, connected as 'schema2', I can execute the statement 'execute pkg1.proc1' without any trouble. So I guess the role setup is okay.
What would let me compile 'pkg2' properly?
Regards,
Arnaudprivileges acquired via ROLE do NOT apply within named PL/SQL procedures.
above is just a restriction built into PL/SQL.
accept it & get on with reality
Maybe you are looking for
-
This is the crash report.. AdapterDeviceID: 3582 AdapterVendorID: 8086 Add-ons: {02450954-cdd9-410f-b1da-db804e18c671}:0.96.3,{a7c6cf7f-112c-4500-a7ea-39801a327e5f}:1.99.5,[email protected]:1.0,[email protected]:1.8.15,[email protected]:1.
-
Why my iPOD 60G doesn't display all the artist & album name on screen?
Can somebody help me with this. Do I have to change something in my iPOD to work? Compaq Presario 2130LA Windows XP
-
Hi, I have a JTable with 2 columns. One of the column is editable. But depending on a checkbox selection outside the table, I need to make the column noneditable, i.e. if the checkbox is selected the column is editable else the column is non-editable
-
Can we do with a 16 pin terminal base for fp-tc-120?
i got a thermocouple module for my project. The terminal base contains only 16 pins. Is there ne solution for this or shud we get a 32 pin terminal base ?
-
How to get Server Name and port. Urgent.....
Hi, Please let me know how can i get the server name and port without using request object. I am getting it :- request.getServerName(); But, pl. let me know how can I get it without using this request object. Waiting for reply..