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.

Similar Messages

  • Query for getting all function and procedure inside the packages

    hi All
    Please provide me Query for getting all function and procedure inside the packages
    thanks

    As Todd said, you can use user_arguments data dictionary or you can join user_objects and user_procedures like below to get the name of the packaged function and procedure names.
    If you are looking for the packaged procedures and functions source then use user_source data dictionary
    select a.object_name,a.procedure_name from user_procedures a,
                  user_objects b
    where a.object_name is not null
    and a.procedure_name is not null
    and b.object_type='PACKAGE'        
    and a.object_name=b.object_name

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

  • 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

  • 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

  • How to put in and get out (format and procedure)​the calibratio​n constants to/from EEPROM?

    I am trying to have an 'E-Series Factory Cal' and 'E-Series User Cal'. I want to be able to select/make my own calibration constants (user cal) and use them in the calibrating procedure. Does anyone have an idea on how to do something like that? I need to know how to pass these new calibration contants to a function (and which function), how to get them out, and what format do these constants need to be in.

    Yuliya,
    Consult the E series manuals. I have found them to be very useful for finding information of this sort. Unfortunately for you, it has been a long time since I have used E series cards, and don't remember the calibration procedures offhand. I do know that there are a lot of cal VIs in the DAQ palette that should be VERY helpful.
    Sorry I couldn't be of more direct assistance.
    Good luck

  • Getting all Functions and Procedures using DBA_ARGUMENTS

    Hi All
    I am wanting to find out all functions and procedures that are within each of my packages and am using the following SQL to do this.
    SELECT DISTINCT A.OBJECT_NAME, A.PACKAGE_NAME,
    DECODE(POSITION,0,'FUNCTION','PROCEDURE')
    FROM DBA_ARGUMENTS A
    WHERE OWNER = 'NB'
    I have discovered however that if a procedure has been overloaded with function will appear twice: as procedure and as a function
    I was wondering if there was any workaround for this as I would only like a function to be displayed once?
    Kind Regards
    Mark

    There is an 'OVERLOAD' column which can be used to show only specific overloads (e.g. first).
    Determining which overload should be displayed in any given case may require some more thought.

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

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

  • Trying to install itunes 10.5 and get "missing package" and cannot install

    I am trying to update my Ipad 2 to 5.0.
    I have to update itunes first up to 10.5. 
    It starts to install and then gives me a message
    There is a problem with this Window Installer Package
    a program required for this install to complete could not
    be run. Contact your support personnel or package
    vendor
    I have Windows 7 64 bit.
    Just for giggles I tried 32bit. Of course it didn't work
    What now?

    I had the same problem too, had to completely remove anything apple related. You can find the instructions here: http://support.apple.com/kb/HT1923
    Uninstalling all the components didn't work first time for me, so if you have the same problem, move onto another and go back to it in a few minutes. I also had to go into programme files and delete the apple related files after install.
    Mines okay now, hopefully this works for you too! My iTunes library returned to how it was before the install also, very handy!

  • 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

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

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

  • Top 5 and Bottom 5

    Hi all ,
    Can anyone help me in solving the following problem ..
    How to get top 5 and bottom 5 selling books in a single query
    Eg:
    Book name No.sold
    A 45
    B 78
    C 8
    D 6
    T 66
    E 33
    AA 35
    AB 95
    AC 51
    AD 5
    AE 42
    desired output :
    Top 5 bname | bottom 5 bname
    AB AD
    B D
    T C
    AC E
    A AA
    Thanks in advance
    Sana

    Since, in general, more than one book can have same no_sold, more than 5 books can have top/bottom no_sold. If you want all 5 top and bottom selling books, use:
    with t as (
               select  book_name,
                       no_sold,
                       dense_rank() over (order by no_sold desc) rnk_top,
                       dense_rank() over (order by no_sold) rnk_bottom,
                       row_number() over (order by no_sold desc) rn_top,
                       row_number() over (order by no_sold) rn_bottom
                 from  books
    select  t1.book_name,
            t2.book_name,
            t1.no_sold top_no_sold,
            t2.no_sold bottom_no_sold,
            nvl(t1.rnk_top,t2.rnk_bottom) rank
      from      t t1
            full join
                t t2
              on (
                      t2.rn_bottom = t1.rn_top
      where t1.rnk_top <= 5
        and t2.rnk_bottom <= 5
      order by nvl(t1.rn_top,t2.rn_bottom)
    BO BO TOP_NO_SOLD BOTTOM_NO_SOLD       RANK
    AB AD          95              5          1
    B  D           78              6          2
    T  C           66              8          3
    AC E           51             33          4
    A  AA          45             35          5
    SQL> If all you want is any 5 top/bottom sold books:
    with t as (
               select  book_name,
                       no_sold,
                       row_number() over (order by no_sold desc) rn_top,
                       row_number() over (order by no_sold) rn_bottom
                 from  books
    select  t1.book_name,
            t2.book_name,
            t1.no_sold top_no_sold,
            t2.no_sold bottom_no_sold,
            t1.rn_top rn
      from      t t1
            inner join
                t t2
              on (
                      t1.rn_top <= 5
                  and
                      t2.rn_bottom <= 5
                  and
                      t2.rn_bottom = t1.rn_top
      order by rn
    BO BO TOP_NO_SOLD BOTTOM_NO_SOLD         RN
    AB AD          95              5          1
    B  D           78              6          2
    T  C           66              8          3
    AC E           51             33          4
    A  AA          45             35          5
    SQL> SY.

Maybe you are looking for

  • No A2DP support for Nokia N80!

    I just wonder why Nokia can't add support for A2DP in the new firmware for Nokia N80ie cellphone. =( I just uppdatet my phone in hope of getting somewhere,but it was pointless. It would be pretty nice if i could use my N80 as a real media centre with

  • Running app doesn't display unicode chars

    So far, i didn't care about character encodings. When i setup a string in java i just used my special characters, like e.g. the german umlauts: String text = "�usserlich �berhaupt nicht sch�n."; //html: Äusserlich überhaupt nicht schön Then i changed

  • Any Way to Change Thickness of Connector Lines for all lines of a Chart?

    Post Author: ScottL CA Forum: Charts and Graphs Hi All, I am trying to change the thickness of a Chart's Connector Lines for all lines of a chart and cannot find a way to accomplish this. I can go into Report Preview and individually change the thick

  • Can't get synth volume sound loud in GB2

    I dropped an .mp3 file in GB2 and want to put Jam pack 4 strings to it using my 49e. But sound is hardly ledgable. Any tips would greatly be appreciated! I made the volume as loud as it can go in sound pref's. My 49e is plugged into a Tascam 122 inte

  • FM to remove billing block form billing plan in sales order

    i want a FM to remove the billing block from the billing plan present in header data of sales order , i found the FM which delete all billing block present in sales order, is there any FM that check the line of billing block and delete that block of