Oracle 11g bug for column ambigously defined error

I have below format query running on Oracle 10g without any issues
select col1
from (select col1
from (select 'A' col1
from dual)
) v1
inner join (select col1 as col2
from (select 'A' col1
from dual)
) v2
on (v1.col1=v2.col2);
When I run the exact same query on Oracle 11g I get column ambiguously defined error. But when I change the query to as below it works fine on 11g
select v1.col1
from (select col1
from (select 'A' col1
from dual)
) v1
inner join (select col1 as col2
from (select 'A' col1
from dual)
) v2
on (v1.col1=v2.col2);
Is it because 11g ignores column alias in my inner queries.

I'd tend to agree that this seems to be a bug in 11.1.0.7 (at least, that's the version I'm running it in)
It's not even that Oracle doesn't know about the column aliases, you can remove the aliases in the ON without a problem, i.e.
SELECT v1.col1
   FROM
  (SELECT col1 FROM
    (SELECT 'A' col1 FROM dual
  ) v1
INNER JOIN
  (SELECT col1 AS col2 FROM
    (SELECT 'A' col1 FROM dual
  ) v2
     ON (col1=col2);works fine. Using the old join syntax also seems to work fine
SELECT col1
   FROM
  (SELECT col1 FROM
    (SELECT 'A' col1 FROM dual
  ) v1,
  (SELECT col1 AS col2 FROM
    (SELECT 'A' col1 FROM dual
  ) v2
  WHERE (col1=col2);So it appears that something in the SQL 99 parser is broken. Have you logged a bug in Metalink?
Justin

Similar Messages

  • "column ambigously defined" error

    ORA-00918: column ambigously defined
    00918.00000 - "column ambigously defined"
    *Cause:
    *Action
    Vendor code 918     
    I've gotten this error on a few of the queries I've ran in SQL Developer 1.5 and tried to export to xls, but when I run and try to export the same query in 1.2.1 it's fine. There is another popup box that provides this detail (below). What causes this error and how can it be fixed?
    java.lang.NullPointerException
         at oracle.dbtools.raptor.dialogs.export.ColumnPanel.addColumnsToTree(ColumnPanel.java:85)
         at oracle.dbtools.raptor.dialogs.export.ColumnPanel.showPanel(ColumnPanel.java:61)
         at oracle.dbtools.raptor.dialogs.export.ColumnPanel.<init>(ColumnPanel.java:50)
         at oracle.dbtools.raptor.dialogs.actions.TableExportAction.showPanels(TableExportAction.java:291)
         at oracle.dbtools.raptor.dialogs.actions.TableExportAction.launchDlg(TableExportAction.java:189)
         at oracle.dbtools.raptor.format.ui.ExportContextMenuListener$1.actionPerformed(ExportContextMenuListener.java:137)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    The problem is that SQL Developer 1.5.0/1 generates and executes a query that is not quite your original query to assist with the export dialog (presumably to populate the Columns tab). Note that it also does a single bulk fetch against this query, which can cause performance issues when trying to export the results of long running queries.
    For the example query of:
    select t.id, t2.id from t,t2;
    this generated query is:
    select * from ( select "ID","ID" from ( select t.id, t2.id from t,t2 ) )
    The export works in 1.2.1 simply because they did not generate this additional query, but re-executed the original query.
    theFurryOne

  • Oracle 11G database for 64 bit windows installation error

    Hi,
    I downloaded the 11G 64bit for windows and unzipped the files into one folder and ran the setup.exe as an administrator. It opened up the java screen and I chose, create and configure a database. Next screen I chose, Desktop Class, when I click next it dies. It does not show me teh next screen. I went to the appdata folder and saw this error but not sure what to do EXCEPTION_ACCESS_VIOLATION (0xc0000005). Please help. Thanks for your time and help.

    Adipur wrote:
    Hello, have you tried to create new administrator user, and install using that newly created user...?You found this to be a band-aid solution in your specific instance. (Strange case of installation on windows 7 - unable to complete installation But you have drawn the wrong conclusions and never found the real issue in the cited thread. Under the circumstances, I would not be offering this up as a generalized solution, as you are doing in this thread and in others:
    Re: Oracle 11G database for 64 bit windows installation error
    Re: Trouble installing Oracle Personal in Windows 7 64-bit environment
    I have been doing Oracle DBA work since v 7.3, and have never seen advice like this to be anything more than a work-around the real issue.
    Edited by: EdStevens on May 15, 2013 7:03 AM

  • Column Ambiguosly Define error

    Hi,
    I have a query that goes like this
    select * from
    (      select a.data1, b.data2
         from table1 a, table2 b
         where a.xxx = b.xxx
    union all     
         select a1.data1, b1.data2
         from table11 a1, table21 b1
         where a1.xxx1 = b1.xxx1
    union all     
         select a2.data1, b2.data2
         from table31 a2, table32 b2
         where a2.xxx2 = b2.xxx2
    when i run this query, i get the error "*Column Ambiguosly Defined*" error. However when i run the query without hte explicit select i.e.
    select a.data1, b.data2
         from table1 a, table2 b
         where a.xxx = b.xxx
    union all     
         select a1.data1, b1.data2
         from table11 a1, table21 b1
         where a1.xxx1 = b1.xxx1
    union all     
         select a2.data1, b2.data2
         from table31 a2, table32 b2
         where a2.xxx2 = b2.xxx2
    this query returns valid data. i need this data to be part of a custom report and need to add the select * from to the whole result set.
    Please respond to this query and provide me with a valid solution for the same.
    Thanks in advance
    Bharath

    Your constant re-posting of this message is NOT increasing your chances of getting a solution.
    This forum is not a chat line, and it is not paid support.
    No one is responsible for monitoring it and giving a quick response.
    Furthermore, it is a global forum. The person with the information you seek may very well live 20 time zones away from you and was going to bed just as you posted. He will not even see your post for several more hours.
    Your original post went up in the middle of the night for half the world.
    No one with the information you seek is deliberately withholding it until you sound sufficiently desperate.

  • Oracle 11g advantages for performance

    Hello,
    I am doing test of Client side result set cache on oracle 11 g rel2 ,O/S- RHEL
    i am doing test as below on 2 Oracle 11g rel2 test servers on RHEL
    one oracle 11g rel2 instance is used as server1,from other oracle 11g rel2 server2, i am running queries connecting to server1 through sqlplus,listener(tnsnames )
    i run query few times without any client cache settings then
    i have set init.ora paras for oracle 11g rel2 for client result cache,cache size/cache lag
    i run the same query few times
    in both the cases after each run i am noting statistics
    select * from V$RESULT_CACHE_OBJECTS;
    select * from V$CLIENT_RESULT_CACHE_STATS;
    select * from gv$cpool_conn_info;
    also autotrace,plan etc
    but after using cache this views are getting poplulated ,autiotrace plan shows cache is used
    but i cant see any improvement in performance after using client cache like speed,reduce network trip, etc
    in fact without using cache/with no hint ,query executes faster
    let me know if i am missing something,i believe sqlplus internally using OCI
    thanks

    >
    I tested with custom code using java/jdbc thin driver ,connecting same as between 2 oracle 11g2 instance 1 as client other server,running code calling queries from client connecting to server
    >
    Unless you plan to provide the information ask for about what it is you are doing there really isn't any point in providing status updates that: you test this, you tested that. You made several statements about what you were doing
    >
    i have set init.ora paras for oracle 11g rel2 for client result cache,cache size/cache lag
    i run the same query few times
    in both the cases after each run i am noting statistics
    select * from V$RESULT_CACHE_OBJECTS;
    select * from V$CLIENT_RESULT_CACHE_STATS;
    select * from gv$cpool_conn_info;
    also autotrace,plan etc
    >
    and were asked to provide specific information that you haven't provided nor have you provided the query.
    >
    You say you are doing a bunch of things
    But you don't post any of those results so we can see what it is you are looking at.
    No one can comment on things they can't see.
    >
    You have to be using OCI for client side caching so if you use the Java thin driver but don't use OCI there won't be any cacheing. There also won't be any if it is not enabled or if the query has certain constraints as listed in the doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28395/oci10new.htm#CHDGGFEF
    >
    Queries that are not Cached
    There are queries that are not cached on the OCI client even if the result cache hint is specified. Such queries may be cached on the database if the server result cache feature is enabled (see Oracle Database Concepts, "SQL Query Result Cache" for more information). If a SQL query includes any of the following, then the result set of that query is not cached in the OCI client result cache:
    •Views
    •Remote objects
    •Complex types in the select list
    •Snapshot-based or flashback queries
    •Queries executed in a serializable, read-only transaction, or inside a flashback session
    •Queries that have PL/SQL functions in them
    •Queries that have VPD policies enabled on the tables
    >
    This Oracle-Developer.net article author doesn't seem to have any trouble caching results.
    http://www.oracle-developer.net/display.php?id=503

  • Which one is best option RAC 10g or oracle 11g RAC for certifiction point ?

    hi ,
    which one is best option RAC 10g or oracle 11g RAC for certifiction point of view?
    can any one detail difference between above 2 options?
    Regards,
    A.Anwar

    A. Anwar wrote:
    hi ,
    which one is best option RAC 10g or oracle 11g RAC for certifiction point of view?
    can any one detail difference between above 2 options?The main difference is: Oracle Lifetime Support
    Premier Support Ends
    Oracle 10g R2 - Jul 2010
    Oracle 11g R2 - Jan 2015
    Extended Support Ends
    Oracle 10g R2 - Jul 2013
    Oracle 11g R2 - Jan 2018
    http://www.oracle.com/us/support/library/lifetime-support-technology-069183.pdf
    Oracle 10g R2 is getting unsupported.

  • Is Oracle 11g released for NW04s and ECC6.0?

    Is Oracle 11g released for NW04s and ECC6.0?
    Please help. Thanks!

    Plain and simple: No, it isn't.
    Check the SAP on Oracle homepage [here|SAP on Oracle] in SDN and read the latest development news on this topic including a rough schedule.
    regards,
    Lars

  • Oracle 11g ODBC for Windows NT and Windows 95

    Hi
    Please does anyone knows where can I find this ODBC ? Oracle 11g ODBC for Windows NT and Windows 95
    I have test some ODBC from the Oracle page but doesnt work
    Thank you
    J.A.

    I'm thinking no.
    However I did find this which may help :
    http://www.oracle.com/technetwork/database/windows/odbcfaq-128251.pdf
    I did the search for 16 bit in it and found some interesting information.
    The other piece of information I can share is the Oracle 11 client has issues connecting to Oracle 9.
    An Oracle 10 clients might have a better chance, but the catch is finding it.
    The last client I remember working on these OS's was Oracle 8. But I doubt that will connect to Oracle 11.
    Best Regards
    mseberg
    Edited by: mseberg on Aug 14, 2012 6:06 PM
    Later
    I'm not a huge fan of when they move stuff. This spot feels a little like the island of misfit toys.

  • Column Ambigiously defined error message

    I'm getting Column Ambigiously defined error message. How do I fix it ?
    select c.guid,d.teritorryname,a.permission,e.CLASSIFICATIONNAME from Apps_PERMISSION a , Apps_PERMISSION_CLASSIFICATION b , Apps_USER_MASTER c ,Apps_TERRITORY_MASTER d , Apps_CLASSIFICATION_MASTER e where a.PERMISSIONID=b.PERMISSIONID and a.TERRITORYID=d.TERRITORYID and a.USERID=c.USERID and b.CLASSIFICATIONID=e.CLASSIFICATIONID and a.USERID IN (select userid from Apps_USER_MASTER ) order by userid

    May be
    select c.guid,d.teritorryname,
    DECODE(a.permission,1,'Create',2,'View',3,'Edit'),
    e.CLASSIFICATIONNAME from Apps_PERMISSION a , Apps_PERMISSION_CLASSIFICATION b , Apps_USER_MASTER c ,Apps_TERRITORY_MASTER d , Apps_CLASSIFICATION_MASTER e where a.PERMISSIONID=b.PERMISSIONID and a.TERRITORYID=d.TERRITORYID and a.USERID=c.USERID and b.CLASSIFICATIONID=e.CLASSIFICATIONID and a.USERID IN (select userid from Apps_USER_MASTER ) order by a.useridOr you can use CASE also.

  • Oracle 11g RAC on RHEL 4.0, error on 1 Node while running ./root.sh for CRS

    Hi,
    I am trying to install Oracle 11g RAC on RHEL 4.0 on Vmware and at the end of CRS installation when installer asks to run the two scripts (orainstRoot.sh and root.sh) on one node (on the node where runInstaller is started) throws following error
    [root@LRAC1 crs]# ./root.sh
    WARNING: directory '/xhdd/u01/crs/oracle/product/11.1.0' is not owned by root
    WARNING: directory '/xhdd/u01/crs/oracle/product' is not owned by root
    WARNING: directory '/xhdd/u01/crs/oracle' is not owned by root
    WARNING: directory '/xhdd/u01/crs' is not owned by root
    WARNING: directory '/xhdd/u01' is not owned by root
    WARNING: directory '/xhdd' is not owned by root
    Checking to see if Oracle CRS stack is already configured
    Setting the permissions on OCR backup directory
    Setting up Network socket directories
    /xhdd/u01/crs/oracle/product/11.1.0/crs/bin/ocrconfig: line 78: /xhdd/u01/crs/oracle/product/11.1.0/crs/bin/ocrconfig.bin: cannot execute binary file
    /xhdd/u01/crs/oracle/product/11.1.0/crs/bin/ocrconfig: line 78: /xhdd/u01/crs/oracle/product/11.1.0/crs/bin/ocrconfig.bin: Success
    Failed to upgrade Oracle Cluster Registry configuration
    [root@LRAC1 crs]#
    While on the second node the root.sh script does not give any errors, here the output
    [root@LRAC2 crs]# ./root.sh
    WARNING: directory '/xhdd/u01/crs/oracle/product/11.1.0' is not owned by root
    WARNING: directory '/xhdd/u01/crs/oracle/product' is not owned by root
    WARNING: directory '/xhdd/u01/crs/oracle' is not owned by root
    WARNING: directory '/xhdd/u01/crs' is not owned by root
    WARNING: directory '/xhdd/u01' is not owned by root
    WARNING: directory '/xhdd' is not owned by root
    Checking to see if Oracle CRS stack is already configured
    /etc/oracle does not exist. Creating it now.
    Setting the permissions on OCR backup directory
    Setting up Network socket directories
    Oracle Cluster Registry configuration upgraded successfully
    The directory '/xhdd/u01/crs/oracle/product/11.1.0' is not owned by root. Changing owner to root
    The directory '/xhdd/u01/crs/oracle/product' is not owned by root. Changing owner to root
    The directory '/xhdd/u01/crs/oracle' is not owned by root. Changing owner to root
    The directory '/xhdd/u01/crs' is not owned by root. Changing owner to root
    The directory '/xhdd/u01' is not owned by root. Changing owner to root
    The directory '/xhdd' is not owned by root. Changing owner to root
    Successfully accumulated necessary OCR keys.
    Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
    node <nodenumber>: <nodename> <private interconnect name> <hostname>
    node 1: lrac1 lrac1-priv lrac1
    node 2: lrac2 lrac2-priv lrac2
    Creating OCR keys for user 'root', privgrp 'root'..
    Operation successful.
    Now formatting voting device: /dev/sdd1
    Format of 1 voting devices complete.
    Startup will be queued to init within 30 seconds.
    Adding daemons to inittab
    Expecting the CRS daemons to be up within 600 seconds.
    Cluster Synchronization Services is active on these nodes.
    lrac2
    Cluster Synchronization Services is inactive on these nodes.
    lrac1
    Local node checking complete. Run root.sh on remaining nodes to start CRS daemons.
    Any ideas to solve this issue.
    Thanks in advance,
    Sameer

    I tried reinstalling again and it worked on Vmware Server.Some oracle products are certified on Oracle VM , but not RAC at the moment.
    You can download Oracle VM from otn.oracle.com
    Check ML Note:464754.1 for details about Certified Software on Oracle VM.
    - Virag Sharma
    http://virag.sharma.googlepages.com/

  • Oracle 11g bug ?!

    We are trying to execute a simple query of the form
    select * from sometable where upper(attr1) like 'WB%' or upper(attr2) like 'WB%' or upper(attr3) like 'WB%'
    The data does exist in the table but the query does not return values.
    Sometimes the count(*) on that table returns the correct number but the actual select statement does not return data.
    We have added a dummy where clause
    select * from sometable where upper(attr1) like 'WB%' or upper(attr2) like 'WB%' or upper(attr3) like 'WB%' or lower(attr2) like 'WB%' and the data does show up.
    We are on Oracle 11g 11.2.0.2 and have migrated recently from 10g. And this issue has started appearing after the migration.
    Any thoughts on what could be causing this issue ?
    Thanks
    Surya
    Edited by: Surya on 09-Mar-2011 06:11

    user11180582 wrote:
    We have added a dummy where clause
    select * from sometable where upper(attr1) like 'WB%' or upper(attr2) like 'WB%' or upper(attr3) like 'WB%' or lower(attr2) like 'WB%' and the data does show up. Hm. difficult but I doubt that you have a bug. I guess you have either some strange values or there is something in the full statement that is missing in your example.
    For example please be aware that the AND operator has a higher priority then the OR operator (is this way since oracle 7 at least).
    So if your real statement would include an and condition, this could produce unwanted outcome.
    select * from sometable
    where upper(attr1) like 'WB%'
         or upper(attr2) like 'WB%'
         or upper(attr3) like 'WB%'
         and lower(attr5) = 'XY' This is identical to:
    select * from sometable
    where upper(attr1) like 'WB%'
         or upper(attr2) like 'WB%'
         or (upper(attr3) like 'WB%' and lower(attr5) = 'XY' )But usually you want
    select * from sometable
    where (upper(attr1) like 'WB%' or upper(attr2) like 'WB%' or upper(attr3) like 'WB%')
            and lower(attr5) = 'XY' Some additon. Your condition could also be written like this. Maybe this helps to find the real cause of the error.
    select * from sometable
    where 'WB' in (substr(upper(attr1),1,2)
                       ,substr(upper(attr2),1,2)
                       ,substr(upper(attr3),1,2)
                       )I find this often to be better readable then a long LIKE + OR expression.

  • Oracle 11g AQ : problem enqueue user-defined type with varchar2 attribute

    Hello.
    I have a problem enqueuing a user-defined type to the queue on Oracle 10g.
    I'm using jdbc driver (ojdbc5.jar, version 11.1.0.6.0) as they provide oracle.jdbc.aq package.
    The type is following:
    CREATE OR REPLACE TYPE FIXED_T5 AS OBJECT
    (id integer,
    label varchar2(100),
    code integer,
    today date
    )I have created a java class for this type with jpub utility supplied with oracle 11g client package:
    jpub -user=scott/tger -url=jdbc:oracle:thin:@host:sid-sql=FIXED_T5:ru.invito.FixedType -compile=falseIt generated FixedType.java and FixedTypeRef.java files. Don't understand why i need the latter (FixedTypeRef).
    Then in test app:
    package ru.invito;
    import java.io.IOException;
    import java.net.InetAddress;
    import java.net.UnknownHostException;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.util.Date;
    import java.util.Properties;
    import java.util.UUID;
    import junit.framework.TestCase;
    import oracle.jdbc.aq.AQAgent;
    import oracle.jdbc.aq.AQEnqueueOptions;
    import oracle.jdbc.aq.AQFactory;
    import oracle.jdbc.aq.AQMessage;
    import oracle.jdbc.aq.AQMessageProperties;
    import oracle.jdbc.aq.AQEnqueueOptions.DeliveryMode;
    import oracle.jdbc.aq.AQEnqueueOptions.VisibilityOption;
    import oracle.jdbc.driver.OracleConnection;
    import oracle.jdbc.driver.OracleDriver;
    import oracle.sql.Datum;
    import oracle.sql.STRUCT;
    import oracle.sql.StructDescriptor;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    public class AqTest extends TestCase {
         protected Log logger = LogFactory.getLog(getClass());
         public void testEnqueue() throws Exception {
              OracleDriver dr = new OracleDriver();
              Properties prop = new Properties();
              prop.setProperty("user", Config.USERNAME);
              prop.setProperty("password", Config.PASSWORD);
              OracleConnection connection = (OracleConnection) dr.connect(Config.JDBC_URL, prop);
              assertNotNull(connection);
              connection.setAutoCommit(false);
              enqueueMessage(connection, "INVITO.FIXED_T5Q", null);
              connection.commit();
         private void enqueueMessage(OracleConnection conn, String queueName, AQAgent[] recipients) throws SQLException,
                   IOException {
              logger.debug("----------- Enqueue start ------------");
              AQMessageProperties props = makeProps(queueName);
              AQMessage mesg = AQFactory.createAQMessage(props);
              String msqText = String.format("Hello, %s!", queueName);
              FixedType data = createData(36, msqText);
              Datum d = data.toDatum(conn);
              STRUCT s = (STRUCT) d;
              debugStruct("s", s);
              String toIdStr = byteBufferToHexString(s.getDescriptor().getOracleTypeADT().getTOID(), 20);
              logger.debug("s.toIdStr: " + toIdStr);
              StructDescriptor sd = StructDescriptor.createDescriptor("INVITO.FIXED_T5", conn);
              logger.debug("sd.toXMLString(): " + sd.toXMLString());
              mesg.setPayload(s);
              AQEnqueueOptions opt = makeEnqueueOptions();
              logger.debug("sending............");
              // execute the actual enqueue operation:
              conn.enqueue(queueName, opt, mesg);
              debugMessageId(mesg);
              logger.debug("----------- Enqueue done ------------");
         private void debugMessageId(AQMessage mesg) throws SQLException {
              byte[] mesgId = mesg.getMessageId();
              if (mesgId == null) {
                   throw new IllegalStateException("message id is NULL");
              String mesgIdStr = byteBufferToHexString(mesgId, 20);
              logger.debug("Message ID from enqueue call: " + mesgIdStr);
          * @return
          * @throws SQLException
         private FixedType createData(int ID, String label) throws SQLException {
              FixedType data = new FixedType();
              data._struct.setNChar(1);// initializes the flag for 'label' field
              data.setId(ID);
              data.setLabel(label);
              data.setCode(1);
              Date today = new Date();
              data.setToday(new Timestamp(today.getTime()));
              return data;
          * @param string
          * @param s
          * @throws SQLException
         private void debugStruct(String string, STRUCT s) throws SQLException {
              logger.debug(s + ".debugString(): " + s.debugString());
              logger.debug(s + "s.dump(): " + s.dump());
          * @return
          * @throws SQLException
         private AQAgent makeAgent() throws SQLException {
              AQAgent ag = AQFactory.createAQAgent();
              ag.setName("AQ_TEST");
              String agentAddress = null;
              try {
                   agentAddress = InetAddress.getLocalHost().getHostAddress();
              catch (UnknownHostException e) {
                   logger.error("cannot resolve localhost ip address. will not set it as AQ Agent address");
                   agentAddress = "NA";
              ag.setAddress(agentAddress);
              return ag;
         private AQMessageProperties makeProps(String queueName) throws SQLException {
              final String EXCEPTION_Q_TEMPLATE = "AQ$_%sT_E";
              final int DEFAULT_DELAY = 0;
              final int DEFAULT_EXPIRATION = -1;
              final int DEFAULT_PRIORITY = 0;
              AQMessageProperties propeties = AQFactory.createAQMessageProperties();
              propeties.setCorrelation(UUID.randomUUID().toString());
              propeties.setDelay(DEFAULT_DELAY);
              propeties.setExceptionQueue(String.format(EXCEPTION_Q_TEMPLATE, queueName));
              propeties.setExpiration(DEFAULT_EXPIRATION);
              propeties.setPriority(DEFAULT_PRIORITY);
              // propeties.setRecipientList(null);//should not set
              propeties.setSender(makeAgent());
              return propeties;
          * @return
          * @throws SQLException
         private AQEnqueueOptions makeEnqueueOptions() throws SQLException {
              AQEnqueueOptions opt = new AQEnqueueOptions();
              opt.setRetrieveMessageId(true);
              // these are the default settings (if none specified)
              opt.setDeliveryMode(DeliveryMode.PERSISTENT);
              opt.setTransformation(null);
              opt.setVisibility(VisibilityOption.ON_COMMIT);
              return opt;
          * Form the AQ reference
          * @param buffer
          * @param maxNbOfBytes
          * @return
         private static final String byteBufferToHexString(byte[] buffer, int maxNbOfBytes) {
              if (buffer == null)
                   return null;
              int offset = 0;
              StringBuffer sb = new StringBuffer();
              while (offset < buffer.length && offset < maxNbOfBytes) {
                   String hexrep = Integer.toHexString((int) buffer[offset] & 0xFF);
                   if (hexrep.length() == 1)
                        hexrep = "0" + hexrep;
                   sb.append(hexrep);
                   offset++;
              String ret = sb.toString();
              return ret;
    }The output is following:
    [main] 2008-07-03 19:09:49,863 DEBUG [ru.invito.AqTest] - ----------- Enqueue start ------------
    [main] 2008-07-03 19:09:50,348 DEBUG [ru.invito.AqTest] - [email protected](): name = INVITO.FIXED_T5 length = 4 attribute[0] = 36 attribute[1] = Hell
    o, INVITO.FIXED_T5Q! attribute[2] = 1 attribute[3] = 2008-07-03 19:09:49.0
    [main] 2008-07-03 19:09:50,363 DEBUG [ru.invito.AqTest] - [email protected](): name = INVITO.FIXED_T5
    length = 4
    ID = 36
    LABEL = Hello, INVITO.FIXED_T5Q!
    CODE = 1
    TODAY = 2008-07-03 19:09:49.0
    [main] 2008-07-03 19:09:50,363 DEBUG [ru.invito.AqTest] - s.toIdStr: 507ccce5b6e9f572e040007f01007203
    [main] 2008-07-03 19:09:50,363 DEBUG [ru.invito.AqTest] - sd.toXMLString(): <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <StructDescriptor sqlName="INVITO.FIXED_T5" >
      <OracleTypeADT sqlName="INVITO.FIXED_T5"  typecode="0" tds_version="1"
               is_embedded="false" is_top_level="true" is_upt="false" finalType="true" subtype="false">
        <attributes>
          <attribute name="ID"  type="INTEGER" >
            <OracleType typecode="2" />
          </attribute>
          <attribute name="LABEL"  type="VARCHAR2" >
            <OracleType typecode="12" />
          </attribute>
          <attribute name="CODE"  type="INTEGER" >
            <OracleType typecode="2" />
          </attribute>
          <attribute name="TODAY"  type="DATE" >
            <OracleType typecode="0" />
          </attribute>
        </attributes>
      </OracleTypeADT>
    </StructDescriptor>
    [main] 2008-07-03 19:09:50,379 DEBUG [ru.invito.AqTest] - sending............
    [main] 2008-07-03 19:09:50,395 DEBUG [ru.invito.AqTest] - Message ID from enqueue call: 511ff143bd4fa536e040007f01003192
    [main] 2008-07-03 19:09:50,395 DEBUG [ru.invito.AqTest] - ----------- Enqueue done ------------But when dequeueing the 'label' attribute is lost:
    DECLARE
    dequeue_options     DBMS_AQ.dequeue_options_t;
    message_properties  DBMS_AQ.message_properties_t;
    message_handle      RAW(16);
    message             fixed_t5;
    BEGIN
      dequeue_options.navigation := DBMS_AQ.FIRST_MESSAGE;
      DBMS_AQ.DEQUEUE(
         queue_name          =>     'fixed_t5q',
         dequeue_options     =>     dequeue_options,
         message_properties  =>     message_properties,
         payload             =>     message,
         msgid               =>     message_handle);
      DBMS_OUTPUT.PUT_LINE('ID   : '||message.id);
      DBMS_OUTPUT.PUT_LINE('Label: '||message.label);
      DBMS_OUTPUT.PUT_LINE('Code : '||message.code);
      DBMS_OUTPUT.PUT_LINE('Today: '||message.today);
      COMMIT;
    END;
    ID   : 36
    Label:
    Code : 1
    Today: 03.07.08
    Could anyone tell me what is wrong with the setup/code?
    Why 'label' not saved in queue, though i saw it is not empty in STRUCT?

    Thank you for the reply!
    I have enqueued:
    [main] 2008-07-04 15:30:30,639 DEBUG [ru.invito.UserDefinedTypeAqTest$1] - [email protected](): name = INVITO.FIXED_T5
    length = 4
    ID = 41
    LABEL = Hello, INVITO.FIXED_T5Q!
    CODE = 1
    TODAY = 2008-07-04 15:30:30.0and in table (select * from FIXED_T5QT) the 'label' is blank:
    Q_NAME     FIXED_T5Q
    MSGID     51310809B5EA3728E040007F01000C79
    CORRID     b8f38fd3-4fa6-4e0f-85d1-2440d02d655e
    PRIORITY     0
    STATE     0
    DELAY     
    EXPIRATION     
    TIME_MANAGER_INFO     
    LOCAL_ORDER_NO     0
    CHAIN_NO     0
    CSCN     0
    DSCN     0
    ENQ_TIME     04.07.2008 15:28:44
    ENQ_UID     INVITO
    ENQ_TID                       4012
    DEQ_TIME     
    DEQ_UID     
    DEQ_TID     
    RETRY_COUNT     0
    EXCEPTION_QSCHEMA     AQ$_INVITO
    EXCEPTION_QUEUE     FIXED_T5QT_E
    STEP_NO     0
    RECIPIENT_KEY     0
    DEQUEUE_MSGID     
    SENDER_NAME     AQ_TEST
    SENDER_ADDRESS     10.1.1.137
    SENDER_PROTOCOL     
    USER_DATA.ID     41
    USER_DATA.LABEL     
    USER_DATA.CODE     1
    USER_DATA.TODAY     04.07.2008 15:30:30I must point to a strange thing: when the FixedType instance is created (via new operator) and then the setLabel("....") called as:
    FixedType data = new FixedType();
    // hack: proper initialization for 'label' field
    data._struct.setNChar(1);
    data.setId(ID);
    data.setLabel(label);
    data.setCode(1);
    Date today = new Date();
    data.setToday(new Timestamp(today.getTime()));
    Datum d = data.toDatum(connection);
    STRUCT s = (STRUCT) d;
    logger.debug(s + ".debugString(): " + s.debugString());
    logger.debug(s + ".dump(): " + s.dump());and if i comment line (data._struct.setNChar(1);) the debug messages for created STRUCT also shows empty value for label.
    But if i explicitly call data._struct.setNChar(1) then debug contains the label i defined in call to the setLabel method.

  • The danger of memory target in Oracle 11g - request for discussion.

    Hello, everyone.
    This is not a question, but kind of request for discussion.
    I believe that many of you heard something about automatic memory management in Oracle 11g.
    The concept is that Oracle manages the target size of SGA and PGA. Yes, believe it or not, all we have to do is just to tell Oracle how much memory it can use.
    But I have a big concern on this. The optimizer takes the PGA size into consideration when calculating the cost of sort-related operations.
    So what would happen when Oracle dynamically changes the target size of PGA? Following is a simple demonstration of my concern.
    UKJA@ukja116> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    -- Configuration
    *.memory_target=350m
    *.memory_max_target=350m
    create table t1(c1 int, c2 char(100));
    create table t2(c1 int, c2 char(100));
    insert into t1 select level, level from dual connect by level <= 10000;
    insert into t2 select level, level from dual connect by level <= 10000;
    -- First 10053 trace
    alter session set events '10053 trace name context forever, level 1';
    select /*+ use_hash(t1 t2) */ count(*)
    from t1, t2
    where t1.c1 = t2.c1 and t1.c2 = t2.c2
    alter session set events '10053 trace name context off';
    -- Do aggressive hard parse to make Oracle dynamically change the size of memory segments.
    declare
      pat1     varchar2(1000);
      pat2     varchar2(1000);
      va       number;
      vc       sys_refcursor;
      vs        varchar2(1000);
    begin
      select ksppstvl into pat1
        from sys.xm$ksppi i, sys.xm$ksppcv v   -- views for x$ table
        where i.indx = v.indx
        and i.ksppinm = '__pga_aggregate_target';
      for idx in 1 .. 10000000 loop
        execute immediate 'select count(*) from t1 where rownum = ' || (idx+1)
              into va;
        if mod(idx, 1000) = 0 then
          sys.dbms_system.ksdwrt(2, idx || 'th execution');
          select ksppstvl into pat2
          from sys.xm$ksppi i, sys.xm$ksppcv v   -- views for x$ table
          where i.indx = v.indx
          and i.ksppinm = '__pga_aggregate_target';
          if pat1 <> pat2 then
            sys.dbms_system.ksdwrt(2, 'yep, I got it!');
            exit;
          end if;
        end if;
      end loop;
    end;
    -- As to alert log file,
    25000th execution
    26000th execution
    27000th execution
    28000th execution
    29000th execution
    30000th execution
    yep, I got it! <-- the pga target changed with 30000th hard parse
    -- Second 10053 trace for same query
    alter session set events '10053 trace name context forever, level 1';
    select /*+ use_hash(t1 t2) */ count(*)
    from t1, t2
    where t1.c1 = t2.c1 and t1.c2 = t2.c2
    alter session set events '10053 trace name context off';With above test case, I found that
    1. Oracle invalidates the query when internal pga aggregate size changes, which is quite natural.
    2. With changed pga aggregate size, Oracle recalculates the cost. These are excerpts from the both of the 10053 trace files.
    -- First 10053 trace file
    PARAMETERS USED BY THE OPTIMIZER
      PARAMETERS WITH ALTERED VALUES
    Compilation Environment Dump
    _smm_max_size                       = 11468 KB
    _smm_px_max_size                    = 28672 KB
    optimizer_use_sql_plan_baselines    = false
    optimizer_use_invisible_indexes     = true
    -- Second 10053 trace file
    PARAMETERS USED BY THE OPTIMIZER
      PARAMETERS WITH ALTERED VALUES
    Compilation Environment Dump
    _smm_max_size                       = 13107 KB
    _smm_px_max_size                    = 32768 KB
    optimizer_use_sql_plan_baselines    = false
    optimizer_use_invisible_indexes     = true
    Bug Fix Control Environment10053 trace file clearly says that Oracle recalculates the cost of the query with the change of internal pga aggregate target size. So, there is a great danger of unexpected plan change while Oracle dynamically controls the memory segments.
    I believe that this is a desinged behavior, but the negative side effect is not negligible.
    I just like to hear your opinions on this behavior.
    Do you think that this is acceptable? Or is this another great feature that nobody wants to use like automatic tuning advisor?
    ================================
    Dion Cho - Oracle Performance Storyteller
    http://dioncho.wordpress.com (english)
    http://ukja.tistory.com (korean)
    ================================

    I made a slight modification with my test case to have mixed workloads of hard parse and logical reads.
    *.memory_target=200m
    *.memory_max_target=200m
    create table t3(c1 int, c2 char(1000));
    insert into t3 select level, level from dual connect by level <= 50000;
    declare
      pat1     varchar2(1000);
      pat2     varchar2(1000);
      va       number;
    begin
      select ksppstvl into pat1
        from sys.xm$ksppi i, sys.xm$ksppcv v
        where i.indx = v.indx
        and i.ksppinm = '__pga_aggregate_target';
      for idx in 1 .. 1000000 loop
        -- try many patterns here!
        execute immediate 'select count(*) from t3 where 10 = mod('||idx||',10)+1' into va;
        if mod(idx, 100) = 0 then
          sys.dbms_system.ksdwrt(2, idx || 'th execution');
          for p in (select ksppinm, ksppstvl
              from sys.xm$ksppi i, sys.xm$ksppcv v
              where i.indx = v.indx
              and i.ksppinm in ('__shared_pool_size', '__db_cache_size', '__pga_aggregate_target')) loop
              sys.dbms_system.ksdwrt(2, p.ksppinm || ' = ' || p.ksppstvl);
          end loop;
          select ksppstvl into pat2
          from sys.xm$ksppi i, sys.xm$ksppcv v
          where i.indx = v.indx
          and i.ksppinm = '__pga_aggregate_target';
          if pat1 <> pat2 then
            sys.dbms_system.ksdwrt(2, 'yep, I got it! pat1=' || pat1 ||', pat2='||pat2);
            exit;
          end if;
        end if;
      end loop;
    end;
    /This test case showed expected and reasonable result, like following:
    100th execution
    __shared_pool_size = 92274688
    __db_cache_size = 16777216
    __pga_aggregate_target = 83886080
    200th execution
    __shared_pool_size = 92274688
    __db_cache_size = 16777216
    __pga_aggregate_target = 83886080
    300th execution
    __shared_pool_size = 88080384
    __db_cache_size = 20971520
    __pga_aggregate_target = 83886080
    400th execution
    __shared_pool_size = 92274688
    __db_cache_size = 16777216
    __pga_aggregate_target = 83886080
    500th execution
    __shared_pool_size = 88080384
    __db_cache_size = 20971520
    __pga_aggregate_target = 83886080
    1100th execution
    __shared_pool_size = 92274688
    __db_cache_size = 20971520
    __pga_aggregate_target = 83886080
    1200th execution
    __shared_pool_size = 92274688
    __db_cache_size = 37748736
    __pga_aggregate_target = 58720256
    yep, I got it! pat1=83886080, pat2=58720256Oracle continued being bounced between shared pool and buffer cache size, and about 1200th execution Oracle suddenly stole some memory from PGA target area to increase db cache size.
    (I'm still in dark age on this automatic memory target management of 11g. More research in need!)
    I think that this is very clear and natural behavior. I just want to point out that this would result in unwanted catastrophe under special cases, especially with some logic holes and bugs.
    ================================
    Dion Cho - Oracle Performance Storyteller
    http://dioncho.wordpress.com (english)
    http://ukja.tistory.com (korean)
    ================================

  • OTN for Oracle 11g R2 for Linux x86_64 "See All" link does not work

    I'm trying to view all of the downloads for LInux x86_64 Oracle 11g R2. When I select the link I get the following message:
    An error occurred while processing the request. Try refreshing your browser. If the problem persists contact the site administrator
    Can someone please investigate this issue.
    Thanks

    user457508 wrote:
    An error occurred while processing the request. Try refreshing your browser. If the problem persists contact the site administratorThis is somewhat reminiscent of the problems we faced a few months back. While you are waiting for someone to investigate, you can also try:
    - log out of OTN completely
    - clear all cookies and cached files in your browser
    - log back in again
    - try again

  • Oracle 11g Support For WLS 10 and WLS 9.2

    Hi,
    Does anyone know where I can find out definatively when Weblogic 10 and 9.2 will officially support Oracle 11g ?
    Any official BEA sources here.
    Cheers
    Simon

    There is only one real answer here: test it and test it thoroughly. Asking this question here is pointless, you cannot trust anyone here to give you advice you can rely on. Whatever is said, you have to validate the claims anyway.
    Or did you think that Oracle employees were going to answer your question? If so, you are sadly mistaken. Oracle charges money for giving technical support.

Maybe you are looking for

  • Annotation-Processing Using Custom ClassLoader Fails

    Hi, I have the following problem concerning annotations. I am using Jaxb2 to marshal some classes and Jaxb relies heavily on processing annotation information contained in them. If I put the Jaxb JAR's directly in the classpath everything works fine.

  • How can I buy a ringtone in the iTunes store for my iPhone?

    I want to get a ringtone for my iPhone 5.  How can I download one in itunes? Or can I not do that anymore? What is the best way to get a ringtone for a popular song? Thanks

  • No Results after executing Adaptive Web Service

    Hello experts, I develope Web Dynpro applications and currently try to consume a web service from our ERP system but I get no results from the service. When trying to consume the service with a soap-tool or with .NET, everything works fine. The Web S

  • Cannot organize files manually in a folder

    I am having a problem with a file arrangement in finder (running on Mavericks). So here is a brief explanation: when I open a folder conatining some files, then select those files, go to the "view" menu, then "arrange by" and choose for example "by n

  • Hyperion and ODI Integration

    While integrating Hyperion Essbase and ODI (oracle Data integrator) , can ODI directly read from Hyperion or does Hyperion generates csv through which we can make ODI read . Can some one through some light on this process. since the Oracle documentat