Oracle 10G gives in sorted order without order by ,in 11g it is not.

we are facing a strange problem.
we have M Views on which we perform select operation ,we put joins of M Views and get the results by select operation , the results was in sorted order (asc) and we were not using any order by clause in the select query , this was in oracle 10G.
The compelte schema where these M views are and also the underneath tables are now migrated to oracle 11g using import/export option.
Now the queries which was giving the result set in sorted order (asc), are not given the result set in sorted order anymore. it is in different order but I think at always return the same order not asc or desc but an specific random order .
we can not change the query as of now as there are 1000+ and each query would require a order by statement .
Do we have any parameters which can be change , so that we can force oracle to use a different plan so that it gives result in order ?
the select queries are very simple ones not complicated no extra function or group by is used in most of the queries.
Please suggest possible solutions . Thanks much.

Su**** wrote:
Please guide me how to go to this doc link ,i am newbi, and do not how to go to this link.
MOS Doc 345048.1 ('Group By' Does Not Guarantee a Sort Without Order By Clause In 10g and Above)
Go to http://support.oracle.com, log in to My Oracle Support, and search for 345048.1 If you don't have a My Oracle Support account, you'll need to contact whoever manages your company's Oracle support and ask them to create an account for you.
Basically, no version of Oracle has ever guaranteed the order of results if you don't specify an ORDER BY clause. In 10g, the only algorithm that was available to implement a GROUP BY happened to sort the results as a side effect. 11g introduced a new algorithm for grouping results that is more efficient and does not have the side effect of ordering the results. Most likely, your query plans have changed to use the more efficient grouping algorithm.
If you want the results to be sorted, you should add an appropriate ORDER BY clause. If you go through the MOS document, there will also be suggestions for ways that you can disable the new grouping algorithm though I would not recommend that.
Justin

Similar Messages

  • Oracle 10g group by sorting

    Hello friends
    Pls refere to my previous thread where we have discussed on sorting oprtion of Adding order by whereever group by is applicable
    ORACLE 10G group by sorting Suggestion rqd
    Read?
    Then come to my point
    if there is multiple columns for the group by then if we want to include order by clause, same number of columns has to be included in the order by also.
    i dont think it is so
    example'
    SELECT SUM(QTY1),SUM(QTY2), PARTNO, PART_DESC
    from part_sen
    group by partno, part_desc
    order by partno, part_desc
    qty1 qty2 partno partdesc
    70     101     I001     BRAKE SHOE
    56     54     I002     HORN
    30     30     I003     GEAR
    15     5     I004     DOOR
    5     5     I007     MOTOR GEAR
    10     15     I008     ANCILLARY
    10     15     I009     Window
    so in order by clause we can include only the first column.. that is partno
    SELECT SUM(QTY1),SUM(QTY2), PARTNO, PART_DESC
    from part_sen
    group by partno, part_desc
    order by partno
    Same result i get.
    Pls give your suggestion
    s

    ALex,
    SELECT SUM(QTY1),SUM(QTY2), PARTNO, PART_DESC
    from part_sen
    group by partno, part_desc
    70     101     I001     BRAKE SHOE
    56     54     I002     HORN
    30     30     I003     GEAR
    15     5     I004     DOOR
    5     5     I007     MOTOR GEAR
    10     15     I008     ZLLADER
    10     15     I008     OCTLADER
    10     15     I008     ANCILLARY
    10     15     I008     BALLLADER
    10     15     I009     Window
    SELECT SUM(QTY1),SUM(QTY2), PARTNO, PART_DESC
    from part_sen
    group by partno, part_desc
    order by partno
    70     101     I001     BRAKE SHOE
    56     54     I002     HORN
    30     30     I003     GEAR
    15     5     I004     DOOR
    5     5     I007     MOTOR GEAR
    10     15     I008     ANCILLARY
    10     15     I008     BALLLADER
    10     15     I008     OCTLADER
    10     15     I008     ZLLADER
    without ordering the second column part_desc it is properly ordered how?
    so adding order by partno is same as order by partno,part_desc
    Pls reply
    S

  • I have installed oracle 10g in my winxp machine. i am using enterprise manager. i am not able to shutdown the system as it asks for os username and password. i have provided my os username and password but eerror persiste. somebody pls help me to get rid

    I have installed oracle 10g in my winxp machine. i am using enterprise manager. i am not able to shutdown the system as it asks for os username and password. i have provided my os username and password but eerror persiste. somebody pls help me to get rid of this.

    Here I am using Java Type IV for database
    connection.
    So,there was no necessity of creating DNS.How your app communicates with db shouldn't matter for the end user. Still, you may want to use a functional network name also for the thin client driver connection string.
    So,is there any other way to solve this problem.What is the problem really? Do you not use dns for network naming? Maybe you have to manage the hosts file on every client then.

  • ORACLE 10G group by sorting Suggestion rqd

    Hai friends,
    recently we migrated from Oracle 9i to oracle 10g. We are instructed that Group by will not sort the records in Oracle 10g, so we are asked to add Order By Clause in wherever applicable in the package.
    But after migration i inserted 100 records in 10g database and tested. I am getting correct sorting of records based on Group by column. Can any one explain me why it is? I heard the news sorting will difer on Oracle 10g versions. I am using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0. if it automaticallly sorts, then no need to change the package for sortiing right?
    Give me your valuable suggestions..
    S

    And here's a simple example on 10.2.0.4 that clearly shows the results are not sorted.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    SQL> select object_type, count(*) from all_objects group by object_type;
    OBJECT_TYPE                     COUNT(*)
    CONSUMER GROUP                         2
    INDEX PARTITION                      718
    TABLE SUBPARTITION                    14
    SEQUENCE                             228
    SCHEDULE                               1
    TABLE PARTITION                      301
    PROCEDURE                             21
    ...Like everyone else has already said, Oracle does not guarantee the order from a group by clause with no order by.
    If you need the results in order you must use an order by clause.
    Pretty simple really.

  • Install oracle 10g on solaris 9 platform without setting noexec_user_stack

    Hi,
    I'd like install oracle 10g software on solaris 2.9 platform without setting noexec_user_stack parameter to 1.
    The problem is that i need install software before, for migrating product environment.
    I can write /etc/system file but i can't reboot system until several days.
    I will not start migration process until i reboot the system and parameter definitely set.
    Do you know if we will can have any kind of problem???
    Thanks in advance.

    Thanks for your answer FZheng. But i will just install software. I will not start any oracle 10g process until i reboot the machine.
    I think that oracle software installacion should not be affected. Do you know if this parameter affect to compile softwere during OUI wizard progress???.
    Before going on migration process and start database i will sure that this parameter is correctly fixed.
    PD.: I couldn't read metalink reference that you've suggested becouse my metalink account have problem access in this momment. During all day i've been reeding metalinks docs without any problem until this momment, bad luck.
    In test environment i've installed oracle without this parameter and i've never had any problem. But this installation is more important than others becouse i ask you in this specialist forum.
    Thanks again !!!

  • List of sales order without order bom fix

    dear sir
    we are using variant configuration with result oriented order bom fix in cu51/cu52
    we want the list of sales orders for which order bom is not created using cu51/cu52 fixing
    can any body tell me where this information is available?
    thanking you
    srinivas pai

    Dear Nau,
    VA05 for list of sales orders and put Document date in Sales Order Data
    COIO Process order information System
    Regards,
    Rakesh
    Pls award points if you find the solution

  • Oracle Text in installing Oracle 10g without licence!!

    Hi. Everyone.
    I've read some thread , but I am still confused about "oracle text".
    Now, I am testing oracle10g database.
    I downloaded 10g software from www.oracle.com, and installed it sucessfully
    on windows xp.
    When I was trying to import a dump file from oracle9i to
    the unlicenced oracle10g database, I got the error , IMP-00017, which
    is related to "Oracle Text".
    I checked "dba_users" dictionary, but ctxsys user is locked and expired.
    I read some thread on this site, and according to the advice, I tried to
    enable oracle text, using "DBCA".
    However, every database option on DBCA is disabled, I was not able to
    check oracle text.
    Lastly, how can I enable "Oracle Text" with unlicenced oracle 10g ?
    Is this possible without licence?
    I am very confused about this.
    I am looking forward to hear your experience and advices.
    Have a nice day.
    Best Regards.
    Ho.

    Well, instead of being confused, you could go to http://www.oracle.com/pls/db102/portal.portal_db?selected=1 and look at
    1) the licensing document, which would tell you whether you need a separate license, and
    2) under the 'Books' tab, look at the Text Application Developer's Guide or the Text Reference manuals for details.
    You could also look for the Oracle Text forum (from the http://forums.oracle.com page, under Database - More, or Text and ask the people who concentrate on that set of features.
    In general, Oracle Text is a set of extensions, the definitions for which are stored under user ctxsys. You would use these extensions by creating your own objects that are based on the extensions.
    For example, suppose your tables contain varchar2 columns. Create indexes that are based on ctxsys's 'context index type' and your application can then use the 'CONTAINS' keyword search capability (which is effectively a ctxsys-owned extension to the select)
    However, you would never log on to ctxsys and do anythibng with that as you risk changing the template code that Oracle has supplied.
    Message was edited by:
    Hans Forbrich
    PS: Yes, Oracle Text is included as part of the base database. Most of it is even included in the free Oracle XE database.

  • Oracle 10g on AMD64 - libclntsh.so.10.1 in lib32 not build

    Hello,
    I tried to install the AMD64 build of Oracle 10g on my gentoo system without success. There were several warnings at the linking stage and it seems that none of the client tools are working. dbca gives me this:
    UnsatisfiedLinkError exception loading native library: njni10
    Exception in thread "main" java.lang.UnsatisfiedLinkError: get
    at oracle.net.common.NetGetEnv.get(Native Method)
    at oracle.net.config.Config.getNetDir(Unknown Source)
    at oracle.net.config.Config.initConfig(Unknown Source)
    at oracle.net.config.Config.<init>(Unknown Source)
    I assume that the supplied java is a 32bit product, so I checked the dependencies of libnjni10:
    oracle@gentoo ~/OraHome_1/lib32 $ ldd libnjni10.so
    ldd: warning: you do not have execution permission for `./libnjni10.so'
    linux-gate.so.1 => (0xffffe000)
    libclntsh.so.10.1 => not found
    libnnz10.so => ./libnnz10.so (0x55589000)
    libdl.so.2 => /lib32/libdl.so.2 (0x55718000)
    libm.so.6 => /lib32/libm.so.6 (0x5571b000)
    libpthread.so.0 => /lib32/libpthread.so.0 (0x5573e000)
    libnsl.so.1 => /lib32/libnsl.so.1 (0x55791000)
    libc.so.6 => /lib32/libc.so.6 (0x557a5000)
    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x56555000)
    In fact there is an empty .so file:
    oracle@gentoo ~/OraHome_1/lib32 $ ll libclnts*
    -rw-r--r-- 1 oracle oinstall 0 Jan 30 01:24 libclntsh.so
    -rw-r--r-- 1 oracle oinstall 20491452 Jan 30 02:44 libclntst10.a
    The same .so exists in the lib directory, so I assume that I also need the 32bit version in the lib32 directory. When I try "relink client_sharedlib" I get those error messages:
    racle@gentoo ~/OraHome_1/lib32 $ relink client_sharedlib
    /home/oracle/OraHome_1/bin/genclntsh
    /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a
    /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find /usr/lib/libc_nonshared.a
    collect2: ld returned 1 exit status
    cp: cannot stat `/DISCARD/': No such file or directory
    ar: creating /home/oracle/OraHome_1/lib/libclntst10.a
    Created /home/oracle/OraHome_1/lib/libclntst10.a
    ar: creating /home/oracle/OraHome_1/lib32/libclntst10.a
    Created /home/oracle/OraHome_1/lib32/libclntst10.a
    /home/oracle/OraHome_1/bin/genagtsh /home/oracle/OraHome_1/lib/libagtsh.so 1.0
    /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a
    /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find /usr/lib/libc_nonshared.a
    collect2: ld returned 1 exit status
    Did anyone have similar problems and was able to solve them?
    Thanks,
    Rainer

    Well, there was another problem in the genclntsh script.
    Under gentoo we got it fixed like this:
    edit genclntsh in $ORACLE_HOME/bin. Go to the line that reads:
    LD="gcc ${CF} -shared -Wl,-relax -L${OLIB}"
    Delete that line and add:
    if [ "$1" = "lib32" ]
    then
    LD="gcc ${CF} -shared -Wl,-relax -L${OLIB} -L/usr/lib32"
    else
    LD="gcc ${CF} -shared -Wl,-relax -L${OLIB}"
    fi
    Now run that script in order to get the libclntsh.so built.
    After that dbca seems to work. Maybe this trick (adding lib32 to your path) needs to be applied to other scripts as well, since libagtsh.so seems to have the same problems.
    /home/oracle/OraHome_1/bin/genagtsh /home/oracle/OraHome_1/lib/libagtsh.so 1.0
    /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a
    /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find /usr/lib/libc_nonshared.a

  • Problem in oracle 10g release 2

    I faced strange problem while selecting data from join of tables (in oracle 10g). While selecting, when the order of fields in "group by" clause is changed, the resulting summary of values is changed too. For eg,
    query1 = SELECT F1, F2, F3, SUM(F4)
    FROM TBL1
    GROUP BY F1, F2, F3, F4
    query2 = SELECT F1, F2, F3, SUM(F4)
    FROM TBL1
    GROUP BY F2, F4, F1, F3
    The results SUM(F4) given by query1 and query 2 do not match. While testing these querries in differnt environments, we found such problem in ORACLE 10g RELEASE 2 only and not in ORACLE 10g RELEASE 1. I need to execute this query in oracle 10g. Can anybody help me finding the exact problem?

    The results SUM(F4) given by query1 and query 2 do not matchSince the group by clause is not same, the result of sum can be different.
    Can you provide us some dataset ?
    Nicolas.

  • How Detect Oracle 10g on Windows

    I am developing a .NET application based on oracle
    In the process of the installation I need to detect
    Oracle 10g client (and ODP.Net) in order to alert the user if it was not
    so i wonder what registry entries should i check
    i appreciate for your help

    Another question... What dll's of ODP.NET and Oracle10gClient are required in order to distribute Oracle 10g client with my application

  • Oracle 10g express edition ..ampersand substitution variable

    when i enter the ampersand substitution variable and run the script in the oracle 10g express edition it is giving me the error of (ORA-01008: not all variables bound)...can someone please indicate what the problem is..
    thank you

    i am running the script in the browser but when i run it it does not give me the possibility to enter the value and that error which i mentioned before comes instantly
    reuben

  • Password problem in oracle 10g after upgrading from oracle 9i

    Hi to all,
    i'm migrating oracle 9i to oracle 10g. in oracle 9i username/password are same character(eg kareem/kareem)
    after upgrading to oracle 10g will it create any problem. Because in oracle 10g the condition is when creating user is username and password should not contain same character (kareem/kareem not allowed).
    Thanks in advance

    in oracle 10g document, they have mention below condition to create user. See the second condition.
    • Passwords must be between 4 and 30 characters long.
    • Passwords cannot be the same as the user name.
    • Passwords must be from the database character set and can include the underscore (_), dollar ($), and pound sign (#) characters.
    • Passwords cannot be Oracle reserved words.
    • Don't start the password with a numeral.
    • Don's use change_on_install or manager as passwords, since they are used by Oracle.
    As i'm going to upgrade oracle 9i to 10g. if it give problem because username and password are same then i have to request my development team to change the password in their application.Can you please verify and tell me.
    Edited by: user7071421 on Sep 25, 2008 4:33 AM

  • Grid Concept in Oracle 10g

    Hi everyone!!!
    what is Grid in Oracle 10g ? How Grid works ? How is it beneficial (I am not asking for additional features of 10g , but advantage of Grid over non grid vesions (prior to 10g) ) .
    Thanks.......Have a nice DAY!!!!

    974850 wrote:
    Hi everyone!!!
    what is Grid in Oracle 10g ? How Grid works ? How is it beneficial (I am not asking for additional features of 10g , but advantage of Grid over non grid vesions (prior to 10g) ) .
    Thanks.......Have a nice DAY!!!!Without the new features ("I am not asking for additional features of 10g") the only advantage is the continued revenue stream for Larry to help finance his boat. It's just a marketing lable, nothing more.

  • Oracle 10g DB listener does not work.

    I am in a terrible situation.
    My oracle 10g db listener often hang without any sign.
    For example , sometimes user sql select one minute ago , then the database could't be conected next minute .
    Even i command lsnrctl stop and start , the listener is over .
    I have to kill process then start listener.
    I try to find out what for , but i am don't know how to do .
    May any one tell my why or how ?
    Thank you .

    Thank you .
    I find how to happen the problem . It should be bug 4518443 .
    Now i have another question .
    I want to apply patch ,but fails.
    following is my command line :
    [oracle@localhost ~]$ opatch lsinventory
    -bash: opatch: command not found
    When I cd $oracle_home/OPatch , i find opatch file.
    Iam not sure why i can't apply patch .
    Thak you .

  • Oracle 10g Workshop I or Oracle 11g workshop I

    Hi guys,
    I need a bit of advice on which course should I follow. I know that Oracle 11g is the latest release and it composes of new features compared to 10g, but I need to know the which is worth doing is 10g or 11g.
    -Coz I heard that oracle 11g still runs on beta versions and the revised version has not been released.
    -The demand and the market base for both of them, coz far as I know one of my neighbour who is a dba he said
    oracle 10g has around 80% of the market share whilst 11g has only around 15%.
    -And also guys the exam paper itself coz 10g has a duration of 90 mins and 11g comprises of 3-3.5 hours paper
    which most likely means that the paper might be difficult.
    I am new to this field and I am not quite sure which exam I should write, so need some clarification,,,,
    Thanks in advance for your replies...

    user11000521 wrote:
    Hi guys,
    I need a bit of advice on which course should I follow. I know that Oracle 11g is the latest release and it composes of new features compared to 10g, but I need to know the which is worth doing is 10g or 11g.
    -Coz I heard that oracle 11g still runs on beta versions and the revised version has not been released.
    -The demand and the market base for both of them, coz far as I know one of my neighbour who is a dba he said
    oracle 10g has around 80% of the market share whilst 11g has only around 15%.
    -And also guys the exam paper itself coz 10g has a duration of 90 mins and 11g comprises of 3-3.5 hours paper
    which most likely means that the paper might be difficult.
    I am new to this field and I am not quite sure which exam I should write, so need some clarification,,,,
    Thanks in advance for your replies...Just in addition to Hans and Bigdelboy's replies, first thing , `11g is NOT in beta. 11g R1(11106) release officially came in 2007 July and was launched completely for commercial use. As Hans pointed, release 2 of 11g is currently in beta but as per the "rumours" , this also should end soon. So you must throw this out from the mind that 11g is running in beta. Its very well out and its amazingly very well accepted in the industry.
    I won't comment or contradict (and won't even agree) to what your friend said about the percentage of the usage of the versions. But few thoughts that do come in mind, 10g is around now from some time so its obvious that its acceptancce would be more as compared to 11g. But that said, 11g , as a surprise, even in release 1 is much stable and proving-to-be-efficient as compared to 10g. So very soon, IMHO, industry would be coming out to 11g. As pointed to you already about 10g's extended support, and I guess this year is also extended support year for 9i, very soon, lots of migrations would happen( and are happening) over either 10g/11g.If it would be me who has to decide between 10/11g, I would pick 11g. But this should give you an idea for the point. There are many shops which still have not bothered tolook even at 9i, let alone be 10/11g. The site where I am at the moment, they still are running many of their production dbs on 7.3even. And who knows even being a 11g certified, you may end up for your job in a shop who runs 9i,8i or even versions before that.
    Which version to pick from 10/11 as 11g is new and has new features as compared to 10g, for this I shall say, 11g's most of the features(not all though) are actually enhancements to the features of 10g. Many things hail from 10g only. So its not wrong to say that if one has an experience of 10g, it would be a bit easier to understand the terminology of 11g when it would say, there is some thing called ADDM which is now both database wide and Intance wide(an 11g feature). But as ADDM came in 10g first, if you have the idea about it, IMO, it would be easier for you to take care about 11g. I played with 10g for almost 3 years before taking up the new feature exam of it and it took almost 1 year with 3 different books and playing with 11g to take up the new features exam of 11g.
    In the end, certification , in whatever version, is just a mark of your will to be current with teh technology. Even if you have scored 100% and are not ableto answer the questions in the interview, it won't take you much far for getting a job of dba and being good in it.
    Just few thoughts!
    HTH
    Aman....
    Edited by: Aman.... on Apr 26, 2009 9:37 AM
    replaced a word with another

Maybe you are looking for

  • [Solved] Beachballs on late 2008 15" MacBook Pro MacBookPro5,1 with SATA II HD

    Each time I upgraded hard disks in my late 2008 15" MacBook Pro ( MacBookPro5,1 ) I experienced increasing beachballs. The worst was my recent upgrade to a Seagate 1TB SSD hybrid drive. I had lived with this pain for years and it appears a simple jum

  • How to fix itunes when it says "Apple Mobile Device Not started"

    whenever i open itunes with my ipod connected to my usb port, it say the apple mobile device is not started. i have no idea what to do, and god knows im not a computer whiz. if anyone can help me that would be EXTREMELY appreciated. -Thanks

  • Rotate camera function

    Hello, I'm starting to write a code for Acrobat and 3d Objects. What I need is a function that rotates an object given a yaw and a pitch (i.e. rotateObjectYaw(45) to rotate the object 45 degrees around, rotating the camera, not the object itself). I

  • Error message in sales order against target value contract

    Hi experts I have value contracts scenario, when I create a Release Orders thatu2019s exceeds the value of the contract the system raise a message error, but in this case the decimal expression in wrong. The decimal expression of the country is 1.234

  • Error: Can anyone explain

    You must install a Solaris patch to run the native threads version of the Java runtime. The green threads version will work without this patch. Please check the native threads release notes for more information. If you are embedding the VM in a nativ