Query diferent output between 11gR1 and 11gR2

We have a complex query which has been working fine in 11gR1 and after changing aplication to 11gR2 it started generating an error.
This simple table and query shows the same error I am seeing.
In 11gR2 this first select gives an error ORA-00979
In 11gR1 it works fine
Create this table
CREATE TABLE TAB1
+(+
+"PKEY" NUMBER NOT NULL ENABLE,+
+"FKEY1" NUMBER ,+
+"FKEY2" NUMBER,+
CONSTRAINT "TAB1_PK" PRIMARY KEY ("PKEY")  ENABLE
+)+
+;+
THIS SHOWS ERROR
select somenumber
from
+(+
SELECT
+(SELECT 1+
FROM DUAL
WHERE 99999=t1.fkey1
+) somenumber+
FROM tab1 t1
GROUP BY
t1.fkey1,
t1.pkey
+)+
ORA-00979: "not a GROUP BY expression"
Error at Line: 7 Column: 18
THIS WORKS (Substitute t1.pkey in GROUP by with t1.fkey2 - Here we see that error generated above is only generated when GROUP BY is done by primary key when using fkey2 it does not give error)
SELECT somenumber
FROM
+(+
SELECT
+(SELECT 1+
FROM DUAL
WHERE 99999=t1.fkey1
+) somenumber+
FROM tab1 t1
GROUP BY
t1.fkey1,
t1.fkey2
+)+
THIS WORKS (Add [+GROUP BY somenumber+] to end - should not be necessary since no distinct or aggregate function in outer select)
select somenumber
from
+(+
SELECT
+(SELECT 1+
FROM DUAL
WHERE 99999=t1.fkey1
+) somenumber+
FROM tab1 t1
GROUP BY
t1.fkey1,
t1.pkey
+)+
GROUP BY somenumber
Does anyone seen this behavior before?
Alexandre.

Looks like a bug in 11gr2 (i was able to reproduce your results) and tested against an XE instance where the query executes without problem (as in your 11gr1 instance).
Since you have a nice little demonstration set up you should easily be able to file a Metalink (MOS) incident and get Oracle looking at this.
Though for the example you've posted the simple fix would be to make the query less 'weird' :)
drop TABLE TAB1;
CREATE TABLE TAB1
   PKEY NUMBER NOT NULL ENABLE,
   FKEY1 NUMBER ,
   FKEY2 NUMBER
   , CONSTRAINT TAB1_PK PRIMARY KEY (PKEY) ENABLE
insert into tab1 values (1, 99999, 9);
insert into tab1 values (2, 0, 10);
Table dropped.
ME_XE?ME_XE?  2    3    4    5    6    7    8 
Table created.
ME_XE?ME_XE?
1 row created.
ME_XE?
1 row created.
ME_XE?
ME_XE?
ME_XE?
ME_XE?
select somenumber
from
SELECT
(SELECT 1
FROM DUAL
WHERE 99999=t1.fkey1
) somenumber
FROM tab1 t1
GROUP BY
t1.fkey1,
t1.pkey
13  );
SOMENUMBER
      1
2 rows selected.
SELECT
   somenumber
FROM
      SELECT
         case when t1.fkey1 = 99999
         then
            1
         else
            null
         end as somenumber
      FROM
         tab1  t1
      GROUP BY
         t1.fkey1,
         t1.pkey
17     );
SOMENUMBER
      1
2 rows selected.
ME_XE?As i said, i can run this fine on my XE instance so i used that to demonstrate how i would rewrite the query which to me at least makes more sense.
And the run on my 11.2 instance
insert into tab1 values (1, 99999, 9);
insert into tab1 values (2, 0, 10);
1 row created.
TUBBY_TUBBZ?
1 row created.
SELECT
   somenumber
FROM
      SELECT
         case when t1.fkey1 = 99999
         then
            1
         else
            null
         end as somenumber
      FROM
         tab1  t1
      GROUP BY
         t1.fkey1,
         t1.pkey
17     );
SOMENUMBER
      1
2 rows selected.
TUBBY_TUBBZ?select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE     11.2.0.1.0     Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
5 rows selected.Edited by: Tubby on Sep 9, 2010 6:40 PM
Added 11.2 test run.

Similar Messages

  • Differences between 11gr1 and 11gr2

    Please can i be furnish with the differences between 11gr1 and 11gr2?
    Thank you.

    New Features Guide
    http://docs.oracle.com/cd/E11882_01/server.112/e22487/toc.htm

  • API differences between 11gR1 and 11gR2

    Can anyone tell me if there are any api differences between oim 11gR1 and 11gR2 specifically. Also can we still use API's from oim 9.x in 11gR2.
    Thanks

    I think for lookup we can use tcLookupOperationsIntf API. You can refer old and new alternatives list here:
    http://docs.oracle.com/cd/E21764_01/doc.1111/e14309/apis.htm#BCFDDFAI
    Though this list doesn't have tcLookupOperationsIntf.
    regards,
    GP

  • Differences between Oracle Real Application Cluster 11gR1 and 11gR2

    Hi Experts,
    Please provide me differences between Oracle RAC 11gR1 and 11gR2.
    Thanks in Advance,
    Jeeshan.

    Hi,
    You can also refer below Oracle notes :
    11gR2 Clusterware and Grid Home - What You Need to Know (Doc ID 1053147.1)
    Important Changes to Oracle Database Patch Sets Starting With 11.2.0.2 (Doc ID 1189783.1)
    Regards,
    Neha

  • SWITCHOVER_STATUS value are different for Oracle 11gR1 and 11gR2

    Hi All,
    I would like to know why is there a difference in the SQL output when run on a 11gR1 and 11gR2 Primary database in a DataGuard configuration.
    On a 11gR1 Primary database
    Open an SQL Session on the Primary database and run the SQL statement
    SQL> select switchover_status from v$database;
    To Standby
    Now open a second SQL Session
    Run the above SQL statement
    SQL> select switchover_status from v$database;
    Sessions Active
    Now, when I do the same on a 11gR2 Primary database here is the result
    On a 11gR2 Primary database
    Open an SQL Session on the Primary database and run the SQL statement
    SQL> select switchover_status from v$database;
    To Standby
    Now open a second SQL Session
    Run the above SQL statement
    SQL> select switchover_status from v$database;
    To Standby
    Is this a bug in 11gR2 ? Is there a patch/fix available ?
    Oracle 11gR2 version 11.2.0.1.0
    TIA,
    Sudhir

    Hello Loic,
    The result on the Standby Database is "Not Allowed". This is because there is no alternative Standby Available.
    I have some scripts which does the switchover based on the Database status. As per Oracle 11gR2 DataGuard Admin docs.
    Cut pasted for Oracle DataGuard Admin docs.
    Step 1 Verify that the primary database can be switched to the standby role.
    SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
    SWITCHOVER_STATUS
    TO STANDBY
    1 row selected
    Note: The WITH SESSION SHUTDOWN clause can be omitted from
    the switchover statement if the query performed in the previous step
    returned a value of TO STANDBY.
    When I use SQL statement "ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;" and if there are Active SQL sessions then I get the error
    ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY *
    ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected
    Thanks,
    Sudhir

  • To find sqlnet version in 11gR1 and 11gR2?

    Hi,
    How can I find out the versions of sqlnet of Oracle 11gR1 and 11gR2?
    When I googled, I got some tips like using following scripts; select * from v$version;
    But, this is not exactly what I am looking for...
    I would like to find out what version of sqlnet is used...
    Thanks in advance,
    - SH

    Another way is - $ORACLE_HOME/bin/lsnrctl version.
    You get an output like this ->
    TNSLSNR for Linux: Version 11.2.0.1.0 - Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    Unix Domain Socket IPC NT Protocol Adaptor for Linux: Version 11.2.0.1.0 - Production
    Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production
    TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production,,
    The command completed successfully

  • Datagaurd Difference Between 11gR1 and R2

    Guys,
    Please can any one tell me crisply what is difference in oracle Datagaurd 11gR1 and 11gR2.
    Thanks In Advance

    1. Check [url http://www.oracle.com/pls/db112/portal.portal_db?selected=14&frame=]Documentation (look for "What's new" sections).
    2. Dedicated forum {forum:id=849} - use forum search facility.

  • Stream Configuration between different 11gr1 and 11gr2

    I have oracle downstream set-up between two DBs both are 11gr1, i want to upgrade my my target DB to 11gr2. I want to ask whether my streams set-up would work after this or not.
    OR
    Is it possible have streaming between two version of oracle.
    I shall be V thankful for you guidance.

    Hi,
    Yes it possible to have streams configured between 2 different versions.
    Anand

  • Features Difference between 6i and 11gr2 (forms/reports)..

    Hi all,
    I just upgraded my old style menu-driven application from forms/reports 6i to 11gr2 and don't add features of 11gr2
    still now. So, Its look like old one (6i).
    So, please guide me what features should I add (like look-wise, working-wise, performance-wise etc.),
    so that my application look like latest technology.
    Thanks and Regards.
    Bhatt.

    The biggest difference between Forms 6i and Forms 11g is: 1) the ability to use features of the 11g database, 2) use Java Beans in your form to extend/enhance the functionaly and look-n-feel, 3) import Java directly into your form and interact with the Java through PL/SQL, 4) and most importantly, it is the current supported version of Forms. These are just the highlights. There are other differences.
    In all honesty, what features you use should be driven by the needs of your customer. If your customer needs the application to use the response from a web service, then I would look at implementing a Java Bean in your app to support this customer driven need. I wouldn't recommend adding features just for the sake of adding features if they don't provide direct benefit to your customer. Just my opinion. :)
    Hope this helps,
    Craig...

  • Query displaying diffrence between highest and lowest salarys?

    I need to write a query that will display the difference between the highest and lowest salaries. Label the column DIFFERENCE.
    It should look something like so. I have no idea what to type in SQL plus to get this.
         DIFFERENCE
    4200

    Sweetness, thanks for this help, I just also started at this company called avid technologies
    www.avid.com and I Just learned SAP.
    Heres another problem if you can help:
    Create a matrix query to display the job, the salary for that job based on department number, and the total salary for that job for all departments, giving each column an appropriate heading
    and again the formatting is messed up.
         Job               Dept 10 Dept 20      Dept 30     Total
         ANALYST     6000                    6000
         CLERK          1300     1900          950     4150
         MANAGER     2450     2975     2850     8275
         PRESIDENT     5000                    5000
         SALESMAN                    5600     5600

  • Availability of 11gR1 and 11gR2 on other Linux platforms (Certf.)

    Can anyone within Oracle give me an estimate when we will have access to these two releases on the platforms running Linux ?? I am looking for more specifically Linux on System z. Although I have heard that Release 1 of every new Version of Oracle DB doesn't get certified until R2 comes out, I have customers asking me if R1 will ever be available and also, looking forward will Oracle certify R1's for next versions on Linux on other platforms, or will Oracle just concentrate on X86 .... !!!!???
    Thanks.

    The Metalink note that discusses IBM Linux on System z states that the certification status for 11.1 is "Projected" and has a note
    "NOTE: This is the most current and accurate information. Do not log Service Requests to Support for additional information. When the date is known this note will be updated.
    Certify Administrator - 2009"
    I assume, therefore, that Oracle has no date to share. Presumably, anyone that has a date is not going to be able to share it in a public forum prior to the official announcement. I'd keep your eye on the Metalink certification matrix-- I'm sure as soon as Oracle knows a date, the note will be updated.
    Justin

  • Differences between oracle 10gr2 and 11gr2 warehouse bulider

    Hi All,
    Could you please let me know the main differences between Oracle 10gr2 and Oracle 11gR2 warehouse builder.
    Also , it would be great if anyone point me to the document where i can see the major differences.
    Thanks,
    Naveen.

    Hi Naveen,
    The major difference between OWB10gR2 and 11gR2 is the target RDBMS.
    In 10gR2 you have to use ORACLE as your target RDBMS (unless you are going for DB Gateways, that is a complete different story).
    Where as in 11gR2 allows you to use any RDBMS as your target system . This is achieved by Code-Template mapping.
    All is needed is that proper jdbc driver for the target system.
    Also 11gR2 supports OBIEE RPD creation and etc.
    http://blogs.oracle.com/warehousebuilder/2009/09/oracle_warehouse_builder_11gr2.html
    http://www.rittmanmead.com/2009/09/a-look-at-the-new-features-in-owb11gr2/
    http://www.oracle.com/technetwork/developer-tools/warehouse/owb-11gr2-new-features-summary-129693.pdf
    Thanks,
    Sutirtha

  • Memory Management comparison between Database 9208 and 11gR2 on Sun Solaris

    Hi All,
    Need some case studies which would help understand how Memory management is done in 9208 and 11gR2 on Sun Solaris SPARC
    Also wanted some real time data which says 11gR2 manages Memory and CPU better than 9208. Some comparison Graph between 9i and 11gR2.
    Any information will be of great help.
    Thanks everyone for your support.
    Thanks
    Abdul

    please see if below helps :
    http://www.oracle.com/global/de/upgradecommunity/artikel/upgrade11gr1_workshop2.pdf
    http://www.dba-oracle.com/oracle11g/oracle_11g_memory_target_parameter.htm
    Regards
    Rajesh

  • JMS Dequeue not working after upgrade from 11gR1 to 11gR2

    Our database was migrated to a new database with new hardware running 11gR2
    enqueue appears to be working as the queue table just grows and grows
    However, my JMS async subscriber is never getting messaged.
    Is there any logical reason for this?
    in select * from all_queues my queue does show ENQUEUE and DEQUEUE enabled
    also
    the user that makes the subscription has DEQUEUE grant priviledge
    Is there anything else that is needed for this to work?
    I have already recreated the queue and queue table and ended up in the same place with no JMS consumer being able to consume.
    when enabling trace on JMS I see
    Caused by: oracle.jms.AQjmsException: JMS-122: Internal error Corrupted message
         at oracle.jms.AQjmsError.throwEx(AQjmsError.java:334)
         at oracle.jms.AQjmsUtil.getTextData(AQjmsUtil.java:718)
         at oracle.jms.AQjmsTextMessage.readGenMessageContainer(AQjmsTextMessage.java:322)
         at oracle.jms.AQjmsTextMessage.<init>(AQjmsTextMessage.java:172)
         at oracle.jms.AQjmsConsumer.dequeue(AQjmsConsumer.java:2481)
    What incompatibilities exist b/w 11gR1 and 11gR2 ... my client is using aqapi 11.1
    Edited by: steffi on Jan 14, 2013 3:14 PM

    It's looking like it was a missing jar in this case the orai18n.jar
    Is there any kind of release notes for how to move working AQ from 11gR1 to 11gR2?

  • When will Mavericks toggle between HDMI and headphones

    I tried Mavericks for about 30 minutes, then reinstalled 10.6.8 when I discovered I could not toggle the audio output between HDMI and Headphones.  I use a mini for my home theater setup and I leave a cable directly to my amp plugged into the headphone jack.  10.9.1 would not let me route audio out through my HDMI connection until I unplugged the cable from the headphone jack.  This was unacceptable and THE reason I uninstalled Mavericks.
    Is this available in 10.9.3 or am I staying on 10.6.8 for a while longer?  Yes, I sent a note to Apple Feedback.  I have downloaded Mountain Lion but as yet not installed it.

    The computer I am running Mavericks on is a mid 2012 MacBook Air. It does not have an HDMI port - so I can't verify that it will show as a switchable option, but it does route the audio output as directed to the avialable outputs in my system:
    MtD
    Message was edited by: Meg The Dog to fix typo

Maybe you are looking for

  • Discount in kind indicator in material master

    Hi, where we found discount in kind indicator in material master. what is the functionality of this? Regards Rifaie

  • New muvo txfm can't drag files to

    when i plug my muvo into my usb my computer recognizes it as removable dri've but when i try to drag files to it, it tells me to insert disk into dri've so i thought maybe i needed to format and i get the same message any suggestions

  • Can't see AEB or AE when VPNed

    I encountered a problem where I can't admin my AEB or use AirTunes on my LAN when I am VPNed in to work. I already had to download and use the old Airport Admin Utility and turn IPv6 config Off just to be able to connect to the devices to admin. I ca

  • Account group mapping is not uderstand ?

    Hi Experts, I am not understanding the mapping between the account groups. If you check under "Customer Account Group" the field name "Group", I dont understand where it is mapping to other account group? And how all the account groups linked with ea

  • Leave screen?

    How can I return back? If I press the button the program says nothing. And I cann't go back. Thanks! TABLES sscrfields. SELECTION-SCREEN PUSHBUTTON /10(20) btn1 USER-COMMAND bnt1. INITIALIZATION.   MOVE 'Here!!! TO btn1. AT SELECTION-SCREEN.   IF ssc