Granting view/select access to packages and procedures

We have role that we grant to users allowing them select access to tables, views, etc.
They also need to be able to view the contents of packages, etc.
Does anyone no a way of granting them access (other than grant execute) so they can only view the content of a package?

It is not normal for users to be granted access to the source code. Even if you have EXECUTE on another user's package you can only read the spec, not the body.
If you want to do this then you will need to build some filtering views over the _SOURCE view and grant SELECT on the new views to the users in question.
A much better solution would be to just allow people to look at the source in the source control repository.
Cheers, APC
blog: http://radiofreetooting.blogspot.com

Similar Messages

  • Accessing package and procedure using dblink

    How can I access my package and function using a dblink.
    my query is like this
    select id from tablel(pck_prod.fetchid('p107'))
    union select pck_prod.pid('p107') from dual
    my package pck_prod is on remote machine and I have dblink to that machine.
    fetchid and pid are my functions in the package.
    Thanks

    Does it look anything like this?
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> CREATE OR REPLACE TYPE varchar2_table AS
      2     TABLE OF VARCHAR2 (4000);
      3  /
    Type created.
    SQL> CREATE OR REPLACE FUNCTION function_name
      2     RETURN varchar2_table
      3  IS
      4  BEGIN
      5     RETURN varchar2_table ('Banana');
      6  END;
      7  /
    Function created.
    SQL> SELECT column_value
      2  FROM   TABLE (function_name);
    COLUMN_VALUE
    Banana
    SQL> CREATE DATABASE LINK scott
      2     CONNECT TO scott
      3     IDENTIFIED BY tiger
      4     USING 'XE';
    Database link created.
    SQL> SELECT column_value
      2  FROM   TABLE (function_name@scott);
    SELECT column_value
    ERROR at line 1:
    ORA-30626: function/procedure parameters of remote object types are not
    supported
    SQL> If so then the key phrase here is 'remote object types'.

  • Sql developer doesn't show any packages and procedure.

    Hi All,
    I am perty new here and I am facing a strange problem in SQL DEVELOPER. I have one schema and it has packages and functions created in it, but when I click
    packages or functions in sql developer it says table or views does not exist. however, I can see those packages and procedures from sql plus and oracle enterprise manager. you swift reply would be highly appriciated
    hare krishna
    Alok

    Which version of sqldeveloper?
    Which version of Oracle?
    This sounds like an old bug where sqldeveloper checked for 'select any table', but you actually need 'select any dictionary'

  • SubVersion in SQL Developer - how to link to packages and procedures

    My question is this - I am starting out using SubVersion in Oracle and it seems pretty straightforward to use as a source control for files that are stored in a Windows directory, that is the only way I have used it so far.
    Am I able to use it to control packages and procedures that I have saved as part of my database, ie the procedures are part of a package and the package appears within the Packages section of the appropriate connection in SQL Developer.
    I hope this makes sense.
    Cheers,
    JabJam

    Hi JabJam,
    So far, everyone is correct. SQL Developer just uses a file-based source control system (e.g., SVN), which means updating database object definitions via scripts under version control, or somehow exporting the new definition to a script so it can be version controlled after the fact. And wouldn't it be nice if the database objects could be version controlled directly. With the database developer having control over when any changes are committed for shared use in the database. Similar to using the SVN plug-in for an IDE like Eclipse for a given programming language in a shared development environment.
    But what would your DBA have to say about that? Don't most DBAs require scripts for deploying code or structural changes?
    In Oracle, definitions (DDL) are committed automatically. Anyone granted access sees them. Since you probably don't do development directly against a production database, eventually scripts (either manual or generated) will be needed for deployment to QA or production. Few mechanisms currently exist to work against an active database without other authorized users also seeing these changes.
    For DDL, the closest thing would be the fairly recent edition-based redefinition feature in 11g (R2, I think). For DML, the OWM (Oracle Workspace Management) feature would be loosely analogous.
    This is not a simple issue. Version control via an extension for Subversion provides essential basic support. Going beyond that might mean watching the evolution of edition-based redefinition, but DBAs would probably require scripts for that too.
    Regards,
    Gary
    SQL Developer Team

  • Extracting package and procedure name in code

    In my exception processing I need to log the package and procedure name that got the exception. How do I obtain these two names without manually coding the names?
    Thanks in anticipiation

    A better option is to get the package name and the line numberA still better option is to utilize pl/scope (when you are in 11g (not sure about 10g)):
    SQL> alter session set plscope_settings='identifiers:all'
    Session altered.
    SQL> set serverout on
    SQL> create or replace package pkg
    as
       procedure p1;
       procedure p2;
    end pkg;
    Package created.
    SQL> create or replace package body pkg
    as
       procedure get_scope (obj varchar2, line int)
       as
       begin
          for c in (select rpad (lpad (' ', 2 * (level - 1)) || name, 20, '.') || ' ' || rpad (type, 20) || rpad (usage, 20) identifier_usage_contexts
                    from user_identifiers t
                    where level != 1
                    start with line = get_scope.line and object_name = obj
                    connect by usage_id = prior usage_context_id)
          loop
             dbms_output.put_line (c.identifier_usage_contexts);
          end loop;
       end get_scope;
       procedure p1
       as
       begin
          null;
       end p1;
       procedure p2
       as
       begin
          get_scope ($$plsql_unit, $$plsql_line);
       end p2;
    end pkg;
    Package body created.
    SQL> exec pkg.p2
      P2................ PROCEDURE           DEFINITION         
        PKG............. PACKAGE             DEFINITION         
        PKG............. PACKAGE             DECLARATION        
    PL/SQL procedure successfully completed.

  • Why apps don't need to be granted for synonyms of packages and procedures?

    Normally, When a user create a synonym of other schemas' package or procedure, it requires to be authorized to execute via 'grant' by owner before the user can call it.
    But on one of our environment of EBS 12.1.1(vis), apps user don't need to be granted. Just need to make synonym and then can call the synonym. while on another environment of EBS 12.1.1(product), it still need to be granted. I notice that apps user in the two diffierent environment has many different database roles. Is any role associated with this? Does anybody know the reason?
    Thanks in advance!
    Jing
    Edited by: user12954958 on Aug 25, 2010 11:44 PM

    Hi Jing;
    Please check below thread which is posted Hussein Sawwan
    Re: apps & applsys password
    aaps,applsyspub,applsys
    Re: apps & applsys password
    Regard
    Helios

  • Access Stored Package and Trigger

    I first connect to Oracle using my user name (such as TESTER). Once I get connected, I create a package named pkg_test. If I understand it correctly that Oracle will stored it in DBA_SOURCE table, not in my schema. Now, I have some questions regarding to the privilege to access the package.
    1) When I want to access the package after I connect to Oracle, I will directly use it without prefix, that is, pkg_test.sp_get_text()... But when other users want to access it, do they need to use the prefix TESTER, that is, TESTER.pkg_test.sp_get_text()?
    2) After I connect to Oracle, I create a table named test_tab. This table will be accessible by other users. Then I create a trigger on the table.
    create or replace trigger trig_test
    for insert on TESTER.test_tab
    Do I need to use the prefix TESTER in the trigger so that it will be accessible to other users?
    Thanks
    Scott

    scottjhn wrote:
    If I understand it correctly that Oracle will stored it in DBA_SOURCE table, not in my schema. Now, I have some questions regarding to the privilege to access the package.The source will be stored in the data dictionary, yes (it will also be visible in ALL_SOURCE and USER_SOURCE). But the object itself will be stored in the TESTER schema.
    1) When I want to access the package after I connect to Oracle, I will directly use it without prefix, that is, pkg_test.sp_get_text()... But when other users want to access it, do they need to use the prefix TESTER, that is, TESTER.pkg_test.sp_get_text()?By default, yes. Oracle will try to resolve objects without schema qualifiers using objects in the current schema.
    You can change this default by creating a public synonym for PKG_TEST or by creating a private synonym in each user's schema for PKG_TEST or by running
    ALTER SESSION SET current_schema = 'TESTER' when logged in as a different user
    2) After I connect to Oracle, I create a table named test_tab. This table will be accessible by other users. Then I create a trigger on the table.
    create or replace trigger trig_test
    for insert on TESTER.test_tab
    Do I need to use the prefix TESTER in the trigger so that it will be accessible to other users? No, you don't need to use the schema qualifier if TESTER will be the owner of the trigger.
    Justin

  • Error message when compiling invalid packages and procedures

    Hi.
    I have a routine for copying certain data from a production database to a test database. To do this I disable constraints and triggers, truncate tables, copy tables and enable triggers and constraints again.
    Now several of my functions, procedures and packages are made invalid and marked with a red cross. In SQL Developer I can compile invalid functions, procedures and packages. When I compile functions it works fine, but when compiling procedures and packages I get the following error message:
    An error was encountered performing the requested operation:
    ORA-00904: "ATTRIBUTE": Invalid identifier
    Vendor code 904
    When I click OK on this message I get a confirmation saying:
    Packages have been compiled with #0.CNT# errors.
    I had this error in both the previous and the new version. Is this a bug or is there a way to come around it? When I copy and modify the SQL generated to perform this task and run it in SQL Plus it works fine.
    I use Windows 2000 5.00.2195 Service Pack 4, SQL Developer version 1.2.1, Oracle 9.2.0.8.0 and Java version 1.5.0_11
    Message was edited by:
    SvSig

    i have now upgraded to Java 1.6 update 2. I still get basically the same error, but it is presented a little bit differently:
    An error was encountered performing the requested operation:
    ORA-00904: "ATTRIBUTE": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    *Cause:
    *Action:
    Vendor code 904
    Are there other possible error causes than the operating system version and the database version?
    We are going to install an Oracle 10 test database in a couple of weeks, so then I will find out whether the database version is the problem.

  • Get top packages and procedures

    What is the best way to get a count of how many times all functions, procedures or packages are running in a database which has no documentation? Would this require a re-coding of all current objects (there are several thousand)?
    Any advice is much appreciated.

    One way would be to turn on auditing for the packages/procedures in question. You could then query dba_audit_trail to see who, what, and when are calling them. Keep in mind that this can have performance impacts.

  • Toad packages and procedures not staying compiled

    Dear All,
    I am using Toad 9.6, and i am suffering a problem. when my server restart then my some of procedure or function not staying compiled. Even all procedure are compile correctly. Because of this problem , my application generating error.
    We haven't seen any pattern as to which ones become uncompiled. One day i compile all my procedure successfully and the next morning the some of procedures are uncompiled. Most of the time they will work after being
    recompiled, but occasionally they will stay compiled for a few minutes and then go back to being uncompiled.
    any help?
    Regards,

    Thanks alot for reply
    If i run this then never compiled object come uncompiled...
    Regards,

  • CANNOT GRANT A USER ACCESS TO VIEW A SCHEMA USING PORTAL API'S

    Hi, we are using portal 3.0.9.8.3(UNIX middle tier) on a 8.1.7.3 database (UNIX backend).
    We would like to be able to grant a group of users the rights to view only a specific table or view using the functionality of the wwexp_api_engine package. However the only way to do this seems to be to give the users "view data" privilege to "all schemas" within the portal admin. This presents a large security hole since users can could potentionaly pass in different table names (to a url) and get access to undesired tables.
    Granting executable privileges on the package(and sub packages) to the application database schema(whether public or explicit) still yields the above
    message: Error: Insufficient privileges. (WWV-10600)
    So does anyone know of a way to use the wwexp_api_engine package and restrict it to only a certain table or view of a schema? Or possibly what grants may be needed to allow the package to access the table without giving "view data" portal access to "all schemas".
    Any help would be appreciated.

    Hi,
    Try to grant "Create" global privilege to user and grant explicit privileges on the tables to the user. This way the user can create objects, but can view only those tables on which he has a privilege.
    Thanks,
    Sharmila

  • How to find the grants given to user for package/procedure?

    Hi all,
    how to find the grants in oracle for what all are the grants a user is having for package and procedure?
    Thanks & Regards,
    M.Murali..

    M. Murali
    Questions like this are asked over and over again on numerous sites on the Internet, including this forum, and answered.
    You are aware this forum has a 'Search Forum' button?
    PLEASE USE IT and STOP asking FAQ and DOC questions!!!!!!!!!!!!!!!!!!!
    Sybrand Bakker
    Senior Oracle DBA
    Experts: those who did read the documentation

  • Import package and create view object

    Hi,
    How can i import package from another project and create a new view object with my package and with the imported package.
    Thanks
    null

    Hi,
    How can i import package from another project and create a new view object with my package and with the imported package.
    Thanks
    null

  • Find all Package and their related Procedure Names using a specifc Table

    I have 25 Packages
    Each Package holds 30-35 Procedures
    I need to find out all Packages and Procedures
    Each Procedure handles 5 - 20 Tables as Per The Need of Business Rule.
    I need All Package and Related Procedure Names Where a Specific Table Name Appears(DBA_SOURCE doesn't serve purpose.)
    Early Reply Appreciated.
    Thanks and Regards,

    I tried the solution provided to me, but unfortunately the issue remains the same.
    I was Advised to Execute the SQL utldtree.Sql, and then Execute deptree_fill.
    The output is given by a Table DEPTREE (Columns are: .'NESTED_LEVEL', 'TYPE', 'SCHEMA', 'NAME' and 'SEQ#')
    The output I am getting From the Table DEPTREE is as follows -
    Column TYPE value is PACKAGE; Column NAME Value is ACTUAL PACKAGE NAME
    Column TYPE value is PACKAGE BODY; Column NAME Value is ACTUAL PACKAGE NAME
    This repeats till the count the TABLE Name is found in the same PACKAGE
    Desired Output should be -
    Column TYPE value PACKAGE; Column NAME Value ACTUAL PACKAGE NAME
    Column TYPE value PACKAGE BODY; Column NAME Value ACTUAL PACKAGE BODY NAME
    This should repeat till the count the TABLE Name appears in different PACKAGE BODY of the same PACKAGE
    Warm Regards,

  • Granting Read Only Access to user in another schema

    Oracle Database 10g
    Red Hat Enterprise Linux Server release 5.3
    We are requested by a developer to grant his account read only access to TABLES, VIEWS, INDEXES, SEQUENCES, FUNCTIONS, PROCEDURES, PACKAGES, TRIGGERS, JOBS of another schema.
    I know granting read only access to Tables and Views. But is it possible to grant READ ONLY access to other mentioned objects ? How to do it ?
    And some views are in INVALID status.
    I tried to compile them using alter view owner.viewname compile;
    But got this ---- Warning: View altered with compilation errors.
    Those views are still in INVALID status. And then I tried to use utlrp.sql . Same result.
    Then I used the following
    SELECT TEXT FROM DBA_VIEWS WHERE VIEW_NAME='view-name';
    select REFERENCED_NAME,REFERENCED_TYPE from dba_dependencies where name='view-name';
    It turns out some reference types are non existent.
    Does that mean DBAs cannot do anything about this ?

    Nilton wrote:
    We are requested by a developer to grant his account read only access to TABLES, VIEWS, INDEXES, SEQUENCES, FUNCTIONS, PROCEDURES, PACKAGES, TRIGGERS, JOBS of another schema.
    I know granting read only access to Tables and Views. But is it possible to grant READ ONLY access to other mentioned objects ? How to do it ?
    TABLES -> YES grant SELECT
    VIEWS -> YES grant SELECT
    SEQUENCE -> YES grant SELECT
    INDEXES -> There is no read access for indexes...indexes are put on tables and a user who has read access on tables can read the index as well.
    FUNCTIONS / PROCEDURES / PACKAGES -> I am not sure what you mean by read access on procedures, functions and packages. You may grant EXECUTE privilege on these.
    TRIGGERS -> there is no read access on triggers required. They are implemented on tables for a DML event. If the user has DML access he has the execute access on the trigger as well.
    JOBS -> I am not sure what to read from Jobs.
    And some views are in INVALID status.
    I tried to compile them using alter view owner.viewname compile;
    But got this ---- Warning: View altered with compilation errors.
    Those views are still in INVALID status. And then I tried to use utlrp.sql . Same result.
    Then I used the following
    SELECT TEXT FROM DBA_VIEWS WHERE VIEW_NAME='view-name';
    select REFERENCED_NAME,REFERENCED_TYPE from dba_dependencies where name='view-name';
    It turns out some reference types are non existent.
    Does that mean DBAs cannot do anything about this ?There are compilation errors in the Views. e.g. the view may be referring to a table which doesn't exist etc.
    Unless you fix the error in the view you can't compile it and male it valid. Fix the view errors. If objects are non existing create them or refer to view to some where else.
    If the nonexistent objects were mistakenly dropped, or the data file which contained those objects was dropped, no matter what was the reason for that object to be gone a DBA can bring it back if he is a well prepared DBA and has setup his database for such kind of disasters.
    Now tell us why those objects are non-existent ? were they meant to be gone ? or they were dropped mistakenly?
    Now here are my guesses:
    If they were meant to be gone then probably the views definitions need to be adjusted not to refer them anymore.
    If they were mistakenly dropped then:
    Do you have them in recyclebin? (only tables) if YES just FLASHBACK TABLE <<tablename>> AS BEFORE DROP.
    Is your database has Flashback database ON? if YES FLASHBACK DATABASE until 'time/scn just before the object was dropped'
    Do you have backups and your database is running in ARCHIVE LOG mode? if YES perform an incomplete recovery using RMAN.

Maybe you are looking for

  • Labview runs CANBus and DNP3 software model at the same time

    I have an ordinary computer which communicates with several DSPs (CANBus communiation) through Compact Rio. The physical connection is that the DSPs' CANBuses are connected together and connected into Compact Rio, then the Compact Rio is connected wi

  • Tacacs+ authentication/authorization based on user's subnet

    Hi Guys/Girls We have number of production cisco gears, all of which are configured with Tacacs+ and all of them working just fine. But now I have a requirement to implement SSH-ver2 across whole network, comprise of about 8000 cisco gears. I need to

  • Lookup on source side

    Newbie to goldengate, so please excuse I need to replicate some columns from table emp on database A to table emp on database B Assume Table emp structure: empid,ename,deptid On the same database I have dept table deptid, deptname On target emp struc

  • Comparing an XSL file

    Hi, when i try to compare an .xsl file, i have an error that SCM can't compare binary file ! .xsl files are the same as .html files ! Is there a way for SCM to consider .xsl files as text files ? (such as .html files ?) thanks

  • Table Names for CIN transactions -Help needed

    Hi, "Please teach us the table names which are updated with below transaction. Since it will be necessary for add-on development. 1. J1IH 2. J1IIN 3. J1IJ 4. J1IS 5. J1IEX 6. J1IG Please help me.. Thanks KB