Parse times in Oracle 11G

Has anyone else experienced extremely long parse times for Oracle 11G versus 10G? We are experiencing at least a 10 times increase in the parsing of our SQL statements. This is causing our customers to complain when running reports which contain several SQL statements that aren't in the SGA due to the infrequent use. I have opened a Service Request and development stated that this is to be expected with Oracle 11G due to the new optimizer features. I have tried to disable the features by settting the optimizer version to anything but 11G and no setting has helped. To make thing even worse, this increased parse time is on a new server that should be 2.5 times faster than the server that is running the 10G database. I do get at least a 2.5 times increase, larger if I/O intensive, in almost every other aspect of the database except for the parse times.

user5999814 wrote:
I wondered what the resolution was to this issue. We currently experiencing this will our Oracle 11.1.0.7 database with a small but important set of queries and it seems to be getting worse. We first noticed it with a query that went from taking 3.5 seconds to 7 seconds. A SQLTrace / TKProf revealed that 99% of the time was being spent during the parsing. A second similar query that brings in more data is taking around 1.5 minutes to parse then only a few seconds to actually execute. These are queries that are part of on online web transaction so this is not acceptable. We are able to replicate the behavior in multiple database instances.As a starting point it would be interesting to see the tkprof output from :
alter session set events '10046 trace name context forever, level 8';
+your select statement+
exitWhen posting the output, use the "code" tags (see below) to make the output readable.
Regards
Jonathan Lewis
To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
There is a +"Preview"+ tab at the top of the text entry panel. Use this to check what your message will look like before you post the message. If it looks a complete mess you're unlikely to get a response. (Click on the +"Plain text"+ tab if you want to edit the text to tidy it up.)
+"I believe in evidence. I believe in observation, measurement, and reasoning, confirmed by independent observers. I'll believe anything, no matter how wild and ridiculous, if there is evidence for it. The wilder and more ridiculous something is, however, the firmer and more solid the evidence will have to be."+
Isaac Asimov                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Oracle 11g - Is there a way to speed up hard parsing?

    Hi,
    I have used TKPROF to examine my slow SQL and it's pointed out it is because of the hard parsing process. Bind variables would not help in my case because the query conditions vary quite arbitrarily depending on what the user selects on the application GUI.
    I've managed to break the query into smaller ones using UNION ALL and the parsing takes much shorter. However I'm still wondering if, in general, there could be anything one could do to speed up the hard parsing process, or it is something totally internal in Oracle and there's nothing we can do about it?
    A small example of the slow query (execute 0.00s, fetch 0.04s, and parse 66.51s), nr is the primary key.
    SELECT n.nr,n.x,n.y,n.z
    FROM
    data2points n WHERE((n.nr>2595 AND n.nr<2600) OR n.nr=2601 OR (n.nr>2602 AND
      n.nr<2608) OR n.nr=2617 OR n.nr=2623 OR (n.nr>2634 AND n.nr<2637) OR
      (n.nr>6457 AND n.nr<6461) OR n.nr=6462 OR n.nr=6468 OR n.nr=6480 OR
      (n.nr>20677 AND n.nr<20680) OR n.nr=20681 OR n.nr=20683 OR n.nr=26404 OR
      n.nr=26406 OR (n.nr>26408 AND n.nr<26411) OR n.nr=26422 OR (n.nr>26423 AND
      n.nr<26426) OR (n.nr>26426 AND n.nr<26431) OR (n.nr>26432 AND n.nr<26435)
      OR n.nr=26441 OR n.nr=26443 OR (n.nr>26471 AND n.nr<26474) OR (n.nr>26474
      AND n.nr<26478) OR (n.nr>26481 AND n.nr<26486) OR (n.nr>26487 AND
      n.nr<26492) OR n.nr=26498 OR (n.nr>26504 AND n.nr<26507) OR (n.nr>26513 AND
      n.nr<26516) OR (n.nr>26516 AND n.nr<26520) OR n.nr=26522 OR (n.nr>26523 AND
      n.nr<26527) OR (n.nr>26527 AND n.nr<26530) OR (n.nr>26530 AND n.nr<26533)
      OR n.nr=26538 OR n.nr=26562 OR (n.nr>26566 AND n.nr<26570) OR (n.nr>26570
      AND n.nr<26575) OR n.nr=26580 OR n.nr=26603 OR (n.nr>26607 AND n.nr<26610)
      OR (n.nr>26610 AND n.nr<26614) OR (n.nr>26618 AND n.nr<26621) OR n.nr=26624
      OR n.nr=26627 OR (n.nr>26629 AND n.nr<26632) OR n.nr=26634 OR (n.nr>26635
      AND n.nr<26638) OR n.nr=26639 OR n.nr=26642 OR n.nr=26648 OR (n.nr>26650
      AND n.nr<26662) OR n.nr=26663 OR (n.nr>26664 AND n.nr<26668) OR (n.nr>26695
      AND n.nr<26698) OR (n.nr>26699 AND n.nr<26707) OR n.nr=26708 OR n.nr=26710
      OR (n.nr>26714 AND n.nr<26729) OR n.nr=26751 OR (n.nr>26752 AND n.nr<26755)
      OR n.nr=26757 OR (n.nr>26759 AND n.nr<26762) OR (n.nr>26762 AND n.nr<26766)
      OR n.nr=26767 OR (n.nr>26773 AND n.nr<26776) OR n.nr=26798 OR (n.nr>26801
      AND n.nr<26807) OR n.nr=26808 OR (n.nr>26813 AND n.nr<26816) OR n.nr=26817
      OR n.nr=26819 OR (n.nr>26852 AND n.nr<26855) OR (n.nr>26857 AND n.nr<26861)
      OR (n.nr>26862 AND n.nr<26865) OR (n.nr>26869 AND n.nr<26874) OR
      (n.nr>26874 AND n.nr<26881) OR (n.nr>26881 AND n.nr<26884) OR (n.nr>26902
      AND n.nr<26907) OR (n.nr>26907 AND n.nr<26910) OR (n.nr>26910 AND
      n.nr<26918) OR n.nr=26923 OR n.nr=26945 OR (n.nr>26946 AND n.nr<26949) OR
      (n.nr>26951 AND n.nr<26958) OR n.nr=26959 OR n.nr=26964 OR (n.nr>26965 AND
      n.nr<26971) OR n.nr=26972 OR n.nr=26979 OR (n.nr>26998 AND n.nr<27002) OR
      n.nr=27004 OR (n.nr>27005 AND n.nr<27008) OR n.nr=27009 OR (n.nr>27011 AND
      n.nr<27015) OR (n.nr>27019 AND n.nr<27022) OR (n.nr>27022 AND n.nr<27026)
      OR (n.nr>27042 AND n.nr<27050) OR n.nr=27051 OR (n.nr>27052 AND n.nr<27055)
      OR n.nr=27064 OR n.nr=27087 OR (n.nr>27088 AND n.nr<27096) OR (n.nr>27096
      AND n.nr<27099) OR n.nr=27100 OR n.nr=27106 OR n.nr=27130 OR n.nr=27138 OR
      (n.nr>27140 AND n.nr<27145) OR (n.nr>27145 AND n.nr<27150) OR n.nr=27152 OR
      n.nr=27154 OR n.nr=27160 OR n.nr=27182 OR n.nr=27184 OR n.nr=27186 OR
      (n.nr>27188 AND n.nr<27191) OR (n.nr>27191 AND n.nr<27194) OR n.nr=27195 OR
      (n.nr>27200 AND n.nr<27203) OR (n.nr>27204 AND n.nr<27208) OR (n.nr>27223
      AND n.nr<27226) OR (n.nr>27230 AND n.nr<27235) OR n.nr=27236 OR n.nr=27242
      OR (n.nr>27243 AND n.nr<27246) OR (n.nr>27246 AND n.nr<27249) OR n.nr=27250
      OR n.nr=27256 OR n.nr=27258 OR n.nr=27267 OR n.nr=27273 OR n.nr=27276 OR
      (n.nr>27277 AND n.nr<27280) OR (n.nr>27281 AND n.nr<27289) OR (n.nr>27299
      AND n.nr<27303) OR (n.nr>27308 AND n.nr<27312) OR (n.nr>27332 AND
      n.nr<27337) OR n.nr=27339 OR n.nr=27342 OR (n.nr>27344 AND n.nr<27351) OR
      (n.nr>27354 AND n.nr<27357) OR (n.nr>27357 AND n.nr<27362) OR (n.nr>27366
      AND n.nr<27369) OR n.nr=27370 OR (n.nr>27404 AND n.nr<27407) OR (n.nr>27407
      AND n.nr<27410) OR n.nr=27411 OR (n.nr>27412 AND n.nr<27417) OR n.nr=27422
      OR (n.nr>27423 AND n.nr<27427) OR n.nr=27431 OR n.nr=27434 OR n.nr=27437 OR
      n.nr=27446 OR n.nr=27448 OR n.nr=27454 OR n.nr=27457 OR (n.nr>27458 AND
      n.nr<27461) OR (n.nr>27464 AND n.nr<27467) OR (n.nr>27467 AND n.nr<27470)
      OR n.nr=27471 OR n.nr=27473 OR (n.nr>27478 AND n.nr<27481) OR n.nr=27486 OR
      (n.nr>27488 AND n.nr<27491) OR (n.nr>27497 AND n.nr<27501) OR n.nr=27502 OR
      (n.nr>27505 AND n.nr<27511) OR n.nr=27512 OR n.nr=27532 OR n.nr=27534 OR
      n.nr=27560 OR (n.nr>27565 AND n.nr<27571) OR (n.nr>27574 AND n.nr<27577) OR
      n.nr=27578 OR n.nr=27581 OR n.nr=27585 OR (n.nr>27600 AND n.nr<27604) OR
      n.nr=27611 OR (n.nr>27613 AND n.nr<27625) OR (n.nr>27631 AND n.nr<27636) OR
      n.nr=27639 OR n.nr=27641 OR n.nr=27655 OR (n.nr>27656 AND n.nr<27659) OR
      (n.nr>27659 AND n.nr<27663) OR (n.nr>27663 AND n.nr<27667) OR n.nr=27668 OR
      n.nr=27674 OR n.nr=27676 OR n.nr=27678 OR n.nr=27700 OR n.nr=27706 OR
      (n.nr>27707 AND n.nr<27712) OR (n.nr>27716 AND n.nr<27719) OR (n.nr>27719
      AND n.nr<27726) OR n.nr=27728 OR n.nr=27730 OR (n.nr>27755 AND n.nr<27758)
      OR n.nr=27761 OR (n.nr>27762 AND n.nr<27766) OR n.nr=27767 OR n.nr=27773 OR
      (n.nr>27774 AND n.nr<27779) OR n.nr=27782 OR (n.nr>27796 AND n.nr<27799) OR
      (n.nr>27801 AND n.nr<27808) OR n.nr=27809 OR n.nr=27812 OR (n.nr>27813 AND
      n.nr<27817) OR (n.nr>27817 AND n.nr<27823) OR n.nr=27829 OR n.nr=27847 OR
      (n.nr>27848 AND n.nr<27852) OR n.nr=27853 OR n.nr=27855 OR (n.nr>27856 AND
      n.nr<27859) OR n.nr=27860 OR n.nr=27862 OR n.nr=27864 OR (n.nr>27869 AND
      n.nr<27875) OR n.nr=27876 OR n.nr=27879 OR (n.nr>27882 AND n.nr<27885) OR
      (n.nr>27903 AND n.nr<27906) OR n.nr=27907 OR n.nr=27911 OR (n.nr>27912 AND
      n.nr<27915) OR (n.nr>27961 AND n.nr<27964) OR n.nr=27967 OR (n.nr>27968 AND
      n.nr<27974) OR (n.nr>27978 AND n.nr<27984) OR (n.nr>28016 AND n.nr<28022)
      OR (n.nr>28022 AND n.nr<28027) OR n.nr=28033 OR (n.nr>28056 AND n.nr<28059)
      OR (n.nr>28059 AND n.nr<28065) OR (n.nr>28065 AND n.nr<28068) OR n.nr=28077
      OR (n.nr>28083 AND n.nr<28086) OR (n.nr>28090 AND n.nr<28096) OR
      (n.nr>28097 AND n.nr<28103) OR n.nr=28112 OR n.nr=28114 OR (n.nr>28116 AND
      n.nr<28120) OR (n.nr>28120 AND n.nr<28123) OR (n.nr>28153 AND n.nr<28159)
      OR n.nr=28161 OR n.nr=28163 OR (n.nr>28164 AND n.nr<28167) OR (n.nr>28171
      AND n.nr<28174) OR (n.nr>28194 AND n.nr<28197) OR (n.nr>28200 AND
      n.nr<28206) OR n.nr=28207 OR (n.nr>28212 AND n.nr<28215) OR n.nr=28217 OR
      n.nr=28237 OR n.nr=28244 OR (n.nr>28245 AND n.nr<28248) OR (n.nr>28253 AND
      n.nr<28262) OR n.nr=28263 OR n.nr=28265 OR n.nr=28268 OR (n.nr>28269 AND
      n.nr<28273) OR n.nr=28291 OR n.nr=28293 OR (n.nr>28297 AND n.nr<28301) OR
      (n.nr>28301 AND n.nr<28305) OR (n.nr>28308 AND n.nr<28311) OR n.nr=28312 OR
      n.nr=28314 OR n.nr=28316 OR n.nr=28324 OR n.nr=28335 OR (n.nr>28345 AND
      n.nr<28349) OR (n.nr>28350 AND n.nr<28353) OR (n.nr>28354 AND n.nr<28360)
      OR n.nr=28361 OR n.nr=28366 OR (n.nr>28376 AND n.nr<28379) OR (n.nr>28401
      AND n.nr<28405) OR (n.nr>28405 AND n.nr<28416) OR (n.nr>28416 AND
      n.nr<28419) OR (n.nr>28422 AND n.nr<28425) OR (n.nr>28444 AND n.nr<28449)
      OR (n.nr>28449 AND n.nr<28452) OR (n.nr>28453 AND n.nr<28460) OR n.nr=28488
      OR (n.nr>28491 AND n.nr<28494) OR n.nr=28495 OR (n.nr>28496 AND n.nr<28504)
      OR (n.nr>28505 AND n.nr<28510) OR (n.nr>28510 AND n.nr<28517) OR n.nr=28531
      OR (n.nr>28535 AND n.nr<28539) OR (n.nr>28539 AND n.nr<28542) OR
      (n.nr>28547 AND n.nr<28551) OR n.nr=28552 OR n.nr=28573 OR n.nr=28576 OR
      (n.nr>28578 AND n.nr<28582) OR (n.nr>28582 AND n.nr<28587) OR (n.nr>28599
      AND n.nr<28607) OR (n.nr>28607 AND n.nr<28610) OR n.nr=28611 OR (n.nr>28613
      AND n.nr<28617) OR (n.nr>28620 AND n.nr<28624) OR (n.nr>28625 AND
      n.nr<28628) OR (n.nr>28634 AND n.nr<28639) OR n.nr=28641 OR (n.nr>28642 AND
      n.nr<28651) OR n.nr=28657 OR n.nr=28667 OR (n.nr>28668 AND n.nr<28671) OR
      (n.nr>28671 AND n.nr<28674) OR (n.nr>28680 AND n.nr<28691) OR (n.nr>28691
      AND n.nr<28694) OR n.nr=28695 OR (n.nr>28717 AND n.nr<28721) OR (n.nr>28721
      AND n.nr<28724) OR (n.nr>28724 AND n.nr<28729) OR (n.nr>28729 AND
      n.nr<28733) OR n.nr=28735 OR (n.nr>28736 AND n.nr<28747) OR n.nr=28748 OR
      n.nr=28750 OR (n.nr>28753 AND n.nr<28757) OR n.nr=28758 OR n.nr=28763 OR
      n.nr=28765 OR n.nr=28769 OR (n.nr>28771 AND n.nr<28774) OR n.nr=28775 OR
      (n.nr>28776 AND n.nr<28779) OR n.nr=28780 OR n.nr=28783 OR (n.nr>28784 AND
      n.nr<28794) OR n.nr=28808 OR (n.nr>28810 AND n.nr<28813) OR n.nr=28814 OR
      (n.nr>28815 AND n.nr<28821) OR (n.nr>28826 AND n.nr<28834) OR (n.nr>28846
      AND n.nr<28849) OR n.nr=28855 OR n.nr=28857 OR n.nr=28859 OR (n.nr>28864
      AND n.nr<28870) OR (n.nr>28871 AND n.nr<28876) OR (n.nr>28876 AND
      n.nr<28879) OR n.nr=28880 OR n.nr=28884 OR n.nr=28888 OR (n.nr>28889 AND
      n.nr<28892) OR (n.nr>28893 AND n.nr<28896) OR (n.nr>28896 AND n.nr<28901)
      OR (n.nr>28906 AND n.nr<28909) OR n.nr=28931 OR (n.nr>28937 AND n.nr<28943)
      OR n.nr=28948 OR n.nr=28953 OR (n.nr>28958 AND n.nr<28961) OR n.nr=28967 OR
      n.nr=28970 OR (n.nr>28972 AND n.nr<28975) OR (n.nr>28975 AND n.nr<28980) OR
      (n.nr>28980 AND n.nr<28984) OR n.nr=28991 OR n.nr=28993 OR n.nr=28996 OR
      (n.nr>28999 AND n.nr<29002) OR n.nr=29011 OR (n.nr>29012 AND n.nr<29018) OR
      (n.nr>29027 AND n.nr<29036) OR n.nr=29038 OR n.nr=29041 OR n.nr=29044 OR
      (n.nr>29048 AND n.nr<29051) OR n.nr=29053 OR (n.nr>29055 AND n.nr<29060) OR
      n.nr=29062 OR (n.nr>29063 AND n.nr<29069) OR (n.nr>29071 AND n.nr<29075) OR
      n.nr=29077 OR n.nr=29079 OR (n.nr>29097 AND n.nr<29100) OR (n.nr>29104 AND
      n.nr<29109) OR (n.nr>29109 AND n.nr<29112) OR (n.nr>29115 AND n.nr<29118)
      OR (n.nr>29118 AND n.nr<29122) OR n.nr=29135 OR (n.nr>29136 AND n.nr<29140)
      OR (n.nr>29143 AND n.nr<29148) OR n.nr=29149 OR n.nr=29155 OR n.nr=29157 OR
      (n.nr>29177 AND n.nr<29181) OR (n.nr>29182 AND n.nr<29191) OR n.nr=29196 OR
      n.nr=29199 OR (n.nr>29219 AND n.nr<29222) OR (n.nr>29224 AND n.nr<29229) OR
      (n.nr>29229 AND n.nr<29233) OR (n.nr>29236 AND n.nr<29239) OR (n.nr>29239
      AND n.nr<29244) OR (n.nr>29244 AND n.nr<29249) OR n.nr=29257 OR n.nr=29260
      OR (n.nr>29261 AND n.nr<29266) OR n.nr=29267 OR n.nr=29269 OR (n.nr>29270
      AND n.nr<29274) OR (n.nr>29276 AND n.nr<29279) OR n.nr=29280 OR n.nr=29282
      OR n.nr=29286 OR n.nr=29288 OR n.nr=29290 OR n.nr=29296 OR (n.nr>29297 AND
      n.nr<29300) OR (n.nr>29300 AND n.nr<29304) OR (n.nr>29305 AND n.nr<29310)
      OR (n.nr>29310 AND n.nr<29314) OR (n.nr>29319 AND n.nr<29324) OR
      (n.nr>29328 AND n.nr<29332) OR (n.nr>29335 AND n.nr<29338) OR (n.nr>29338
      AND n.nr<29343) OR (n.nr>29347 AND n.nr<29350) OR n.nr=29351 OR n.nr=29354
      OR (n.nr>29357 AND n.nr<29367) OR (n.nr>29367 AND n.nr<29371) OR
      (n.nr>29372 AND n.nr<29376) OR (n.nr>29377 AND n.nr<29385) OR (n.nr>29386
      AND n.nr<29389) OR (n.nr>29393 AND n.nr<29400) OR (n.nr>29405 AND
      n.nr<29408) OR (n.nr>29408 AND n.nr<29412) OR n.nr=29413 OR (n.nr>29414 AND
      n.nr<29417) OR n.nr=29423 OR (n.nr>29424 AND n.nr<29429) OR (n.nr>29429 AND
      n.nr<29433) OR (n.nr>29433 AND n.nr<29439) OR (n.nr>29439 AND n.nr<29443)
      OR n.nr=29444 OR (n.nr>29446 AND n.nr<29455) OR n.nr=29456 OR (n.nr>29457
      AND n.nr<29461) OR n.nr=29463 OR (n.nr>29464 AND n.nr<29467) OR (n.nr>29467
      AND n.nr<29473) OR n.nr=29474 OR n.nr=29476 OR n.nr=29478 OR (n.nr>29479
      AND n.nr<29486) OR (n.nr>29486 AND n.nr<29503) OR (n.nr>29509 AND
      n.nr<29535) OR (n.nr>29535 AND n.nr<29538) OR (n.nr>29538 AND n.nr<29541)
      OR (n.nr>29542 AND n.nr<29548) OR n.nr=29549 OR n.nr=29551 OR (n.nr>29552
      AND n.nr<29555) OR n.nr=29556 OR n.nr=29558 OR (n.nr>29560 AND n.nr<29564)
      OR (n.nr>29564 AND n.nr<29574) OR (n.nr>29574 AND n.nr<29577) OR n.nr=29578
      OR (n.nr>29579 AND n.nr<29582) OR (n.nr>29585 AND n.nr<29589) OR n.nr=29591
      OR n.nr=29593 OR n.nr=29595 OR n.nr=29597 OR n.nr=29605 OR n.nr=29607 OR
      (n.nr>29608 AND n.nr<29612) OR (n.nr>29615 AND n.nr<29623) OR n.nr=29627 OR
      (n.nr>29628 AND n.nr<29633) OR n.nr=29634 OR n.nr=29637 OR n.nr=29643 OR
      n.nr=29653 OR (n.nr>29659 AND n.nr<29664) OR (n.nr>29664 AND n.nr<29670) OR
      (n.nr>29671 AND n.nr<29677) OR n.nr=29679 OR (n.nr>29682 AND n.nr<29686) OR
      (n.nr>29686 AND n.nr<29689) OR (n.nr>29691 AND n.nr<29694) OR (n.nr>29697
      AND n.nr<29702) OR (n.nr>29702 AND n.nr<29705) OR (n.nr>29709 AND
      n.nr<29713) OR n.nr=29714 OR n.nr=29716 OR (n.nr>29736 AND n.nr<29741) OR
      n.nr=29742)Edited by: 808239 on Apr 19, 2011 7:01 AM
    Edited by: 808239 on Apr 19, 2011 7:02 AM

    To add on to what Girish Sharma posted, you can may need more than one temp table and a bit more complex SQL.
    You can improve your parsing time ( 66 seconds is really a lot) by restructuring your statement and using temp tables. I assume that you cannot use PL/SQL - if you can you might be able to get more elegant solution with PL/SQL collections.
    Store all literal values in where clause in temp tables (by temp table I mean a table that is deleted before and after the query– the specific physical implementation is up to you). Use bind variables/bulk load to load the data in the temp tables.
    Select * from temp_1
    val
    2601
    2617
    2623
    6462
    Select * from temp_2
    val1     val2
    2595 2600
    2602 2608
    2634 2637
    Now the query would look like this:
    SELECT n.nr,n.x,n.y,n.z
    FROM
    data2points n WHERE
    n.nr in (select val from temp_1)
    or
    exists
    (select * from temp_2 where n.nr > val1 and where n.nr < val1)

  • Oracle 11g: Oracle insert/update operation is taking more time.

    Hello All,
    In Oracle 11g (Windows 2008 32 bit environment) we are facing following issue.
    1) We are inserting/updating data on some tables (4-5 tables and we are firing query with very high rate).
    2) After sometime (say 15 days with same load) we are feeling that the Oracle operation (insert/update) is taking more time.
    Query1: How to find actually oracle is taking more time in insert/updates operation.
    Query2: How to rectify the problem.
    We are having multithread environment.
    Thanks
    With Regards
    Hemant.

    Liron Amitzi wrote:
    Hi Nicolas,
    Just a short explanation:
    If you have a table with 1 column (let's say a number). The table is empty and you have an index on the column.
    When you insert a row, the value of the column will be inserted to the index. To insert 1 value to an index with 10 values in it will be fast. It will take longer to insert 1 value to an index with 1 million values in it.
    My second example was if I take the same table and let's say I insert 10 rows and delete the previous 10 from the table. I always have 10 rows in the table so the index should be small. But this is not correct. If I insert values 1-10 and then delete 1-10 and insert 11-20, then delete 11-20 and insert 21-30 and so on, because the index is sorted, where 1-10 were stored I'll now have empty spots. Oracle will not fill them up. So the index will become larger and larger as I insert more rows (even though I delete the old ones).
    The solution here is simply revuild the index once in a while.
    Hope it is clear.
    Liron Amitzi
    Senior DBA consultant
    [www.dbsnaps.com]
    [www.orbiumsoftware.com]Hmmm, index space not reused ? Index rebuild once a while ? That was what I understood from your previous post, but nothing is less sure.
    This is a misconception of how indexes are working.
    I would suggest the reading of the following interasting doc, they are a lot of nice examples (including index space reuse) to understand, and in conclusion :
    http://richardfoote.files.wordpress.com/2007/12/index-internals-rebuilding-the-truth.pdf
    "+Index Rebuild Summary+
    +•*The vast majority of indexes do not require rebuilding*+
    +•Oracle B-tree indexes can become “unbalanced” and need to be rebuilt is a myth+
    +•*Deleted space in an index is “deadwood” and over time requires the index to be rebuilt is a myth*+
    +•If an index reaches “x” number of levels, it becomes inefficient and requires the index to be rebuilt is a myth+
    +•If an index has a poor clustering factor, the index needs to be rebuilt is a myth+
    +•To improve performance, indexes need to be regularly rebuilt is a myth+"
    Good reading,
    Nicolas.

  • Oracle 11G - Oracle AWR query execution time in report

    I have used AWR tool of oracle 11G. I have exported query historical statistics of production databaser using awrextr.sql and then load the exported dump file using awrload.sql script.
    Then i used awrrpti.sql and awrsqrpi.sql for generating report of sql queries. Every thing is working fine and generated reports are also very helpful, but report does not show the exact time when the query was executed. How can i get the actual time when the query was executed ?
    any help please ?

    If you would have consulted the Oracle Reference Manual to get the view descriptions, you should have your question is a rhetorical one with the answer NO.
    This is because every statement can be executed one or more times, and Oracle would need to keep track of all individual executions.
    I do agree most 'applications' do not use bind variables, and consequently only have unique statements, but Oracle didn't take that into account, and rightly so.
    Sybrand Bakker
    Senior Oracle DBA

  • Oracle 11G + Database Connection taking too much Time

    Hi ,
    I am using Oracle 11G . When i try to connect to oracle database
    sqlplus system/impetus@database
    it takes too much time ( more than 1 min )
    I am not getting why this is happening ?
    Before some day it was working fine but suddenly the problem occurred.. Is this issue is related to log files generated by oracle or memory related issue ( sga and pga)..
    Any Help please ?

    Darn! /tmp/capture.log does not contain what I expected it to contain.
    So a different approach is needed.
    issue the following command:
    script /tmp/capture.log
    #now you are in a new shell & issue the next 3 lines
    strace sqlplus system/impetus@database
    exit
    Ctrl-d (Control D)
    now issue the following commands.
    ls -l /tmp/capture.log
    wc -l /tmp/capture.log
    Post the results from 2 commands above back here

  • Time Series in Oracle 11g

    Oracle 8i hase Time series for defining calendars and other functions. How does Oracle 10g/11g support Time series features. I could not find any information about Time Series in the 10g/11g documentation.

    Thanks a lot for the responses.
    I looked at the 11g Pivot operator and is altogether a new feature compared to the Time series of 8i.
    I would like to explain with an example.
    1) The following query creates a table named stockdemo_calendars and defines a calendar
    named BusinessDays. The BusinessDays calendar includes Mondays through Fridays,
    but excludes 28-Nov-1996 and 25-Dec-1996. Explanatory notes follow the example.
    CREATE TABLE stockdemo_calendars of ORDSYS.ORDTCalendar (
    name CONSTRAINT calkey PRIMARY KEY);
    INSERT INTO stockdemo_calendars VALUES(
    ORDSYS.ORDTCalendar(
    0
    ’BusinessDays’,
    4,
    ORDSYS.ORDTPattern(
    ORDSYS.ORDTPatternBits(0,1,1,1,1,1,0),
    TO_DATE(’01-JAN-1995’,’DD-MON-YYYY’)),
    TO_DATE(’01-JAN-1990’,’DD-MON-YYYY’),
    TO_DATE(’01-JAN-2001’,’DD-MON-YYYY’),
    ORDSYS.ORDTExceptions(TO_DATE(’28-NOV-1996’,’DD-MON-YYYY’),
    TO_DATE(’25-DEC-1996’,’DD-MON-YYYY’)),
    ORDSYS.ORDTExceptions()
    -------------- How can I create such calendars in 11g?
    2) For example, the following statement returns the last closing prices for stock
    SAMCO for the months of October, November, and December of 1996:
    select * from the
    (select cast(ORDSYS.TimeSeries.ExtractTable(
    ORDSYS.TimeSeries.ScaleupLast(
    ts.close,
    sc.calendar,
    to_date(’01-OCT-1996’,’DD-MON-YYYY’),
    to_date(’01-JAN-1997’,’DD-MON-YYYY’)
    ) as ORDSYS.ORDTNumTab)
    from tsdev.stockdemo_ts ts, tsdev.scale sc
    where ts.ticker=’SAMCO’ and
    sc.name =’MONTHLY’);
    This example might produce the following output:
    TSTAMP VALUE
    01-OCT-96 42.375
    01-NOV-96 38.25
    01-DEC-96 39.75
    3 rows selected.
    --------------------- How can I get the above ouput without Time series functions and calendars in Oracle 11g?

  • Tns time out windows client , server on linux oracle 11g R1

    I have Windows 7 as the host machine and Oracle 11g R1 client installed on it.
    I installed VMWare V5.5 (downloaded from oracle site) and then installed Linux on it as guest OS. I have Oracle database 11g R1 intalled on Linux.
    I can ping the Linux server from Windows.
    I can also ftp to the Linux server from windows and get the files locally on Windows OS.
    The listener and tns files are configured correctly (i assume) on both Linux and Windows.
    Listener.ora on Linux
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME =CLRExtProc)
    (ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_2)
    (PROGRAM = extproc)
    (SID_DESC=
    (GLOBAL_DBNAME=orcl)
    (ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_2)
    (SID_NAME=orcl)
    SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.159.132)(PORT = 1521)) ) )
    Tnsnames.ora on linux
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.159.132)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    Sqlnet.ora on Linux
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    SQLNET.INBOUND_CONNECT_TIMEOUT = 300
    SQLNET.SEND_TIMEOUT = 300
    SQLNET.RECV_TIMEOUT = 300
    Windows files
    Tnsnames.ora on Windows
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.159.132 )(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl) )
    Sqlnet.ora on Windows
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    SQLNET.INBOUND_CONNECT_TIMEOUT = 300
    SQLNET.SEND_TIMEOUT = 300
    SQLNET.RECV_TIMEOUT = 300
    The error on windows
    ping results on windows
    C:\Users\sri>ping 192.168.159.132
    Pinging 192.168.159.132 with 32 bytes of data:
    Reply from 192.168.159.132: bytes=32 time<1ms TTL=64
    Reply from 192.168.159.132: bytes=32 time<1ms TTL=64
    Reply from 192.168.159.132: bytes=32 time<1ms TTL=64
    Reply from 192.168.159.132: bytes=32 time<1ms TTL=64
    Ping statistics for 192.168.159.132:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
    C:\Users\sri>tnsping orcl
    TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 23-JUL-2010 19:55:56
    Copyright (c) 1997, 2010, Oracle. All rights reserved.
    Used parameter files:
    C:\or11g\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
    **Used TNSNAMES adapter to resolve the alias**
    **Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.159.132)(PORT = 1**
    **521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))**
    **TNS-12535: TNS:operation timed out**

    # sqlnet.ora Network Configuration File: C:\or11g\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.
    # This file is actually generated by netca. But if customers choose to
    # install "Software Only", this file wont exist and without the native
    # authentication, they will not be able to connect to the database on NT.
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    SQLNET.INBOUND_CONNECT_TIMEOUT = 300
    SQLNET.SEND_TIMEOUT = 300
    SQLNET.RECV_TIMEOUT = 300

  • When Oracle 11g new features 1z0-050 exam changed last time ??

    Hi everyone,
    Can anybody tell me that when the last time Oracle 11g new features 1z0-050 exam changed?? Does it changed recently, or its going to be change in near future??
    Thanks and Regards,
    Khurram

    bigdelboy wrote:
    Khurram Bhatti wrote:
    Hi everyone,
    Can anybody tell me that when the last time Oracle 11g new features 1z0-050 exam changed?? Does it changed recently, or its going to be change in near future??
    Thanks and Regards,
    Khurram1) Possible topic changes between beta and production.
    2) When reviewed for 11gR2 rather than 11gR1 ... it is possible, but unlikely, there could have been minor topic changes.
    3) IMHO It is unlikely this exam will have further topic changes from those currently shown on the exam page.
    ( Please note one other exam (117) has possibly recently had issues with not display all topics) ).
    Suggest you give more reasons for your question before I will spend any time investigating further, i am pressed for time at the moment.Hi bigdelboy,
    Thanks for quick reply. I am going to appear in this exam at this weekend. What basically I wanna ask is that the questions of this exam will be same as when one of my friends appeared 2 months ago?? , or the whole paper/questions could be changed this time ?? I know that the questions came randomly from a set of pool. So is there any possibility that the Oracle has been changed the whole set of pool of questions recently?

  • Xpath difference between Oracle 10g and Oracle 11g

    All,
    I'm working on moving our existing stored functions from Oracle 10g (10.2.0.4.0) to Oracle 11g (11.2.0.1.0) and so far, everything has worked just fine on Oracle 11g...execpt for one xpath statement.
    The statement below works fine in Oracle 10g (10.2.0.4.0):
    extractValue(inv_dtl_img, '/service//ground/sortKeyCode') AS "srt_key_cd",
    Please note: I need to use the double slash "//" in order to ignore the two different elements in the schema.
    However, in Oracle 11g (11.2.0.1.0), when this statement is executed in the stored function, I get this:
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected - got -
    The extractValue command is pulling data out of an XMLType column, and the corresponding XML schema looks like:
    <service>
    <trans>
    <ground>
    <sortKeyCode>
    </sortKeyCode>
    </ground>
    </trans>
    <nontrans>
    <ground minOccurs=0>
    <sortKeyCode>
    </sortKeyCode>
    </ground>
    </nontrans>
    </service>
    Please note: In the XML message, the "trans" and "nontrans" elements are exclusive, so both will never be populated at the same time. A typical XML message would look like this:
    <service><trans><ground><sortKeyCode>3</sortKeyCode></ground></trans></service>
    or this:
    <service><nontrans><ground><sortKeyCode>5</sortKeyCode></ground></nontrans></service>
    In the schema, the sortKeyCode has been defined in both places as "string maxlen=3", so the datatype of that element is exactly the same in both the "trans" and "nontrans" sections of the schema. The only difference in the schema (outside of the trans and nontrans tags) is the fact that the second "ground" tag is defined with a "minOccurs=0". Could Oracle 11g be treating the schema differently than Oracle 10g, resulting in the error?
    Any thoughts would be appreciated.

    The only way to get an quick answer to that one is to file a service request with Oracle support. It could be a bug or a correct change regarding W3C behavior. Despite this, you moving to 11.2, the extract/extractvalue etc propriety Oracle solutions are deprecated from 11.2 and onwards. The more sensible way to move forward, although, I know more work intensive, is to apply the XQuery alternatives like xmlexist, xquery or xmltable functions.
    Moving to EXTRACT is a bad idea, because this alway will be treated as an XML fragment. If you unlucky then Oracle will deal with this in memory via DOM (the standard solution regarding XML parsing if every smart thing within Oracle can not be applied) and this will result in a performance downgrade due to high CPU and Memory consumption/overhead...
    Your pick...

  • "Rows" statistics from STAT in trace event 10046, Oracle 11g.

    Hi, all!
    Why "Rows" statistics in STAT are different for 10g and 11g?
    I have two database with version 10g and 11g, with the same data.
    I executed some pl/sql code with tracing 10046 level 8.
    And I have different result when obtain raw trace.
    In 10g I obtain rows statistics for all executions - Rows= 7.
    In 11g I obtain rows statistics for first executions - Rows= 1. Why?
    See my example:
    declare
         type t_name_tbl is table of varchar2(30) index by binary_integer;
         v_name_tbl t_name_tbl;
         v_len      number := 10;
    begin
         execute immediate 'alter session set timed_statistics = true ';
         execute immediate 'alter session set statistics_level=all ';
         execute immediate 'alter session set max_dump_file_size = unlimited ';
         execute immediate 'alter session set events ''10046 trace name context forever,level 8'' ';
         loop
           select cour_name bulk collect
                into v_name_tbl
               from country t
              where length(t.cour_name) = v_len;
           exit when v_len = 0;
           v_len := v_len - 1;
           for i in 1 .. v_name_tbl.count loop
             dbms_output.put_line(v_name_tbl(i));
           end loop;
         end loop;
    end;Result Tkprof for Oracle 10g:
    SELECT COUR_NAME
    FROM
    COUNTRY T WHERE LENGTH(T.COUR_NAME) = :B1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute     11      0.00       0.00          0          0          0           0
    Fetch       11      0.01       0.00          0         44          0           7
    total       23      0.01       0.00          0         44          0           7
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 649     (recursive depth: 1)
    Rows     Row Source Operation
          7  TABLE ACCESS FULL COUNTRY (cr=44 pr=0 pw=0 time=1576 us)Result Tkprof for Oracle 11g:
    SQL ID: 3kqmkg8jp5nwk
    Plan Hash: 1371235632
    SELECT COUR_NAME
    FROM
    COUNTRY T WHERE LENGTH(T.COUR_NAME) = :B1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute     11      0.02       0.01          0          0          0           0
    Fetch       11      0.00       0.01          3         44          0           7
    total       23      0.03       0.02          3         44          0           7
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 82     (recursive depth: 1)
    Rows     Row Source Operation
          1  TABLE ACCESS FULL COUNTRY (cr=4 pr=3 pw=0 time=0 us cost=2 size=44 card=2)Were can I read about it?

    Oracle 11g by default writes the execution plan (the STAT lines in the raw trace file) after the first execution of the SQL statement, while prior to 11g the execution plan is written only when the cursor is closed.
    The behavior in 11g can be controlled by changing the PLAN_STAT parameter of the call that enables the trace from the default value of FIRST_EXECUTION to ALL_EXECUTIONS:
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_sessio.htm#i1010518
    Charles Hooper
    Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.
    Edited by: Charles Hooper on Aug 9, 2010 3:33 PM
    Default value on 11g is FIRST_EXECUTION, while the behavior prior to 11g is ALL_EXECUTIONS - corrected the incomplete sentence.

  • Oracle 11g R2 hangs after parameter processes incresed

    Hi,
    I am running an Oracle 11g R2 on a Solaris box. I was getting some Critical alert messages about the "Process Limit %" metric. So I decided to increase the value of the processes database parameter from 200 to 400. After that the system is very slow and hanging with a lot of "Log file sync" and "log file parallel write" events.
    I have rolled it back to 200 and now the system is working fine again, but I am concern about getting again the alert about the "process limit %".
    Is there any other parameter that I need to tune together with the increase of the proccesses on?
    Regards,

    It looks like the issue is not related with the processes change.
    If I reboot then db and then restart the process it runs fine. Something happens during on the db during the day that make the nightly schedule task takes forever. When I checked it this morming there were a lot of commit activity. If I cancel the process and then try to restart it again without rebooting the db the problem persist. But if I bounce the database and then run it, it will complete fine.
    Below is AWR periord comparisson report. The first period is when I cancelled the process and then tried to run it again. The second one is after the database reboot.
    I appreciate any advice.
    Snapshot Set DB Name DB Id Instance Inst num Release Cluster Host Std Block Size
    First (1st) DMFEPRD 3155815743 dmfeprd 1 11.2.0.1.0 NO uscndb18 8192
    Second (2nd) DMFEPRD 3155815743 dmfeprd 1 11.2.0.1.0 NO uscndb18 8192
    Snapshot Set Begin Snap Id Begin Snap Time End Snap Id End Snap Time Avg Active Users Elapsed Time (min) DB time (min)
    1st 2700 25-Jun-11 12:17:51 (Sat) 2701 25-Jun-11 12:23:40 (Sat) 2.69 5.82 15.65
    2nd 2702 25-Jun-11 12:47:17 (Sat) 2703 25-Jun-11 12:52:52 (Sat) 2.40 5.58 13.39
    %Diff -10.78 -4.12 -14.44
    Host Configuration Comparison
    1st 2nd Diff %Diff
    Number of CPUs: 32 32 0 0.0
    Number of CPU Cores: 4 4 0 0.0
    Number of CPU Sockets: 1 1 0 0.0
    Physical Memory: 65408M 65408M 0M 0.0
    Load at Start Snapshot: 6.14 2.03 -4.12 -66.9
    Load at End Snapshot: 6.95 4.67 -2.28 -32.8
    %User Time: 13.43 13.04 -.38 -2.9
    %System Time: 6.95 1.26 -5.69 -81.9
    %Idle Time: 79.62 85.7 6.07 7.6
    %IO Wait Time: 0 0 0 0.0
    Cache Sizes
    1st (M) 2nd (M) Diff (M) %Diff
    Memory Target 10,240.0 10,240.0 0.0 0.0
    .....SGA Target 6,656.0 6,656.0 0.0 0.0
    ..........Buffer Cache 672.0 672.0 0.0 0.0
    ..........Shared Pool 1,472.0 1,472.0 0.0 0.0
    ..........Large Pool 64.0 64.0 0.0 0.0
    ..........Java Pool 224.0 224.0 0.0 0.0
    ..........Streams Pool 64.0 64.0 0.0 0.0
    .....PGA Target 3,584.0 3,584.0 0.0 0.0
    Log Buffer 18.6 18.6 0.0 0.0
    Load Profile
    1st per sec 2nd per sec %Diff 1st per txn 2nd per txn %Diff
    DB time: 2.69 2.40 -10.78 0.96 0.14 -85.42
    CPU time: 0.90 2.13 136.67 0.32 0.12 -62.50
    Redo size: 28,238.40 149,564.99 429.65 10,057.71 8,577.01 -14.72
    Logical reads: 8,840.64 21,941.38 148.19 3,148.78 1,258.26 -60.04
    Block changes: 176.06 1,032.02 486.18 62.71 59.18 -5.63
    Physical reads: 1.82 37.36 1,952.75 0.65 2.14 229.23
    Physical writes: 6.69 25.16 276.08 2.38 1.44 -39.50
    User calls: 118.44 318.49 168.90 42.19 18.26 -56.72
    Parses: 91.31 492.38 439.24 32.52 28.24 -13.16
    Hard parses: 4.73 31.89 574.21 1.68 1.83 8.93
    W/A MB processed: 908,952.26 4,708,929.40 418.06 323,742.82 270,039.92 418.06
    Logons: 18.65 41.19 120.86 6.64 2.36 -64.46
    Executes: 109.63 584.01 432.71 39.05 33.49 -14.24
    Transactions: 2.81 17.44 520.64
    1st 2nd Diff
    % Blocks changed per Read: 1.99 4.70 2.71
    Recursive Call %: 84.16 92.70 8.53
    Rollback per transaction %: 0.00 0.00 0.00
    Rows per Sort: 1,620.17 1,194.14 -426.02
    Avg DB time per Call (sec): 0.02 0.01 -0.02

  • Oracle 11g Performance Issue

    We have Oracle 11g (11.1.0.6) on HP-UX environment with CC&B application. It was working fine and after we upgrade the database to 11.1.0.7 last week, since then the database performance is really slow. After we upgrade the database we notice that xdb component became invalid.
    We are not sure how to investigate this issue, any help would be appreciated.

    WORKLOAD REPOSITORY report for
    DB Name         DB Id    Instance     Inst Num Startup Time    Release     RAC
    CCBPROD       3218377102 ccbprod             1 10-Jan-12 20:26 11.1.0.7.0  NO
    Host Name        Platform                         CPUs Cores Sockets Memory(GB)
    huccbhp5         HP-UX IA (64-bit)                   4     4       2      23.97
                  Snap Id      Snap Time      Sessions Curs/Sess
    Begin Snap:     43912 11-Jan-12 10:00:31       157      96.1
      End Snap:     43913 11-Jan-12 11:00:35       186     101.3
       Elapsed:               60.08 (mins)
       DB Time:              653.40 (mins)
    Cache Sizes                       Begin        End
    ~~~~~~~~~~~                  ---------- ----------
                   Buffer Cache:    12,160M    12,096M  Std Block Size:         8K
               Shared Pool Size:       704M       704M      Log Buffer:    58,764K
    Load Profile              Per Second    Per Transaction   Per Exec   Per Call
    ~~~~~~~~~~~~         ---------------    --------------- ---------- ----------
          DB Time(s):               10.9                0.5       0.02       0.02
           DB CPU(s):                3.6                0.2       0.01       0.01
           Redo size:          529,539.6           24,544.1
       Logical reads:          155,545.5            7,209.5
       Block changes:            2,047.0               94.9
      Physical reads:              204.6                9.5
    Physical writes:               96.0                4.5
          User calls:              698.7               32.4
              Parses:               77.8                3.6
         Hard parses:                0.1                0.0
    W/A MB processed:          406,873.3           18,858.5
              Logons:                0.4                0.0
            Executes:              456.1               21.1
           Rollbacks:               19.6                0.9
        Transactions:               21.6
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Buffer Nowait %:  100.00       Redo NoWait %:   99.97
                Buffer  Hit   %:   99.87    In-memory Sort %:  100.00
                Library Hit   %:   99.93        Soft Parse %:   99.89
             Execute to Parse %:   82.95         Latch Hit %:   99.99
    Parse CPU to Parse Elapsd %:    0.01     % Non-Parse CPU:   99.93
    Shared Pool Statistics        Begin    End
                 Memory Usage %:   89.78   90.02
        % SQL with executions>1:   86.04   84.87
      % Memory for SQL w/exec>1:   86.22   86.03
    Top 5 Timed Foreground Events
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                               Avg
                                                              wait   % DB
    Event                                 Waits     Time(s)   (ms)   time Wait Class
    virtual circuit wait              2,170,696      15,761      7   40.2 Network
    DB CPU                                           13,115          33.5
    db file sequential read             362,802       6,304     17   16.1 User I/O
    enq: TX - row lock contention           115       1,118   9721    2.9 Applicatio
    log file sync                         8,183         818    100    2.1 Commit
    Host CPU (CPUs:    4 Cores:    4 Sockets:    2)
    ~~~~~~~~         Load Average
                   Begin       End     %User   %System      %WIO     %Idle
                    3.28      3.93      93.1       2.3       2.8       4.6
    Instance CPU
    ~~~~~~~~~~~~
                  % of total CPU for Instance:  91.1
                  % of busy  CPU for Instance:  95.4
      %DB time waiting for CPU - Resource Mgr:   0.0
    Memory Statistics
    ~~~~~~~~~~~~~~~~~                       Begin          End
                      Host Mem (MB):     24,545.7     24,545.7
                       SGA use (MB):     13,312.0     13,312.0
                       PGA use (MB):        935.9        949.3
        % Host Mem used for SGA+PGA:        58.05        58.05

  • Benefits of context in Oracle 11g

    I spent a lot of time doing R&D on benefits of context but was somehow was not able to really understand the benefit of context in Oracle 11g. I would try to explain with an example, I have seen an example of database session-based application context where an ‘after logon database’ was using a context to raise_application_error if the user logged in was not in the employees table. I was wondering that the same thing can be implemented without the context to raise_application_error if the user logged in was not authorized.
    I hope I have been able to explain my question properly about the exact benefits of contexts,
    Please revert with the reply to my query.
    Regards

    I have seen an example of database session-based application context where an ‘after logon database’ was using a context to raise_application_error if the user logged in was not in the employees table.
    Great! Post a link to what you 'saw' so we can see it to and get the FULL CONTEXT of what it ws doing and how it was doing it.
    I was wondering that the same thing can be implemented without the context to raise_application_error if the user logged in was not authorized.
    We have no way of knowing until we know WHAT the code you 'have seen' was doing and HOW it was doing it.
    Maybe the same thing can be done without using contexts. But most examples are just that: examples. They try to show you the MINIMUM that must be done to illustrate what the functionality can do.
    They often do NOT illustrate or discuss in detail WHEN to use contexts or WHAT problems contexts are most suited for.
    First - we need to know WHAT contexts are. For that the Oracle docs can be used:
    http://docs.oracle.com/cd/B28359_01/network.111/b28531/app_context.htm
    What Is an Application Context?
    An application context is a set of name-value pairs that Oracle Database stores in memory. The application context has a label called a namespace, for example, empno_ctx for an application context that retrieves employee IDs. Inside the context are the name-value pairs (an associative array): the name points to a location in memory that holds the value. An application can use the application context to access session information about a user, such as the user ID or other user-specific information, or a client ID, and then securely pass this data to the database. You can then use this information to either permit or prevent the user from accessing data through the application. You can use application contexts to authenticate both database and nondatabase users.
    Note that the ONLY possible uses mentioned are authentication related - so more info is needed that just that intro.
    Think of an application context as a global variable that holds information that is accessed during a database session
    More info - global variables - available ANYTIME during a session. Note in particular it says NOTHING about any packages/functions/procedures being needed. Hmm - maybe we can use those 'global variables' in SQL queries?
    But you ask about benefits - the doc has a section for that:
    Benefits of Using Application Contexts
    Most applications contain the kind of information that can be used for application contexts. For example, in an order entry application that uses a table containing the columns ORDER_NUMBER and CUSTOMER_NUMBER, you can use the values in these columns as security attributes to restrict access by a customer to his or her own orders, based on the ID of that customer.
    Application contexts are useful for the following purposes:
      Enforcing fine-grained access control, for example, in Oracle Virtual Private Database polices
      Preserving user identity across multitier environments
      Enforcing stronger security for your applications, because the application context is controlled by a trusted procedure, not the user
      Increasing performance by serving as a secure data cache for attributes needed by an application for fine-grained auditing or for use in PL/SQL conditional statements or loops
    This cache saves the repeated overhead of querying the database each time these attributes are needed. Because the application context stores session data in cache rather than forcing your applications to retrieve this data repeatedly from a table, it greatly improves the performance of your applications.
      Serving as a holding area for name-value pairs that an application can define, modify, and access
    There are some benefits like you ask about
      Global application contexts.This type retrieves data that is stored in the System Global Area (SGA) so that it can be used for applications that use a sessionless model, such as middle-tier applications in a three-tiered architecture. A global application context is useful if the session context must be shared across sessions, for example, through connection pool implementations.
    "Using Global Application Contexts" describes this type.
    Interesting! This means you can truly have GLOBAL variables that are accesible by ALL USERS ACROSS SESSIONS.
    How would you do that using other functionality?
    The doc goes on to give other examples of 'benefits:
    This section contains:
      About the Package That Manages the Database Session-Based Application Context
      Using SYS_CONTEXT to Retrieve Session Information
      Using Dynamic SQL with SYS_CONTEXT
      Using SYS_CONTEXT in a Parallel Query
      Using SYS_CONTEXT with Database Links
      Using DBMS_SESSION.SET_CONTEXT to Set Session Information
    What about that SYS_CONTEXT function? That is in the Sql Language Doc
    http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions184.htm
    Purpose
    SYS_CONTEXT returns the value of parameter associated with the context namespace at the current instant. You can use this function in both SQL and PL/SQL statements. SYS_CONTEXT must be executed locally.
    For namespace and parameter, you can specify either a string or an expression that resolves to a string designating a namespace or an attribute. If you specify literal arguments for namespace and parameter, and you are using SYS_CONTEXT explicitly in a SQL statement—rather than in a PL/SQL function that in turn is in mentioned in a SQL statement—then Oracle Database evaluates SYS_CONTEXT only once per SQL statement execution for each call site that invokes the SYS_CONTEXT function.
    More benefits - contexts and the function can be used in 'both SQL and PL/SQL statements'. And because a SQL statement in PL/SQL that uses SYS_CONTEXT can be parsed at compile time that means that contexts are essentially treated as BIND variables and can dramatically improve performance in PL/SQL code of both standard SQL statements and DYNAMIC sql statements.

  • Newbie question about Oracle 11G performance

    I have a situation where a newer better faster server running Oracle 11gR1 is running considerably slower than an older slower server running Oracle 10gR2.
    Both of these servers have the same web applications and same dumpfiles loaded into them.
    I personally installed the Oracle 11g on the new server, however, I didn't install the 10gR2 on the older server, some one else did...
    I have checked what I think are the basics: the tables are not missing constraints, the automatic memory management is enabled.
    I know this is a really broad question.
    Newer server:
    Quad-Core AMD Opteron Processor 2352 2.10 GHz (2 processors)
    16 GB memory
    Windows Server 2008, 64 bit
    Raid 5
    Older Server:
    Intel Xeon 1.8 GHz (2 processors)
    4 GB memory
    Windows Server 2003, 32 bit
    Raid 5

    Hi Derik,
    I know this is a really broad question. No, it happens all the time! Here is a similar issue:
    http://blog.tuningknife.com/2008/09/26/oracle-11g-performance-issue/
    +"In the end, nothing I tried could dissuade 11g from emitting the “PARSING IN CURSOR #d+” message for each insert statement. I filed a service request with Oracle Support on this issue and they ultimately referred the issue to development as a bug. Note that Support couldn’t reproduce the slowness I was seeing, but their trace files did reflect the parsing messages I observed."+
    I would:
    1 - Start by examining historical SQL execution plans (stats$sql_plan or dba_hist_sql_plan). Try to isolate the exact nature of the decreased performance.
    Are different indexes being used? Are you geting more full-table scans?
    2 - Migrate-in your old 10g CBO statistics
    3 - Confirm that all init.ora parms are identical
    4 - Drill into each SQL with a different execution plan . . .
    Raid 5 Don't believe that crap that all RAID-5 is evil. . . .
    http://www.dba-oracle.com/t_raid5_acceptable_oracle.htm
    But at the same time, consider using the Oracle standard, RAID-10 . . .
    Hope this helps . . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference"
    http://www.rampant-books.com/t_oracle_tuning_book.htm
    "Time flies like an arrow; Fruit flies like a banana".

  • Migrating from MySQL to Oracle 11g

    can u tell me the steps to migrating database from MySQL to Oracle using SQL Developer?
    I have installed Oracle 11g(11.1.0.6.0) in server and SQl Developer in my local system.
    I connected to MySQL and Oracle in SQL Developer and tried to MIgrate everything in MySQL to Oracle using Quick Migrate option.
    it took one and half day but didn't work at last...
    is there any pre tasks that i need to do before migrating to oracle from MySQL?
    and also when i export the MySQL data to Oracle using SQL Developer,it is giving data type mismatch errors like (date, boolean etc...).
    please give a reply what i need to do and any refferences also very much appreciated.

    hi Turloch ,
    I followed the steps mentioned above.
    When I right click my MySQL server db Connection and click "Capture MySQL server", it just shows a dialog with "Close" enabled.
    after clicking the close button, it gives following error messages.
    oracle.dbtools.metadata.persistence.PersistableObject.doInsert(PersistableObject.java:238)
    the same error is coming no of times.
    Kindly help me in this regard.

Maybe you are looking for