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.

Similar Messages

  • 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

  • Major bugs in oracle 11g 11.1.0.7??

    Hii All,
    We are planning to upgrade to 11g currently we are using
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
               Now we are planning to upgrade to version 11.1.0.7,but heard that it contains many bugs.And our DBA suggest us version 11.2.0.1.0 where all the bugs in the earlier release of 11g got fixed. Is it true?
    These links show that there are some bugs in 11.1.0.7
    http://nilesh-joshi.blogspot.com/2010/06/oracle-111070-bug.html
    http://mikerault.blogspot.com/2009/03/more-fun-with-oracle11g-11107.html
    1)Can any one brief the bugs in the version 11.1.0.7 ???
    2)Let me know whether are all those bugs got fixed in the version 11.2.0.1.0??
    Is this bug oracle 11g needs group by - why? fixed in 11gR2???
    Regards
    Raghu.

    Bottom line - you'll be lucky if you never run into a bug in any release.
    I'd always be hesitant to go with any x.1 release including 11.2.0.1.
    Bear in mind that you're probably not upgrading today but in a few months time.
    11.2.0.2 is available on Linux
    Use Metalink to identify any bugs in any specific feature or release you're interested.
    Doc Id 738538.1 - 11.1.0.7 Patch Set - Availability and Known Issues
    Doc Id - 880707.1 - 11.2.0.1 Base Release - Availability and Known Issues
    Doc ID 1179474.1 - Known issues specific to 11.2.0.2
    Doc ID 1178583.1 - Bugs fixed in the 11.2.0.2 Patch Set

  • BUG for sort column with Oracle 11g and APEX 3.2

    I have BUG in Report region(Oracle 11g and APEX 3.2). if i have more than 746 Char for my column's value and i want to sort them, this error appear
    Report error :
    ORA-00910: specified length too long for its datatype.
    But in an other environement in Oracle 10g and apex 3.2, with the same data. I have no BUG.
    Somebody have an idea for a possible solution to this problem???

    Again, I may just be wasting your time...but if I have XDB problems...especially with the password, I do the following:
    1. Change your working directory to $ORACLE_HOME/apex.
    2. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS.
    3. Run apxconf.sql
    > @apxconf
    4. When prompted, enter a password for the Oracle Application Express Admin account.
    5. When prompted, enter the port for the Oracle XML DB HTTP server. (default port being, of course,8080).
    6. Unlock the ANONYMOUS account
    > ALTER USER ANONYMOUS ACCOUNT UNLOCK;
    7. If needed, I do the SETHTTPPORT command mentioned before...
    Since I'm using the Oracle 11g, with embedded PL/SQL server, I have no idea if this is the same for 10g us OHS?
    Hope that helps!
    KSL.

  • Enterprise manager version with Oracle 11g

    Which version of Enterprise Manager do I need to install with 64 bit Oracle 11g. What is the latest version? Where can I get this information. The latest version that I could find for download on Oracle website is 10.2.0.4, but the one that comes with 11g Enterprise edition says 11.1 (the one without the Grid control).

    The latest grid control is 10.2.0.4 - note that you have to turn off instance status metric or you get too many files open - a bug that they are doing a patch for.
    You are correct thou - 11g DB control is bundled with the db, but that is db control not grid control - a similar but unique product.

  • 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)
    ================================

  • Oracle 11g - Problem in referring ROWNUM in the SQL

    Hello All,
    We are facing a strange problem with Oracle 11g (11.2.0.1.0).
    When we issue a query which refers the rownum, it returns a invalid record ( which is not exists in the table).
    The same sql is working fine once we analyze the table
    Note: The same sql is working fine with oracle 10g (Before analyze also).
    The script to reproduce the issue:
    DROP TABLE BusinessEntities;
    CREATE TABLE BusinessEntities
    business_entity_id VARCHAR2(25) PRIMARY KEY,
    business_entity_name VARCHAR2(50) NOT NULL ,
    owner_id VARCHAR2(25) ,
    statutory_detail_id NUMBER ,
    address_id NUMBER NOT NULL
    DROP TABLE BusEntityRoles;
    CREATE TABLE BusEntityRoles
    business_entity_id VARCHAR2(25) NOT NULL,
    role_id VARCHAR2(10) NOT NULL,
    PRIMARY KEY (business_entity_id, role_id)
    INSERT
    INTO businessentities ( business_entity_id , business_entity_name, owner_id , statutory_detail_id , address_id)
    VALUES
    ( 'OWNER', 'OWNER Corporation Ltd', NULL , 1, 1 );
    INSERT
    INTO businessentities ( business_entity_id , business_entity_name, owner_id , statutory_detail_id , address_id)
    VALUES
    ( 'ALL_IN_ALL', 'ALL IN ALL Corporation Ltd', 'OWNER' , 2, 2 );
    INSERT INTO busentityroles(business_entity_id, role_id) VALUES ('TEST' , 'OWNER');
    INSERT INTO busentityroles (business_entity_id,role_id) VALUES ('TEST','VENDOR');
    INSERT INTO busentityroles(business_entity_id, role_id) VALUES ('ALL_IN_ALL' , 'VENDOR');
    SELECT *
    FROM
    (SELECT raw_sql_.business_entity_id, raw_sql_.business_entity_name, raw_sql_.owner_id, raw_sql_.address_id,
    rownum raw_rnum_
    FROM
    (SELECT *
    FROM BusinessEntities
    WHERE (business_entity_id IN
    (SELECT business_entity_id
    FROM BusinessEntities
    WHERE business_entity_id = 'OWNER'
    OR owner_id = 'ALL_IN_ALL'
    AND business_entity_id NOT IN
    (SELECT business_entity_id FROM BusEntityRoles
    ORDER BY business_entity_id ASC
    ) raw_sql_
    WHERE rownum <= 5
    WHERE raw_rnum_ > 0;
    OUTPUT Before Analyzing
    BUSINESS_ENTITY_ID: OWNER
    BUSINESS_ENTITY_NAME: NULL
    OWNER_ID: OWNER
    ADDRESS_ID: NULL
    RAW_RNUM_: 1
    Note: There is no record in the table with the value business_entity_id as 'OWNER' and OWNER_ID as 'OWNER' and the address_id as NULL
    OUTPUT : After analyzed the table Using the below mentioned command
    ANALYZE TABLE "BUSENTITYSUPPLYCHAINROLES" ESTIMATE STATISTICS
    ANALYZE TABLE "BUSINESSENTITIES" ESTIMATE STATISTICS
    BUSINESS_ENTITY_ID: OWNER
    BUSINESS_ENTITY_NAME: OWNER Corporation Ltd
    OWNER_ID: NULL
    ADDRESS_ID: 1
    RAW_RNUM_: 1
    Any clue why Oracle 11g is behaving like this.

    Hi,
    it's a good practice to give aliases for tables, as well as name query blocks. Here it is (and formatted for convinience):
    select --/*+ gather_plan_statistics optimizer_features_enable('10.2.0.4') */
      from (select /*+ qb_name(v2) */
                   raw_sql_.business_entity_id
                  ,raw_sql_.business_entity_name
                  ,raw_sql_.owner_id
                  ,raw_sql_.address_id
                  ,rownum raw_rnum_
              from (select /*+ qb_name(v1) */ *
                      from businessentities b1
                     where (b1.business_entity_id in
                           (select /*+ qb_name(in) */ b2.business_entity_id
                               from businessentities b2
                              where business_entity_id = 'OWNER'
                                 or owner_id = 'ALL_IN_ALL'
                                and business_entity_id not in
                                   (select /*+ qb_name(not_in) */ r.business_entity_id from busentityroles r)))
                     order by business_entity_id asc) raw_sql_
             where rownum <= 5)
    where raw_rnum_ > 0;You are facing some bug - definitely - and, possibly, it is caused by [join elimination|http://optimizermagic.blogspot.com/2008/06/why-are-some-of-tables-in-my-query.html]. As a workaround you should rewrite the query to eliminate unnecessary join manually; or you may include a hint to not eliminate join (it's not documented):
    SQL>
    select -- /*+ gather_plan_statistics optimizer_features_enable('10.2.0.4') */
      from (select /*+ qb_name(v2)  */
                   raw_sql_.business_entity_id
                  ,raw_sql_.business_entity_name
                  ,raw_sql_.owner_id
                  ,raw_sql_.address_id
                  ,rownum raw_rnum_
              from (select /*+ qb_name(v1) no_eliminate_join(b1) */ *
                      from businessentities b1
                     where (b1.business_entity_id in
                           (select /*+ qb_name(in) */ b2.business_entity_id
                               from businessentities b2
                              where business_entity_id = 'OWNER'
                                 or owner_id = 'ALL_IN_ALL'
                                and business_entity_id not in
                                   (select /*+ qb_name(not_in) */ r.business_entity_id from busentityroles r)))
                     order by business_entity_id asc) raw_sql_
             where rownum <= 5)
    20   where raw_rnum_ > 0;
    BUSINESS_ENTITY_ID        BUSINESS_ENTITY_NAME                               OWNER_ID                  ADDRESS_ID  RAW_RNUM_
    OWNER                     OWNER Corporation Ltd                                                                 1          1Strange thing is executing a transformed query gives correct result too:
    SELECT "from$_subquery$_001"."BUSINESS_ENTITY_ID" "BUSINESS_ENTITY_ID",
           "from$_subquery$_001"."BUSINESS_ENTITY_NAME" "BUSINESS_ENTITY_NAME",
           "from$_subquery$_001"."OWNER_ID" "OWNER_ID",
           "from$_subquery$_001"."ADDRESS_ID" "ADDRESS_ID",
           "from$_subquery$_001"."RAW_RNUM_" "RAW_RNUM_"
      FROM  (SELECT /*+ QB_NAME ("V2") */
                    "RAW_SQL_"."BUSINESS_ENTITY_ID" "BUSINESS_ENTITY_ID",
                    "RAW_SQL_"."BUSINESS_ENTITY_NAME" "BUSINESS_ENTITY_NAME",
                    "RAW_SQL_"."OWNER_ID" "OWNER_ID","RAW_SQL_"."ADDRESS_ID" "ADDRESS_ID",
                    ROWNUM "RAW_RNUM_"
               FROM  (SELECT /*+ QB_NAME ("V1") */
                            "SYS_ALIAS_1"."BUSINESS_ENTITY_ID" "BUSINESS_ENTITY_ID",
                            "SYS_ALIAS_1"."BUSINESS_ENTITY_NAME" "BUSINESS_ENTITY_NAME",
                            "SYS_ALIAS_1"."OWNER_ID" "OWNER_ID",
                            "SYS_ALIAS_1"."STATUTORY_DETAIL_ID" "STATUTORY_DETAIL_ID",
                            "SYS_ALIAS_1"."ADDRESS_ID" "ADDRESS_ID"
                       FROM "TIM"."BUSINESSENTITIES" "SYS_ALIAS_1"
                      WHERE ("SYS_ALIAS_1"."BUSINESS_ENTITY_ID"='OWNER'
                          OR "SYS_ALIAS_1"."OWNER_ID"='ALL_IN_ALL' AND  NOT
                             EXISTS (SELECT /*+ QB_NAME ("NOT_IN") */ 0
                                       FROM "TIM"."BUSENTITYROLES" "R"
                                      WHERE "R"."BUSINESS_ENTITY_ID"="SYS_ALIAS_1"."BUSINESS_ENTITY_ID")
                      ORDER BY "SYS_ALIAS_1"."BUSINESS_ENTITY_ID") "RAW_SQL_"
             WHERE ROWNUM<=5) "from$_subquery$_001"
    26   WHERE "from$_subquery$_001"."RAW_RNUM_">0
    27  /
    BUSINESS_ENTITY_ID        BUSINESS_ENTITY_NAME                               OWNER_ID                  ADDRESS_ID  RAW_RNUM_
    OWNER                     OWNER Corporation Ltd                                                                 1          1

  • Oracle 11g Linguistic NLS SORT Throws Exception

    Hi All,
    I am using oracle 11g and when i try NLS_Sort with Generic_m option, throws ORA-00910 exception. See below for more details
    Select * From v$version
    1 Oracle Database 11g Release 11.1.0.6.0 - Production
    2 PL/SQL Release 11.1.0.6.0 - Production
    3 CORE 11.1.0.6.0 Production
    4 TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    5 NLSRTL Version 11.1.0.6.0 - Production
    Select * From v$NLS_PARAMETERS;
    1 NLS_LANGUAGE AMERICAN
    2 NLS_TERRITORY AMERICA
    3 NLS_CURRENCY $
    4 NLS_ISO_CURRENCY AMERICA
    5 NLS_NUMERIC_CHARACTERS .,
    6 NLS_CALENDAR GREGORIAN
    7 NLS_DATE_FORMAT DD-MON-RR
    8 NLS_DATE_LANGUAGE AMERICAN
    9 NLS_CHARACTERSET WE8MSWIN1252
    10 NLS_SORT    BINARY
    11 NLS_TIME_FORMAT HH.MI.SSXFF AM
    12 NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    13 NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    14 NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    15 NLS_DUAL_CURRENCY $
    16 NLS_NCHAR_CHARACTERSET AL16UTF16
    17 NLS_COMP    BINARY
    18 NLS_LENGTH_SEMANTICS BYTE
    19 NLS_NCHAR_CONV_EXCP FALSE
    I have one table 'Test' in that column TestDesc varchar2(4000). Now if i retrieve the records by
    select sts, it is successfully executed. The same if i do after exec of the below sts, it is
    throwing ORA-00910:specified length too long for its datatype.
    1. ALTER SESSION SET NLS_SORT=GENERIC_m;
    2. Select * From Test order by TestDesc; (It is throwing ORA-00910 exception)
    But the same query/setup is executed successfully in oracle 10g.
    My question:
    Why it is throwing this exception especially in 11g?
    Do i need to excute any alter sts like changing of charactor set..
    Kindly help me to sove this issue.

    Does that mean that 11.2.0.1 (without pse), NLSSORT does not work as intended (documented)?
    Correct. At least, if the related information in bug reports is correct.
    Is there in 11.2.0.2 still silent truncation instead of "... calculates the collation key for a maximum prefix", if there's a difference?
    There is no difference. The term "silent truncation" is not really precise, so the documentation describes the process in a more elaborate way.
    Shouldn't docs mention that a "calculated result" could mean that sorts may sometimes be out of sequence (in-exact collation)?
    Yes, it should. It is sometimes too easy to assume that things obvious to oneself are also obvious to anybody else ;-) I have asked for the following explanation to be added after the relevant doc paragraph:
    "The above behavior implies that two character values whose collation keys (NLSSORT results) are compared to find the linguistic ordering are considered equal if they do not differ in the prefix described above even though they may differ at some further character position. As the NLSSORT function is used implicitly to find linguistic ordering for comparison conditions, BETWEEN condition, IN condition, ORDER BY, GROUP BY, and COUNT(DISTINCT), those operations may return results that are only approximate for long character values. This is a restriction of the current comparison architecture. Currently, the only way to guarantee precise linguistic comparison results is to not compare character values that are longer than 499 characters for monolingual collations and 124 characters for multilingual collations."
    -- Sergiusz
    Edited by: S. Wolicki, Oracle on May 5, 2011 1:17 PM
    Lowered the pessimistic length for multilingual sorts from 249=floor((2000-3)/8) to 124=floor((2000-3)/16)

  • Create PDF report with APEX and Oracle 11g doesn't work

    Hi everyone,
    I have a problem with the downloading of PDF reports from APEX with Oracle 11g.
    When I try to download a PDF, Acrobat Reader says it can not open the file.
    I have done the same test in an environment with APEX and Oracle 10g and it works perfectly.
    Does anyone know if there is a known bug for version 11g.
    Thank you very much.

    Hi Munky,
    I open the generated file the Notepad++ I can read the next message:
    *<HTML><HEAD><TITLE>500 Internal Server Error</TITLE></HEAD><BODY><H1>500 Internal Server Error</H1>OracleJSP:*
    An error occurred. Consult your application/system administrator for support. Programmers should consider setting the init-param <code>debug_mode</code> to "true" to see the complete exception message.</BODY></HTML>
    I have not idea can I solve the problem.
    Have you got any solution for this problem??
    Thank you so much.
    Victor Muñoz.

  • Anyone using Drupal 7 with Oracle 11g?

    I am currently with a group that fields PHP applications on top of Oracle 11g databases. We currently use OCI8 in a RHEL6/Apache environment for our homegrown PHP apps and sites. We are looking at using Drupal 7 to help stream-line our development process as well as make our web apps a bit more visually appealing. (engineers not artists here!).
    The problem we have run into is that it seems Drupal 7 does not see or recognize the OCI8 driver as valid for its install. It apparently wants us to use PDO_OCI which we have no experience with.
    Does anyone out there run a Drupal 7/Oracle 11g combo that could share their experiences and which driver they use? My googling of the subject has led me to believe the PDO driver may be inferior in some respects to OCI8 for BLOB handling. This is a concern as we do a lot of user upload file sharing as BLOBs stored in the database rather than as files on the OS.
    Thank you.

    Drupal needs PDO and won't work with native drivers like OCI8. Contact Andrea Gariboldi, the maintainer of the Oracle adapter for Drupal http://drupal.org/project/oracle. He maintains a number of customer sites running Drupal. He will be able to help you make a decision.
    The main PDO_OCI issues with LOBs are: (1) no CLOB support due to original creator being unsure how to handle CLOBs in a portable way across all databases (2) a crash doing multi-row fetches of BLOBs (potential patch in https://bugs.php.net/bug.php?id=57702)
    There are other issues with PDO_OCI including no connection pooling and no statement caching. It's a pity the community interest in PDO_OCI hasn't been greater and so no one is maintaining it. Even the core PDO layer isn't getting much attention - there was idle talk recently about moving PHP away from PDO.

  • Storing more than 2000 characters in a varchar2 column in Oracle 11g?

    We have a table in Oracle 11g with a varchar2 column. We use a proprietary programming language where this column is defined as string. Maximum we can store 2000 characters (4000 bytes) in this column. Now the requirement is such that the column needs to store more than 2000 characters. The DBAs don't like BLOB, CLOB or LONG datatypes for maintenance reasons.
    There are 2 solutions I can think of -
    1. Remove this column from the original table and have a separate table for this column and then store each character in a row, in order to get more than 2000 characters. This table will be joined with the original table for queries.
    2. If maximum I need is 8000 characters, can I just add 3 more columns so that I will have 4 columns with 2000 char each to get 8000 chars. So when the first column is full, values would be spilled over to the next column and so on.
    Which one is a better and easier approach? Please suggest.

    Visu - Some people also do not like to use LOBs because of difficulty in reclaiming space and ever increasing LOB segments. Some of these problems were caused by Oracle bugs (eg, Bug 2944866 Free space in LOB table / tablespace not reused with ASSM, Bug 3019979 Space may not be reused efficiently in a LOB segment) - albeit in 9.2. I've seen a few bug reports for similar things in 10.2 (don't have the references). Still, if there is a workaround/patch is this reason enough to steer the application development into a new direction?

  • Not a GROUP BY expression - Oracle 10g bug?

    Hi,
    I am geting 00979. 00000 - "not a GROUP BY expression" error on Oracle 10g 10.2.0.4.0 - 64bit Production.
    To illustrate my problem I created following example.
    Let think I have some shop with clothes. Everytime I sell something, I store this information in the database - storing actual time, clothes type (trousers, socks, ...) and the size of the piece (M, L, XL, ...).
    Now, system counts statistics every hour. So it goes thrue the table with sold pieces and counts the number of pieces per clothes type and per size from the beginning of the day. It is important to realize that it is from the beginning of the day. Because of that, the number of sold pieces in the statistical table grows every hour (or is at least on the same value as in previous hour).
    Now, from this statistical table I need to make new statistic. I want a statistic how many pieces per size I sold every hour.
    I created this query for that:
    SELECT TIME, xSIZE, (SOLD  - NVL((SELECT SUM(S1.SOLD)
                                      FROM STATISTICS S1
                                      WHERE S1.xSIZE = S.xSIZE
                                        AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
                                        AND TO_CHAR(S1.TIME, 'HH24') != '23'
                                        AND S1.xSIZE IS NOT NULL
                                      GROUP BY TRUNC(S1.TIME, 'HH24'), S1.xSIZE),0)) SOLD
    FROM(
    SELECT TRUNC(S.TIME, 'HH24') TIME, S.xSIZE, SUM(S.SOLD) SOLD
    FROM STATISTICS S
    WHERE S.xSIZE IS NOT NULL
    GROUP BY TRUNC(S.TIME, 'HH24'), S.xSIZE
    --ORDER BY 1 DESC
    ) S
    ORDER BY TIME DESC, xSIZE ASCFirst I select number of sold pieces per hour per size. To get number of sold pieces for particular hour, I need to substract from this value number of sold pieces from previous hour. I decided to do this with parameter query...
    Running the query like this I get "not a GROUP BY expression" error. However if I uncomment the "ORDER BY 1 DESC" statement, the query works. I am pretty sure it has to do something with this line:
    AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
    If you modify this query like this:
    SELECT TIME, xSIZE, (SOLD  - NVL((SELECT SUM(S1.SOLD)
                                      FROM STATISTICS S1
                                      WHERE S1.xSIZE = S.xSIZE
                                        --AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
                                        AND TO_CHAR(S1.TIME, 'HH24') != '23'
                                        AND S1.xSIZE IS NOT NULL
                                      GROUP BY  S1.xSIZE),0)) SOLD
    FROM(
    SELECT TRUNC(S.TIME, 'HH24') TIME, S.xSIZE, SUM(S.SOLD) SOLD
    FROM STATISTICS S
    WHERE S.xSIZE IS NOT NULL
    GROUP BY TRUNC(S.TIME, 'HH24'), S.xSIZE
    --ORDER BY 1 DESC
    ) S
    ORDER BY TIME DESC, xSIZE ASCRemoved joining the tables on truncated time and grouping by the truncated time -> The query does not fail...
    And now the best...if you run the first query on Oracle 11g (Release 11.1.0.6.0 - 64bit Production), it works.
    Does anybody know why is the first query not working on 10g? Is there some bug or limitation for this server version?
    Please don't say me to rewrite the query in another way, I already did it, so it works on 10g as well. I am just curious why it doesn't work on 10g.
    Finally here are some data for testing.
    CREATE TABLE STATISTICS(
      TIME DATE DEFAULT SYSDATE,
      TYPE VARCHAR2(20),
      xSIZE VARCHAR2(2),
      SOLD NUMBER(5,0) DEFAULT 0
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'T-Shirt', 'M', 10);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'M', 3);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'T-Shirt', 'L', 1);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'L', 50);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Trousers', 'XL', 7);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'XL', 3);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'T-Shirt', 'M', 13);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Socks', 'L', 60);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Trousers', 'XL', 15);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Socks', 'XL', 6);Edited by: user12047225 on 20.9.2011 23:12
    Edited by: user12047225 on 20.9.2011 23:45

    It is a known issue when optimizer decides to expand in-line view. You can add something (besides ORDER BY you already used) to in-line view to prevent optimizer from expanding it. For example:
    SQL> SELECT  TIME,
      2          xSIZE,
      3          (SOLD - NVL(
      4                      (
      5                       SELECT  SUM(S1.SOLD)
      6                         FROM  STATISTICS S1
      7                         WHERE S1.xSIZE = S.xSIZE
      8                           AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
      9                           AND TO_CHAR(S1.TIME, 'HH24') != '23'
    10                           AND S1.xSIZE IS NOT NULL
    11                           GROUP BY TRUNC(S1.TIME, 'HH24'),
    12                                    S1.xSIZE
    13                      ),
    14                      0
    15                     )
    16          ) SOLD
    17    FROM  (
    18           SELECT  TRUNC(S.TIME, 'HH24') TIME,
    19                   S.xSIZE,
    20                   SUM(S.SOLD) SOLD
    21             FROM  STATISTICS S
    22             WHERE S.xSIZE IS NOT NULL
    23             GROUP BY TRUNC(S.TIME, 'HH24'),
    24                      S.xSIZE
    25           --ORDER BY 1 DESC
    26          ) S
    27    ORDER BY TIME DESC,
    28             xSIZE ASC
    29  /
             SELECT  TRUNC(S.TIME, 'HH24') TIME,
    ERROR at line 18:
    ORA-00979: not a GROUP BY expression
    SQL> SELECT  TIME,
      2          xSIZE,
      3          (SOLD - NVL(
      4                      (
      5                       SELECT  SUM(S1.SOLD)
      6                         FROM  STATISTICS S1
      7                         WHERE S1.xSIZE = S.xSIZE
      8                           AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
      9                           AND TO_CHAR(S1.TIME, 'HH24') != '23'
    10                           AND S1.xSIZE IS NOT NULL
    11                           GROUP BY TRUNC(S1.TIME, 'HH24'),
    12                                    S1.xSIZE
    13                      ),
    14                      0
    15                     )
    16          ) SOLD
    17    FROM  (
    18           SELECT  TRUNC(S.TIME, 'HH24') TIME,
    19                   S.xSIZE,
    20                   SUM(S.SOLD) SOLD,
    21                   ROW_NUMBER() OVER(ORDER BY SUM(S.SOLD)) RN
    22             FROM  STATISTICS S
    23             WHERE S.xSIZE IS NOT NULL
    24             GROUP BY TRUNC(S.TIME, 'HH24'),
    25                      S.xSIZE
    26           --ORDER BY 1 DESC
    27          ) S
    28    ORDER BY TIME DESC,
    29             xSIZE ASC
    30  /
    TIME      XS       SOLD
    20-SEP-11 L           9
    20-SEP-11 M           0
    20-SEP-11 XL         11
    20-SEP-11 L          51
    20-SEP-11 M          13
    20-SEP-11 XL         10
    6 rows selected.
    SQL> Or use subquery factoring (WITH clause) + undocumented hint MATERIALIZE:
    SQL> WITH S AS (
      2             SELECT  /*+ MATERIALIZE */ TRUNC(S.TIME, 'HH24') TIME,
      3                     S.xSIZE,
      4                     SUM(S.SOLD) SOLD
      5               FROM  STATISTICS S
      6               WHERE S.xSIZE IS NOT NULL
      7               GROUP BY TRUNC(S.TIME, 'HH24'),
      8                        S.xSIZE
      9             --ORDER BY 1 DESC
    10            )
    11  SELECT  TIME,
    12          xSIZE,
    13          (SOLD - NVL(
    14                      (
    15                       SELECT  SUM(S1.SOLD)
    16                         FROM  STATISTICS S1
    17                         WHERE S1.xSIZE = S.xSIZE
    18                           AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
    19                           AND TO_CHAR(S1.TIME, 'HH24') != '23'
    20                           AND S1.xSIZE IS NOT NULL
    21                           GROUP BY TRUNC(S1.TIME, 'HH24'),
    22                                    S1.xSIZE
    23                      ),
    24                      0
    25                     )
    26          ) SOLD
    27    FROM  S
    28    ORDER BY TIME DESC,
    29             xSIZE ASC
    30  /
    TIME      XS       SOLD
    20-SEP-11 L           9
    20-SEP-11 M           0
    20-SEP-11 XL         11
    20-SEP-11 L          51
    20-SEP-11 M          13
    20-SEP-11 XL         10
    6 rows selected.
    SQL> SY.

  • Oracle Designer 10g With Oracle 11g DB possible

    Hi,
    Please clarify my below query,
    we are currently using oracle designer 10g and deploying the components to production DB which is in oracle 9i, We are planning to migrate to oracle supported version 11g DB, since oracle designer 11g is not there we would be sticking to oracle 10g itself, Now my question is, will we be having issues or road blocks with this combination Oracle designer 10g and Oracle 11g DB???
    Regards
    Bala

    @Erik
    Don't have a doc id. You have to go to the certication tab in My Oracle Support. Search for Oracle Designer 10.1.2.6.0 there you will find the three supported database version.
    Oracle Designer 10.1.2.6.0 is certified with Oracle Database 11.2.0.1.0 on Microsoft Windows (32-bit) XP
    Oracle Designer 10.1.2.6.0 with Oracle Database 11.2.0.1.0
    Customers must review MetaLink Doc 1299040.1 Application Design Transformer Hangs at 65% when running against Oracle 11gR2
    Certified with:
    Oracle Fusion Middleware 10g 10.1.2.0.2 Oracle Developer Suites 10g 10.1.2.0.2 Oracle AS/DS Patch Set 10g 10.1.2.3.0
    @Bala
    Colleagues of mine have imported a designer repository inside 11gR2 and where not able to change objects inside the repository. When they imported the same designer dump inside an 11gR1 database it worked fine.
    In the other post (Re: 11G compatibility it is also written that there are some major bugs and those bugs will not be fixed.

  • Oracle 11g for Visual Studio 2008

    I installed llg four(4) times and get the same result: I can't get a Data Connection!!! There is no other Oracle version on this computer and I've cleaned up the registry on all four installs. In order to run SQL*NET you must first have a Data Connection! Can someone that has experience with Visual Studio and Oracle 11g installation please tell me what I'm doing wrong? HELP! PLEASE, email me directly at: [email protected] Thanks. Any documentation would be helpful.

    Excellent test case, may by you should raise an SR and hope it ends up as a bug.
    What happens if you "ping box01.data.local" what IP Address do you get back? You should be looking to get back the loopback address.
    What happens if you do a nslookup 192.168.30.64 and 192.168.1.100?
    Have you tred setting ORACLE_HOSTNAME? Not sure if this is just for the installer or not.

  • 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...

Maybe you are looking for

  • Migration of an existing web site to Web Page Composer

    Hello, I am investigating the options and the feasibility of the migration of an existing web site to a Web Page Composer (WPC) site. The web resources of the site can easily be copied to KM and used afterwards in WPC containers. However, they can ne

  • How do I get rid of the version I have and get an earlier one.

    Firefox keeps freezing on me. I have been on the forums and done all the things that are suggested there but it still happens. It has only happened since I installed the latest version but I can't find out how to install a previous version. Please ca

  • Is there a 64-bit version of the Firefox 4 release candidate?

    I've been using the 64-bit nightly builds and wanted to switch over to the RC that was just released, however, I was only able to download the 32-bit version of the browser. Is there a location where I can download the 64-bit version?

  • Forcing Software Updates

    We just finished our patch cycle.  Now we had a client update MSIE to version 11.  I see in WindowsUpdate.log that he applied the update to MSIE version 9 during our patch pilot last week. We run software updates using Task Sequences, so our deployme

  • Text messages not being sent to other iphones

    I recently downloaded ios7 and the second update onto my iphone 4. Worked fine to start with but it will now automatically send a text message to another iphone (no problem with any other type of phone).