How to time a procedure

hi i have a view when i time that view using
set timing on ;
set autotrace trace;
select * from emp_view where emp_id='abc' ;
it takes 200 milli seconds to return the rows
i have another procedure which accepts emp_id as in put
in side the procedure I am calling this view with the same filter and making a union to another view and returning the resultset
but when i time it it returns me 20 milli seconds
i tested this in sql plus
where did i go wrong. is it the right way to time a procedure?
Edited by: raj_fresher on Nov 4, 2009 12:49 PM

So you have timed:
1) a query in sqlplus that fetches rows, and you timed it all the way till it fetched the last row?
2) a (similar) query embedded as a cursor inside a stored proc, which cursor you opened and then fetched all rows until %NOTFOUND?
In the former case, you have retrieved all rows accross the network from the database server to the sqlplus client: this takes time.
In the latter case, you have retrieved all rows and put then INTO the stored procedure's local pl/sql variables: this does not involve any network roundtrips at all.
It's not strange that the latter case took less time.

Similar Messages

  • Does anyone know what this error code means?My itunes will not open, no matter how many times i downlaod and restore it??? "The procedure entry point xmlITexTextReaderName could not be located in the dynamic link library libxml2.dlll."

    Does anyone know what this error code means?My itunes will not even open, no matter how many times i downlaod and restore it??? "The procedure entry point xmlITexTextReaderName could not be located in the dynamic link library libxml2.dlll." Please let me know if your know anything! It is greatly apprecitated!

    Taken at face value, you're having trouble with an Apple Application Support program file there. (Apple Application Support is where single copies of program files used by multiple different Apple programs are kept.)
    Let's try something relatively simple first. Restart the PC. Head into your Add or Remove Programs control panel, select "Apple Application Support", click "Change" and then click "Repair".
    If no joy after that, try the more rigorous uninstall/reinstall procedure from the following post. (Although the procedure is for Vista and 7 and you've got XP, just read "Computer" as "My Computer", read "Uninstall a program control panel" as "Add or Remove programs control panel" and assume the system is 32-bit, and you'll be doing the right things.)
    Re: I recently updated to vista service pack 2 and I updated to itunes 10.2.1 and ever since I did that my itunes won't open any more.  Itunes starts but before anything loads a

  • How to create a procedure in oracle to write the data into file

    Hi All,
    I am just wondered on how to create a procedure which will do following tasks:
    1. Concat the field names
    2. Union all the particular fields
    3. Convert the date field into IST
    4. Prepare the statement
    5. write the data into a file
    Basically what I am trying to achieve is to convert one mysql proc to oracle. MySQL Proc is as follows:
    DELIMITER $$
    USE `jioworld`$$
    DROP PROCEDURE IF EXISTS `usersReport`$$
    CREATE DEFINER=`root`@`%` PROCEDURE `usersReport`(IN pathFile VARCHAR(255),IN startDate TIMESTAMP,IN endDate TIMESTAMP )
    BEGIN
    SET @a= CONCAT("(SELECT 'User ID','Account ID','Gender','Birthdate','Account Registered On') UNION ALL (SELECT IFNULL(a.riluid,''),IFNULL(a.rilaccountid,''),IFNULL(a.gender,''),IFNULL(a.birthdate,''),IFNULL(CONVERT_TZ(a.creationDate,'+0:00','+5:30'),'') INTO OUTFILE '",pathFile,"' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' FROM account_ a where a.creationDate>='",startDate,"' and a.creationdate <='",endDate,"')");
    PREPARE stmt FROM @a;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt ;
    END$$
    DELIMITER ;
    Regards,
    Vishal G

    1. Concat the field names
    Double Pipe (||) is the concatenation operator in Oracle. There is also a function CONCAT for this purpose
    2. Union all the particular fields
    Not sure what do you mean by UNION ALL particular fields? UNION ALL is a set operation applied on two different result sets that have the same projection.
    3. Convert the date field into IST
    SQL> select systimestamp "Default Time"
      2       , systimestamp at time zone 'Asia/Calcutta' "IST Time"
      3    from dual;
    Default Time                                       IST Time
    05-05-15 03:14:52.346099 AM -04:00                 05-05-15 12:44:52.346099 PM ASIA/CALCUTTA
    4. Prepare the statement
    What do you mean by prepare the statement?
    5. write the data into a file
    You can use the API UTL_FILE to write to a file.

  • How to call this procedure in my report to print my procedure output

    Hi,
    i have a table named letter,it contains 2 columns named as letter_id and letter_content.
    select * from letter;
    letter_id letter_content
    103 Dear MFR
    103 This is in regards to the attached DM List
    103 Please Credit us after reviewing it.
    103 Thanks
    103 Regards
    103 xxxx
    108 Dear customer
    108 This is to inform that ur DM List is as follows
    108 Credit us according to the Dm after reviewing it.
    108 Thanks
    108 Regards
    108 xxxx
    now my requirement is,i need send a parameter as letter_id to a procedure or function in pl/sql in oracle,the output should be as follows:
    if we will pass parameter(letter_id) = 103 then it displays as follows:
    Dear MFR
    This is in regards to the attached DM List.Please Credit us after reviewing it.
    Thanks
    Regards,
    XXXXX.
    if we will pass parameter(letter_id) = 108 then it should displays as follows:
    Dear customer,
    This is to inform that ur DM List is as follows. Credit us according to the Dm after reviewing it.
    Thanks
    Regards,
    XXXXX.
    the procedure for my requirement is like below.now my problem is how to call this procedure in my report.so that if i will send a parameter as letter_id then it should get my report stated above.
    CREATE OR REPLACE PROCEDURE letter_text ( p_letter_id letter.letter_id%TYPE , p_letter_contents_out OUT SYS_REFCURSOR )
    IS
    BEGIN
    OPEN p_letter_contents_out
    FOR
    SELECT letter_content
    FROM letter
    WHERE letter_id = p_letter_id
    ORDER BY line_seq;
    END letter_text;
    which you might call with something like
    SQL> var results refcursor
    SQL> exec letter_text(103, :results)
    PL/SQL procedure successfully completed.
    SQL> print :results;
    CONTENT
    Dear MFR
    this is in regards to the attached DM List
    Please credit us after reviewing it
    thanks
    Regards
    EXP
    6 rows selected.
    so, the same out put i need to get it in a report.
    Thanks

    Thanks for ur suggestions.
    i have 2 select statements.1st query is the main query for the report.so i used it at the time of report created with datablock.
    now my 2nd query is
    select letter_content
    from ( select content_seq,
         content || case content_seq
    when 2 then
    ' ' || lead(content) over (partition by letter_id order by content_seq)
    end as letter_content
    from exp_letter_contents
         where letter_id = 103)
    where content_seq <> 3;
    i had taken 2parameters 1 for the main query and 2nd is for the above query(parameter is letter_id).
    now i have to write the above select statement in the report.
    so i had taken a field object in the report and then i had written this code in before report trigger.
    function letter_contentFormatTrigger return boolean is
    begin
    select letter_content
    from ( select content_seq,
                        content ||
                        case content_seq when 2 then
                             ' ' || lead(content) over (partition by letter_id order by content_seq)
                        end as letter_content
              from exp_letter_contents
              where letter_id = 103)
    where content_seq <> 3;
    return (letter_content);
    end;
    when i tried to compile it.i got an error as follows :
    error 103 at line6,column 5
    encountered the symbol "CASE" when expecting one of the following:
    (- + mod null <an identifier>
    <a double-quoted delimited-identifier><a bind variable> avg...etc
    so,where can i write this select statement.
    i am using oracle reports6i
    Message was edited by:
    user579585

  • How does Time Machine Handle separate Boot and User Volumes?

    I recently installed an SSD and set it up as my boot drive, and I'm using another hard drive for my Home folder, if I ever run into a scenario that I need to restore my entire system, how will Time Machine handle it?
    Will it restore my system back to the drives that they came off of?, in other words will my Boot volume be restored back to the SSD and my Home folder back to the hard drive, or will it restore everything back on the one disk it asks me to select before I click restore?

    Michael Hoover wrote:
    Ok, so if I tried to access a backup from booting with the Snow Leopard install disk I won't be able to select which volume I need to restore?
    You would restore the OSX volume via the procedure in #14 of [Time Machine - Frequently Asked Questions|http://web.me.com/pondini/Time_Machine/FAQ.html] (or use the link in *User Tips* at the top of this forum).
    You would restore the data-only volume separately, via the "Star Wars" display, per #15 in the FAQ.
    I guess I would be better off doing incremental backups with Carbon Copy Cloner on 2 partitions on the same volume.
    That would also take two separate operations to restore. (It would be a good idea to do such backups +*in addition+* to Time Machine backups, in case there's a problem with either disk drive or backup app, or a user error like erasing the wrong disk.)
    Your scenario is actually quite unlikely; you'd rarely need to restore both volumes at once. If the SSD fails, you'd only need to restore it; if the HD fails, you'd only need to restore that.
    It would get a bit more complicated if you get a new Mac, especially one with a single volume. That's one of the reasons it's a good idea to keep at least a minimal Admin account on the OSX volume.

  • Execution time of procedures

    How can find out the execution time of procedures.
    I've debug and find why a procedure takes so much time for its execution.
    Could someone please help me with tips or links to useful info.

    First you can use the SQLPlus feature "set timing on" This will print the run time of each SQL or pl/sql procedure executed in the session.
    Second you can modify the pl/sql code to include timing information so as the code runs it dumps and/or calculates step and procedure run time.
    Third look at the dbms_profiler package Oracle provides.
    HTH -- Mark D Powell --

  • How to implement Stored procedure in OBIEE

    Hi experts
    How to implement Stored Procedure in OBIEE..
    My Input is Date..
    Thanks in advance
    Regards
    Frnds

    Double post :
    Re: How to get the previous monthend data and currentdate data in OBIEE report
    You don't need a stored procedure.
    If you want the amount only for one date, you can use the filter option in the formula :
    FILTER("Sales Facts"."Amount Sold" USING (Time.Day = '31 jan'))You can calculate the last day with the timestampdiff function
    31Jan = 1 Feb - 1 dayIf you want the amount of the month see my post here :
    Re: How to get the previous monthend data and currentdate data in OBIEE report

  • How to copy tax procedure TAXINJ from Client 000 to Dev client in ECC 6.0

    Hi,
    We are facing a problem for TAXINJ and TAXINN procedure, which are not available in our development client, but available in client 000.
    Please advice how to copy those procedures from client 000 to development client.
    (In client 000, we can not create a trabnsport request).

    Hello ravi,
    first  check  whether there request being generated at the time og customization in the server where the standard procedures exist.
    if yes,then you just need to change a little bit of description of these procedures and save system will ask for the development request or customization request.,you can then ask the basis guy to transport it.
    remember it is only a work around solution.
    nevertheless you can also create it manually
    revert if helpful
    Mohit Singh

  • Find Last time a procedure was called

    Hi DBAs,
    How to find when a procedure or function was called last time in 10g. For that matter even when a table was last accessed. If this can be done without enabling audit ? are there any such views or tricks to find such changes ?
    Thanks!

    Without auditing, this is not possible as a general rule.
    If a procedure has side effects, you could potentially look through the database to find those side effects. If it inserts a new row in a table with a CREATE_DATE of SYSDATE, that would be very helpful. If you're talking about a function that doesn't have side effects, however, that isn't an option. If the function or procedure runs for a relatively long period of time, its executions may be picked up in an AWR/ statspack report. But it's unlikely that every execution would be captured, it's unlikely that the history is kept particularly long, and it's not always trivial to search these reports for the last time a procedure was executed. And if you have a relatively quick procedure, it's unlikely that executions would ever be recorded.
    Segment-level statistics might give you hints about table accesses. But those statistics are cumulative since the last reboot. And there are likely background processes that touch every table at some interval (i.e. statistics gathering), which probably isn't the sort of "access" you're interested in.
    Justin

  • Calculate execution time of procedure

    hiii
    I create procedure that insert data in multiple tables i want to calculate execution time of procedure the start time
    and the end time to insert them in a table .
    and i want to calculate the start&end time that the procedure take to insert in each table
    i use DBMS_UTILITY.GET_TIME but it gives me in millisecond i want the format DD/MM/YYYY HH:MI:SS
    i also use sysdate but it gives un un reasonable time
    like the start time more than the end time
    how to calculate execution time of procedure???????
    thanks

    Look at the docs for DBMS_PROFILER.
    http://www.evdbt.com/2004_presentation_Q10.ppt
    Bye Alessandro

  • How to write a procedure to run the call the custom package from backend

    Hi All
    Oracle 10g
    Oracle Apps R12
    I am working with oracle order management here we have a customize Package called (Pick Release).Due to some problem we have running this concurrent program by manually giving Route_id as parameter. The route_id is taken from the route Table. By using this query
    select distinct route_id from route@DB_LINK_APPS_TO_ROADSHOW
    where trunc(route_date) = trunc (sysdate+2).
    so daily we have nearly 42 routes and we are running this concurrent program manually nearly times.
    so now how to write a procedure for this
    Step 1 Getting the route from route table.( By cursor we can get the route_id Accordingly)
    Step 2 How to trigger the custom package from back end and execute accordingly to that output of the cursor(route_id)
    If the cursor get 40 routes is it then the concurrent program runs 40 times according to that route_id.
    can some could provide the steps to do this
    Thanks & Regards
    Srikkanth.M

    This is about 4 or 5 lines of PL/SQL and the name of the custom package is not provided.
    If you request someone in this forum to do your work for free -because obviously you didn't even try to write it, which must be considered abusing this forum- you must at least provide sufficient info so someone can do it.
    And no, I won't do it for you.
    Sybrand Bakker
    Senior Oracle DBA

  • How much time elapsed to this insert

    This is my script.i would like to find out how much time elapsed.if i run this script
    pls tell me how to see...
    CREATE OR REPLACE procedure afterinsert(n number)
    is
    counter NUMBER;
    sql_string VARCHAR2 (1000);
    h number;
    high1 number;
    hh number;
    hh1 number;
    BEGIN
    select count(max(id)) into high1 from employee_T1 group by id;
    h:=high1+1;
    hh:=h+n;
    hh1:=hh-1;
    FOR Outercounter IN 1 .. 100 LOOP
    FOR Innercounter IN h .. hh1 LOOP
    sql_string :='INSERT INTO employee_T' || OuterCounter
    || '(id, col_a ,col_b,col_c ,col_d ,col_e, col_f ,col_g ,col_h ,col_i ,col_j ,col_k,col_l,col_m,col_n,col_o,col_p,
    col_q,col_r,col_s,col_t,col_u,col_v,col_w,col_x,col_y,col_z ) VALUES ('
    || innercounter || ',
    ''col_a'',
    sysdate,
    ' || innercounter||
    ' ,''col_d'' ,''col_e'',''col_f'' ,''col_g'' ,sysdate ,''col_i'' ,''col_j'' ,sysdate,''col_l'',''col_m'',''col_n'',''col_o'',
    '|| innercounter || ',sysdate,''col_r'',''col_s'','|| innercounter || ',''col_u'',''col_v'',''col_w'',sysdate,''col_y'',''col_z'')';
    dbms_output.put_line(sql_string);
    EXECUTE IMMEDIATE sql_string;
    END LOOP;
    END LOOP;
    END;
    thnks
    abdul

    Use the option :
    SQL> set timing on;
    SQL> select count(*) from tab;
      COUNT(*)
          1368
    Elapsed: 00:00:00.03You can try with your procedure here.
    Cheers, Bhupinder

  • How Many Times Can I Use The Same Serial Number For Adobe Creative Suite 4?

    I have design standard and was told I can use the same serial number on multiple computers. How many time can I use it? And say I install it on the maximum number of computers, but get a new computer, can I uninstall it on one of the old computers and use it on the new one? And can I use the programs on both computers simultaneously or do I have to use them one at a time?

    Fred Tech wrote:
    Broadly speaking, it depends on the type of license you have.
    Specifically, if you have a single license then officially, you should only install it once on one computer.
    Practically, (unless it has changed with CS4) you maybe able to install it on more then one computer, BUT can only run one instance of the software at a time. You can not run more then one instance of the software concurrently; i.e. you can't run Dreamweaver on Computer 1 and Photoshop on Computer 2. That would be two instances, and is not permitted.
    This is my understanding. I am happy to be corrected if I am wrong
    Fred
    Sorry Fred you are wrong.
    If you have a single license you can install it on as many computers as you like. you can only activate the suite on two computers at anyone time. Work and Home or as many of us do it Desktop and Laptop. You can not use the computers simultaneously. You only have 20 activation/deactivations so use them wisely. Student versions only have one activation. You can not break up the suite installs the suite is considered one application.

  • How many times can I review my account ?????????

    I have reviewed my account three times with my PayPal info and received confirmation from my PayPal Account but it still won't let me log in. It wants me to review EVERY time. Let me know if anyone can shed some light on this problem.
    This is a REAL PAIN.
    Thanks, Andy

    Lfc89 wrote:
    How many times can I change my country or region on my ipad 2 or iPod touch 5
    Not sure what you are asking... but...
    See  >  Change your iTunes Store country
    Here  >  http://support.apple.com/kb/HT1311
    Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region = Change Country / Region

  • How many times can a team member install Creative Cloud for teams ?

    How many times can a team member install Creative Cloud for teams ?
    Is it possible for one team member to install it for example on a portable mac and a desktop pc at the same time?

    From the Creative Cloud FAQ at https://www.adobe.com/products/creativecloud/faq.html under the Purchasing and getting started section:
    On how many computers can I install the software I download from Creative Cloud?
    You can install the desktop applications available in Creative Cloud on your primary computer and one backup computer, as long as they are not running at the same time. You will have access to both the Mac OS and Windows versions, so if you have a Mac at home and a PC at work, for instance, you can install your applications on both. See the product license agreements page for more information.

Maybe you are looking for

  • Error while loading CSV Flat file

    Hi, I am getting the following errors while loading a flat file into the DataSource: 1. Error 'Unit CS is not created in language EN...' at conversion exit CONVERSION_EXIT_CUNIT_INPUT (field UNIT record 1, value CS) 2. Error 'The argument '9,018.00'

  • How do you create a jar file in JDeveloper 11.1.2.0.0

    How do you create a jar file in JDeveloper 11.1.2.0.0

  • How can I create Accesss Key

    Hello friends We don't have a Basis guy here. I am an XI certified person wearing different caps. I am trying to append a structure to VBAK and when I try to make the change it is asking for access key. I looked at other SDN postings regarding this b

  • WRT54G Ver 6 Constant Need To Reset!

    I purchased a WRT54G Ver 6.0 Router in April to bring to Iraq with me.  I have it connected to my iDirect 3000 Satellite Modem, with the static IP config input into the WRT54G. I have two computers on my desk, my personnal XPS 1710 with Vista and my

  • Very slow launch and usage of Creative Suite: Photoshop, Illustrator and inDesign.

    I have a brand new MacBook Pro and having major problems with my Adobe CC Suite. Takes forever to launch and once/if it does it is painfully slow. All my software is up to date, running yosemite, and Suitcase fusion 5, Experiencing the problems mostl