DBMS_PROFILER

Hi,
I want to tune a package. For tuning I am going to use DBMS_PROFILER. But it requires Sys user privilages. But I dont have permissions to use this. Can anyone help me out How to use DBMS_PROFILER.
Why I am using DBMS_PROFILER is, I want to analyze a Program unit execution and determine the runtime behavior.
Please help me out...
Thanks
Sateesh

Hi,
First you must install the DBMS_PROFILER package in your db..... You must connect as sys user... and execute the profload.sql script....
Then you must give the appropriate grant to any db user so as to execute this package ... grant execute on dbms_profiler to scott....
Afterwards , you can connect as user scott for example and execute the sql script "proftab.sql"... and finally you can :
exec dbms_profiler.start_profiler
exec your package
exec dbms_profiler.stop_profiler
Select form the dbms_profiler tables....in scott schema
plsql_profiler_data
plsql_profiler_units
plsql_profiler_runs
Sim

Similar Messages

  • Library error in installing the DBMS_PROFILER...

    Hi ,
    I have done the following trying to install the dbms_profiler package in Oracle10g v.2..
    Connected as SYS
    SQL> @C:\oracle\product\10.2.0\client\RDBMS\ADMIN\profload.sql;
    Package created
    Grant succeeded
    Synonym created
    Warning: Library created with compilation errors
    Warning: Package body created with compilation errors
    Testing for correct installation
    PACKAGE BODY sys.DBMS_PROFILER - missing or invalid
    PL/SQL procedure successfully completedWhat can i do to install this package successfully..????
    Thanks,
    Sim

    Why is your set serveroutput OFF?
    Checking the script, serverout isn't the problem, but it doesn't seem to do "show errors".
    So you will have to modify a copy of the script to add that line.
    Message was edited by:
    user599375

  • Somebody know about dbms_profiler?

    Hi.
    Do you know something about dbms_profiler?
    How do dbms_profiler work?
    Do you have some sample or site with documentation?
    Regards,
    Milton

    Hi,
    Do you know something about dbms_profiler?This package allow create a profile for PL/SQL applications for detect bottlenecks.
    How do dbms_profiler work?The DBMS_PROFILES capture all PL/SQL statements and record this information into internal tables and after you can generate reports for analyze the information.
    Do you have some sample or site with documentation?You can read the documentation for DBMS_PROFILE directly from Oracle Documentation, look the next link.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_profil.htm#ARPLS039
    Regards.

  • DBMS_PROFILER Empty

    Hi,
    I'm having some problems with DBMS_PROFILER. I have a good sized PL/SQL package, approximately 2000 lines, that I am trying to profile. I do a DBMS_PROFILER.START_PROFILER at the beginning of the whole process and a DBMS_PROFILER.STOP_PROFILER at the end. Then I user the profiler.sql script to generate the formatted HTML page of the run. I've done this countless times and have had a good experience. Sometimes however the results would be a little off...
    Sometimes I'd run it and get an HTML with no source listing even though I had explicitly re-compiled the package (normally with debugging because I've found DBMS_PROFILER works better with it on). Sometimes I'd get the source listing, but none of the times or execution counts where there. Instead they were all zeroes. I've looked in the source tables and see the _DATA table does contain the zeroes so the profiler.sql script seems to be working fine.  Other times it would normally and give me good results.
    Now, recently, no matter what I try, I cannot get a good run of data. I've looked online and the only "instructions" I see for DBMS_PROFILER are to create the tables/ sequences and then add the calls to your PL/SQL, the little bit about compiling in debug is something I found myself, so I'm really lost as what to try. I think when I first started working with DBMS_PROFILER there were some grants that had to be done, but if those weren't in place it wouldn't even run.
    I did drop and recreate the tables/ sequences and that did not help.
    Does anyone have anything else I might try? I should mention I'm on Oracle 11g. Here is the exact version from sqlplus when I log in. I'm not sure what version of DBMS_PROFILER I have if it really even has one.
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    Thanks,
    Kevin

    Well sorry about resurrecting the old post, but I figured out what the issue is. In the profiler.sql script that generates a fancy HTML report from the DBMS_PROFILER tables there is a DEF statement like the following.
    DEF p_top = 10;
    This is defining how many longest running lines to show in the summary at the beginning of the report. Later in the script there is a line that looks like this.
    :v_top := TO_NUMBER('&&p_top');
    This is assigning the value from p_top to v_top, but for some reason getting the value isn't making it over correctly. I think v_top is just getting a NULL. Worst of all it's inconsistent. Sometimes it seems to work and sometimes it doesn't.
    The quick and dirty fix I came up with was to just hard code the value for v_top. For good measure I commented out the first DEF line I mentioned as well.
    :v_top := 10;
    There is a preliminary update this script does to plsql_profiler_units and plsql_profiler_data to the spare1 and spare2 columns which flags the top longest running lines with a rank. If this update fails to mark any lines, because of a missing value for v_top, then the rest of the script fails to correctly generate the report. I'm not sure why this DEF statement is giving me so much trouble, but I'd be curious if someone had an answer.
    There is also an auxiliary fix, which I actually found first, where if you go to the c1_units cursor at the bottom of the script and comment out the requirement that spare1 IS NOT NULL in the SQL you can get the source to print out with the counts and timings, but that doesn't fix the issue with the top 10 table.
    CURSOR c1_units IS
    SELECT unit_number,
    unit_owner,
    unit_name,
    unit_type,
    spare1,
    spare2
    FROM plsql_profiler_units
    WHERE runid = :v_runid
    --AND spare1 IS NOT NULL
    ORDER BY
    unit_number;
    Thanks,
    Kevin

  • DBMS_PROFILER - only anonymous

    I am trying to get over with DBMS_PROFILER, but I face a problem, that I can't get through.
    I followed the tutorial on this page:
    http://www.oracleflash.com/44/Write-fast-and-efficient-PLSQL---DBMS_PROFILER.html
    and everything was fine till I did not change the user. When I run the profiler as the owner of the code, all the statistics are fine, but when I run those procedures as a different user (that of course has EXECUTE permissions) I can see only "ANONYMOUS" in profiler tables.
    I found something looking around in the internet, and performed these actions:
    - I granted execute permissions for user calling procedures,
    - I also granted DEBUG permissions,
    - I compiled procedures for DEBUG,
    - I have checked that code is "INTERPRETED" and not "NATIVE",
    - finally, calling user also have CREATE PROCEDURE privilege.
    Nevertheless, it still doesn't work. The problem is I want to profile application, that is running code as a different user, so I cannot change that. Any ideas what should I do, and why it is not working?

    I am trying to get over with DBMS_PROFILER, but I face a problem, that I can't get through.
    I followed the tutorial on this page:
    http://www.oracleflash.com/44/Write-fast-and-efficient-PLSQL---DBMS_PROFILER.html
    and everything was fine till I did not change the user. When I run the profiler as the owner of the code, all the statistics are fine, but when I run those procedures as a different user (that of course has EXECUTE permissions) I can see only "ANONYMOUS" in profiler tables.
    I found something looking around in the internet, and performed these actions:
    - I granted execute permissions for user calling procedures,
    - I also granted DEBUG permissions,
    - I compiled procedures for DEBUG,
    - I have checked that code is "INTERPRETED" and not "NATIVE",
    - finally, calling user also have CREATE PROCEDURE privilege.
    Nevertheless, it still doesn't work. The problem is I want to profile application, that is running code as a different user, so I cannot change that. Any ideas what should I do, and why it is not working?

  • Error with dbms_profiler

    hi,
    Oracle gurus
    When i start dbms_profiler i am getting the following errror
    exec dbms_profiler.start_profiler ('Test of raise procedure by Scott');
    error:
    ERROR at line 1:
    ORA-06528: Error executing PL/SQL profiler
    ORA-06512: at "SYS.DBMS_PROFILER", line 123
    ORA-06512: at "SYS.DBMS_PROFILER", line 132
    ORA-06512: at line 1
    could u u pls tell me how to solve it.
    regards
    RR

    try to run this to check your dbms_profiler version.
    set serveroutput on
    DECLARE
      vMajorVer     BINARY_INTEGER;
      vMinorVer     BINARY_INTEGER;
    BEGIN
      dbms_profiler.get_version(vMajorVer, vMinorVer);
      dbms_output.put_line('Major: ' || TO_CHAR(vMajorVer));
      dbms_output.put_line('Minor: ' || TO_CHAR(vMinorVer));
    END;

  • Interpreting the DBMS_PROFILER total_time column...

    Hi ,
    the dbms_profiler package gives the opportunity to find out the total time the db server has executed each line of a pl/sql program....
    However , is it right to add all the total_time period of one run and the total_time period of the second run and compare them....from the table plsql_profiler_data..???
    Thanks...
    Sim

    Thanks....
    I have read that there is also a script -provided by Oracle - named as "profsum.sql" .. but i cannot find it..... in my Oracle_Home dir.....
    Thanks... anyway for the source you provided.....
    I have also found that the table plsql_profiler_runs does contain the total time (in nanoseconds) each run executed , whereas the table plsql_profiler_data contains the total time for each line of executed code.... I have computed the total time for each line of the code (table plsql_profiler_data ) executed but was different from the total time of each run in the table plsql_profiler_runs.... Why is that..?????
    Sim
    Message was edited by:
    sgalaxy

  • Dbms_profiler in connection pooling environment

    Hello,
    I am looking for some experiences on using dbms_profiler in connection pooling environments ?
    I have got this working for single user cases but I am not sure how is this going to behave in connection pooling environments ?
    If you have done such testing before, please share your thoughts.
    Rgds,
    Gokul

    Hello,
    I am looking for some experiences on using dbms_profiler in connection pooling environments ?
    I have got this working for single user cases but I am not sure how is this going to behave in connection pooling environments ?
    If you have done such testing before, please share your thoughts.
    Rgds,
    Gokul

  • Diff between dbms_profiler and dbms_trace

    Hi,
    what would be the major diff between dbms_profiler and dbms_trace? which is more useful.
    Thanks,
    Mathew

    DBMS_PROFILER is one way to analyse where the time is being spent

  • DBMS_PROFILER tables empty

    Hi,
    I ran the following code to profile my code:
    <h6>
    DECLARE
    l_result BINARY_INTEGER;
    retcode number;
    errbuf varchar2(500);
    BEGIN
    l_result := DBMS_PROFILER.start_profiler(run_comment => 'xxotc_cust_class_stage_t: ' || SYSDATE);
    my_pkg.main ( errbuf
    ,retcode
    ,'/usr/tmp'
    ,'small_file.txt'
    l_result := DBMS_PROFILER.stop_profiler;
    END;
    </h6>
    After the program completes, when I query the profiler tables plsql_profiler_runs and plsql_profiler_units I do not find any data.
    Is there anything wrong that I am doing?
    Thanks.

    I am not sure what all tables, sequences are required, but here is what I found on my system:
    SELECT owner, object_name, object_type, status
    FROM dba_objects
    WHERE object_name LIKE 'PLSQL%'
    ORDER BY 1, 3
    Row#     OWNER     OBJECT_NAME     OBJECT_TYPE     STATUS
    1     APPS     PLSQL_PROFILER_UNITS     SYNONYM     VALID
    2     APPS     PLSQL_PROFILER_RUNS     SYNONYM     VALID
    3     APPS     PLSQL_PROFILER_RUNNUMBER     SYNONYM     VALID
    4     APPS     PLSQL_PROFILER_DATA     SYNONYM     VALID
    5     SYS     PLSQL_PROFILER_RUNNUMBER     SEQUENCE     VALID
    6     SYS     PLSQL_TRACE_RUNNUMBER     SEQUENCE     VALID
    7     SYS     PLSQL_TRACE_RUNS     TABLE     VALID
    8     SYS     PLSQL_PROFILER_UNITS     TABLE     VALID
    9     SYS     PLSQL_PROFILER_RUNS     TABLE     VALID
    10     SYS     PLSQL_PROFILER_DATA     TABLE     VALID
    11     SYS     PLSQL_TRACE_EVENTS     TABLE     VALID

  • DBMS_PROFILER Query !!! Urgent

    I am trying to check the performance of my code using DBMS_PROFILER.
    Please tell me the unit of time that the column TOTAL_TIME in PLSQL_PROFILER_DATA table stores the values?
    thanks in advance
    rollerz

    Hmmm....exclamation points in the subject, along with "Urgent".....
    No mention of Oracle version....
    For a question that can easily be answered by doing a Tahiti search. It took me about 30 seconds to come up w/ the answer.
    Since this is urgent and you obviously need the answer immediately, I'm NOT going to tell you the answer. Instead, I'll tell you this:
    1.) Point your browser to http://tahiti.oracle.com/
    2.) enter 'plsql_profiler_data' into the search box and click 'Search Doc Libraries' button.
    3.) Pick the relevant version for your current database version.
    4.) start reading.....
    I promise that all shall be revealed. The answer is there in the Oracle documentation.
    Hope that helps,
    -Mark

  • Need help with DBMS_PROFILER

    For some reason the profiler doesn't seem to be working. The user that I am logged in has select/insert/delete on the following profiler tables:
    SYS.PLSQL_PROFILER_DATA
    SYS.PLSQL_PROFILER_RUNS
    SYS.PLSQL_PROFILER_UNITS
    I am also able to perform a desc on DBMS_PROFILER, which leads me to believe that I must have execute privilege on it as well. Furthermore, I do not get an error when attempting to execute the DBMS_PROFILER procedures.
    However, when I try to run a script that starts, stops, and flushes the profiler, I do not see any data in the profiler tables. Why is this?
    example:
    DECLARE
      v_result    BINARY_INTEGER;
      v_batch_ind VARCHAR2(1);
    BEGIN 
      v_result := DBMS_PROFILER.start_profiler(run_comment => 'PK_COMMON.F_BATCH_STATUS: '||TRUNC(SYSDATE));
      v_batch_ind := PK_COMMON.F_BATCH_STATUS;
      v_result := DBMS_PROFILER.stop_profiler;
      v_result := dbms_profiler.flush_data;                                             
    END;Also, the profiler tables are in the SYS schema, not in the schema of the user that I'm logged in as. Additionally, the DBMS_PROFILER package is under PUBLIC schema. Should these be in my user's schema instead?

    Somehow it now works.
    I installed the "server-side" objects using a wizard in Toad. Now the profiler button in Toad is no longer grayed out, although it still does not toggle the profiling. Instead, I still have to put DBMS_PROFILER.start_profiler and DBMS_PROFILER.stop_profiler in my PL/SQL script. This creates the records in the profiler tables, which I then analyze using the Profiler Analysis in Toad. If the toggle button was working, then I don't think that I would even have to explicity put the calls to DBMS_PROFILER procedures in my code.

  • Dbms_profiler on 8i

    Has anybody tried to get dbms_profiler working on 8i for Linux ?
    If I "install" it with profload.sql, and then try to execute it,
    here's what I get ...
    SQL> execute dbms_profiler.start_profiler
    ('comment1', 'comment2')
    BEGIN dbms_profiler.start_profiler ('comment1', 'comment2'); END;
    ERROR at line 1:
    ORA-06528: Error executing PL/SQL profiler
    ORA-06512: at "SYS.DBMS_PROFILER", line 123
    ORA-06512: at "SYS.DBMS_PROFILER", line 132
    ORA-06512: at line 1
    Any help appreciated.
    Steve

    If anyone else is as dumb as me, the answer is ...
    run the $ORACLE_HOME/rdbms/admin/proftab.sql script as well !!!
    Doh

  • Grant for to use DBMS_PROFILER

    Hi
    What are grants that I must to have for to use DBMS_PROFILER ?
    I tried to use , and no work
    exec dbms_profiler.start_profiler('teste_fatorial');
    ERROR at line 1:
    ORA-06528: Error executing PL/SQL profiler
    ORA-06512: at "SYS.DBMS_PROFILER", line 123
    ORA-06512: at "SYS.DBMS_PROFILER", line 132
    ORA-06512: at line 1

    EXECUTEEXECUTE on DBMS_PROFILER is granted to PUBLIC by default. And if user would not have EXECUTE the error would be
    PLS-00201: identifier 'DBMS_PROFILER.START_PROFILER' must be declared
    In order to run procedure version of dbms_profiler.start_profiler script ?\rdbms\admin\proftab.sql must be run in schema executing dbms_profiler:
    SQL> exec dbms_profiler.start_profiler('teste_fatorial');
    BEGIN dbms_profiler.start_profiler('teste_fatorial'); END;
    ERROR at line 1:
    ORA-06528: Error executing PL/SQL profiler
    ORA-06512: at "SYS.DBMS_PROFILER", line 123
    ORA-06512: at "SYS.DBMS_PROFILER", line 132
    ORA-06512: at line 1
    SQL> @?\rdbms\admin\proftab.sql
    drop table plsql_profiler_data cascade constraints
    ERROR at line 1:
    ORA-00942: table or view does not exist
    drop table plsql_profiler_units cascade constraints
    ERROR at line 1:
    ORA-00942: table or view does not exist
    drop table plsql_profiler_runs cascade constraints
    ERROR at line 1:
    ORA-00942: table or view does not exist
    drop sequence plsql_profiler_runnumber
    ERROR at line 1:
    ORA-02289: sequence does not exist
    Table created.
    Comment created.
    Table created.
    Comment created.
    Table created.
    Comment created.
    Sequence created.
    SQL> exec dbms_profiler.start_profiler('teste_fatorial');
    PL/SQL procedure successfully completed.
    SQL> SY.

  • DBMS_PROFILER problem

    Surprisingly enough, I am not able to find information on profiling code that is called from another schema.
    My problem:
    - I have a package PKG_A in schema S_A
    - I have a package PKG_B in schema S_B
    - Profiler is installed in S_B and synonyms of the profiler tables are created in S_A (with proper grants)
    The procedure:
    -I connect as S_A
    -I start the profiler: DBMS_PROFILER.start_profiler(run_comment => 'TESTING STARTS AT: ' || SYSDATE);
    -In PKG_A.procedure_A, I call PKG_B.procedure_B like this: *"S_B"."PKG_B"."procedure_B"*
    -I stop the profiler: DBMS_PROFILER.stop_profiler;
    The result:
    Only PKG_A information is recorded in the profiler tables
    I have tried also creating a synonym for PKG_B and call it like this: In PKG_A.procedure_A, call *"PKG_B"."procedure_B"* (PKG_B is now a synonym)
    The result:
    Only PKG_A information is recorded in the profiler tables
    Any ideas?
    Thanks

    Hi
    DBMS_PROFILER will not gather profiing if your current user doesn't have the privilege to create procedures in the schemas owning the code called:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_profil.htm
    "Security Model
    The profiler only gathers data for units for which a user has CREATE privilege; you cannot use the package to profile units for which EXECUTE ONLY access has been granted."
    This means that you must grant the following:
    grant create any procedure to s_a;
    as unfortunately there is no privilege that grants "create procedure in s_b to s_a". This privilege has severe security impact but unfortunately that's what you need to do.
    Hope this helps.
    Cheers
    Finn

Maybe you are looking for