How to fix ORA-01502: index or partition of such index is in usable state?

Greetings,
I received the ORA-01502: index or partition of such index is in un-usable state from one of our Oracle forms, and the problem was caused by using SQL Loader w/ the "DIRECT" load option. As a result of that, the system won't allow any updates including insert/delete to the problematic table w/ the index in un-usable state. I am trying to fix the problem but so far no luck:
When I tried to delete the duplicate rows from the table, I received the ORA-01502: index or partition of such index is in un-usable state error message;
When I tried to rebuild the index by using the following command:
ALTER INDEX index_name REBUILD
I received the "ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
Any help, suggestions or advice on this would be greatly appreciated.
Thanks millions in advance!

The duplicate key rows were inserted to the database by using the DIRECT parameter of the sql loader to specify direct path loading which bypasses integrity constraints. Since the issue exists in our production database and I am primarily an A/P w/ some responsibilities of DBA , I could really use your help to fix our production problem. I would really appreciate if you or any other guru could review my plan and code below for the fixes followed w/ some questions and give me your feedback/comments/suggestions as soon as possible:
1 - Drop the offending index by using the following command:
DROP INDEX <offending index name>
2 - Run the following script to detect duplicate rows:
SELECT *
FROM <Table_Name> A
WHERE
A.rowid >
any(SELECT B.rowid FROM <Table_Name> B
WHERE
B.KEY1 = A.KEY1
and
B.KEY2 = A.KEY2
and
B.KEY3 = A.KEY3
and
B.KEY4 = A.KEY4
3.  Run the following script to remove the duplicates:
DELETE
FROM <Table_Name> A
WHERE
A.rowid >
any(SELECT B.rowid FROM <Table_Name> B
WHERE
B.KEY1 = A.KEY1
and
B.KEY2 = A.KEY2
and
B.KEY3 = A.KEY3
and
B.KEY4 = A.KEY4
4 - Rebuild the index by using the following line command:
ALTER INDEX index_name REBUILDBut wait, how about data? Don't I need to back up and reload the data? Do I need to drop and recreate the table? Anything else I should be taking into considerations?
p.s. Although, we only have a total of 35,736 rows of data from this table, but I want to make sure I do it right the first time.
Thanks a lot and any/all the help!

Similar Messages

  • ORA-01502: Index or Partition is in unusable status. while truncating table

    Hi All,
    One of our Devlopers compalined that he is getting ORA-01502 : Index or partition is unusable status while truncating the a table in our Dataware house production database. He is using the following commands.
    Alter index <index_name> unusable;
    Truncate table <table_name> ;
    He is running a scripts to truncate each table and ecah time he is passing the table name as an input parameter to script. He is using same method to truncate four tables each having a BITMAP and a REGULAR index. For two tables every thing is working fine, but for other two tables the he is getting ORA-01502 for BITMAP indexes. It a weekly process and every week he is getting the same issue. I checkd the Index status, they are in valid status only.
    For a work around I have created a table with BITMAP and regular index in our dev database. made the indexes unusable, checked their status. I truncated the table. Importent thing here is the Indexes are becoming vaild when I truncate the table.
    I suspect that my devloper's Indexes were already in unusable status (before he use the command ALTER INDEX), when he truncated the table, oracle trying to validate the index and throwing the error ORA-01502 because the Indexes are in unusabel statsu for a while.
    I tried searching for the mechanism of truncate table command and its effect on Indexes. But I did not find any luck, no one is speaking about index when truncating the table. Can any one please help me????
    Sorry for lengthy post. Any help is greatly appriciated and I thank every one in advance.

    DDL for Indexes getting ORA-01502 error
    CREATE BITMAP INDEX DWHMGR.ACT_TXN_LN_STG_01_XN3 ON DWHMGR.ACCT_TXN_LINE_TERM_BAL_STG_01 (TERM_BAL_CD ASC) TABLESPACE "BALFD_INX_04" NOLOGGING PCTFREE 1 INITRANS 2 MAXTRANS 255 STORAGE
    ( INITIAL 8M NEXT 8M MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT );
    CREATE BITMAP INDEX DWHMGR.ACCT_TERM_BAL_STG_01_XN3 ON DWHMGR.ACCT_TERM_BAL_STG_01 TERM_BAL_CD ASC) TABLESPACE "BALFD_INX_04" NOLOGGING PCTFREE 1 INITRANS 2 MAXTRANS 255 STORAGE
    ( INITIAL 8M NEXT 8M MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT );
    Indexes that have no issues.
    CREATE INDEX DWHMGR.ACCT_TERM_BAL_STG_01_XN2 ON DWHMGR.ACCT_TERM_BAL_STG_01 (ACCT_REF_NB ASC) TABLESPACE "BALFD_INX_04" NOLOGGING PCTFREE 1 INITRANS 2 MAXTRANS 255 STORAGE (INITIAL 8M
    NEXT 8M MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT );
    CREATE BITMAP INDEX DWHMGR.ACCT_PRC_STG_01_XN1 ON DWHMGR.ACCT_PRC_STG_01 (ACCT_ORG_CD ASC) TABLESPACE "BALFD_INX_04" NOLOGGING PCTFREE 1 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 8M
    NEXT 8M MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT );
    Please look at the DDL of the indexes and let me know if you need any other information.

  • ORA-01502 : index SYS.I_PROCEDURE1 is in unusable state

    Oracle EE 9.2.0.8 on Windows 2003 SP2
    Some SYS tables where moved by mistake with statement : "alter table sys.xxx move tablespace system;"
    This caused some unusable SYS indexes but I cannot rebuild them. Each time I get same error :
    ORA-01502: index 'SYS.I_PROCEDURE1' or partition of such index is in unusable state
    Tracing showed me that some recursive SQL is going on and that fails because of the unusable index I_PROCEDURE1
    This is the recursive sql who fails :
    SQL> select audit$,options from procedure$ where obj#=115;
    ERROR at line 1:
    ORA-01502: index 'SYS.I_PROCEDURE1' or partition of such index is in unusable state
    How do get out of this situation ?
    Have already tried without succes :
    - alter session set skip_unusable_indexes=true;
    - altered some parameters to favor full table scans (optimizer_mode, db_file_multi_block_read_count
    - tried to drop index (same error)
    Thanks.
    Benny Derous

    Are you saying that you cannot rebuild that particular index, or other indexes? It works for me:orcl> alter index sys.i_procedure1 rebuild;
    Index altered.
    orcl> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for 32-bit Windows: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    orcl>

  • How to fix "ORA-31038:Invalid value ..." in a XML schema

    Hello,
    We are in 11gR2 :
    select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - ProductionWe load XML files based on a registered XML schema.
    Here is the top of our XML schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:xdb="http://xmlns.oracle.com/xdb"
             xmlns="http://www.capgemini.com/xsd/projet.xsd"
             targetNamespace="http://www.capgemini.com/xsd/projet.xsd"
             elementFormDefault="unqualified"
             blockDefault="#all">
      <xsd:element name="WORKBENCH_PROJECT" xdb:defaultTable="WORKBENCH_PROJECT_TABLE">
        <xsd:complexType xdb:maintainDOM="false">
          <xsd:sequence>
            <xsd:element ref="BaseCalendars"/>
            <xsd:element ref="PoolResources"/>
            <xsd:element ref="Projects"/>
          </xsd:sequence>
    ...We experience error ORA-31038: Invalid number value ... at the load of the XML, when the focus goes to a string type attribute :
    Here it is :
            <Task
              UID="AJ\&apos;UF`2=_```)O0H;&quot;P!```?P```0" earlyStart="2010-04-20T08:00:00" category="Run"
              baseTime="2010-03-26T09:22:00" lateStart="2010-04-20T08:00:00" start="2010-04-20T08:00:00"
              proxy="false" earlyFinish="2010-05-12T17:00:00" lateFinish="2010-05-12T17:00:00"
              critical="true" status="2" shortName="OASIS 3.2" outlineLevel="4" baseFinish="2010-06-11T17:00:00"
              finish="2010-05-12T17:00:00" summary="false" baseStart="2010-05-17T08:00:00" baselineDuration="20.0"
              milestone="false" name="OASI 3.2.1 : Association d&apos;un plan à un PFO" fixed="true"
              locked="false" key="false" percComp="1.0" totalSlack="0.0" unplanned="false">
              <Assignments>
                <Assignment
                  status="2" actualWork="24.0" resourceID="SMOUFLIH" start="2010-04-20T08:00:00" baselineWork="0.0"
    Here is the XML schema part where the load fails ( at the attribute *<xsd:attribute name="name" type="xsd:string"/>* ) :
      <xsd:element name="Task" xdb:defaultTable="">
        <xsd:complexType xdb:maintainDOM="false">
          <xsd:sequence>
            <xsd:element ref="Assignments" minOccurs="0"/>
            <xsd:element ref="BaselineDetails" minOccurs="0"/>
            <xsd:element ref="Constraints" minOccurs="0"/>
            <xsd:element ref="Notes" minOccurs="0"/>
          </xsd:sequence>
          <xsd:attribute name="UID"/>
          <xsd:attribute name="taskID" type="xsd:string"/>
          <xsd:attribute name="baseFinish" type="xsd:NMTOKEN"/>
          <xsd:attribute name="baseStart" type="xsd:NMTOKEN"/>
          <xsd:attribute name="baseTime" type="xsd:NMTOKEN"/>
          <xsd:attribute name="baselineDuration" type="xsd:decimal"/>
          <xsd:attribute name="category" type="xsd:string"/>
          <xsd:attribute name="critical" type="xsd:string"/>
          <xsd:attribute name="earlyFinish" type="xsd:NMTOKEN"/>
          <xsd:attribute name="earlyStart" type="xsd:NMTOKEN"/>
          <xsd:attribute name="finish" type="xsd:NMTOKEN"/>
          <xsd:attribute name="fixed" type="xsd:string"/>
          <xsd:attribute name="guidelines" type="xsd:string"/>
          <xsd:attribute name="key" type="xsd:string"/>
          <xsd:attribute name="lastUpdatedBy" type="xsd:string"/>
          <xsd:attribute name="lastUpdatedDate" type="xsd:NMTOKEN"/>
          <xsd:attribute name="lateFinish" type="xsd:NMTOKEN"/>
          <xsd:attribute name="lateStart" type="xsd:NMTOKEN"/>
          <xsd:attribute name="locked" type="xsd:string"/>
          <xsd:attribute name="methodID" type="xsd:string"/>
          <xsd:attribute name="milestone" type="xsd:string"/>
          <xsd:attribute name="name" type="xsd:string"/>
          <xsd:attribute name="outlineLevel" type="xsd:integer"/>
          <xsd:attribute name="percComp" type="xsd:decimal"/>
          <xsd:attribute name="priority" type="xsd:string"/>
          <xsd:attribute name="proxy" type="xsd:string"/>
          <xsd:attribute name="shortName" type="xsd:string"/>
          <xsd:attribute name="start" type="xsd:NMTOKEN"/>
          <xsd:attribute name="status" type="xsd:integer"/>
          <xsd:attribute name="summary" type="xsd:string"/>
          <xsd:attribute name="totalSlack" type="xsd:double"/>
          <xsd:attribute name="unplanned" type="xsd:string"/>
          <xsd:attribute name="userText1" type="xsd:string"/>
          <xsd:attribute name="userText2" type="xsd:string"/>
          <xsd:attribute name="userText3" type="xsd:string"/>
          <xsd:attribute name="userText4" type="xsd:string"/>
          <xsd:attribute name="userText5" type="xsd:string"/>
      We know how to fix it manually :
    The workaround is to :
    remove all "&apos;" in each attribute called "name" But we suppose we need to amend the XML schema with a proper change. And we don't know how to do this.
    The weird is that we've never noticed this error earlier on a 11gR1 DB... This error only occurs on our brand new 11.2.0.2
    I hope it's clear enough for your understanding.
    Do you have any advice ?
    Thanks in advance,
    Olivier

    What are your NLS Settings
    SQL> select *
      2  from nls_database_parameters
      3  where parameter in ('NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET');
    PARAMETER                                SQL> select *
      2  from nls_database_parameters
      3  where parameter in ('NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET');
    PARAMETER                    VALUE
    NLS_LANGUAGE              AMERICAN
    NLS_TERRITORY             AMERICA
    NLS_CHARACTERSET       AL32UTF8
    SQL>With my settings I do not see a problem with a cut-down test...
    SQL> spool testcase.log
    SQL> --
    SQL> connect sys/oracle as sysdba
    Connected.
    SQL> --
    SQL> set define on
    SQL> set timing on
    SQL> --
    SQL> def USERNAME = CG
    SQL> --
    SQL> def PASSWORD = &USERNAME
    SQL> --
    SQL> -- def XMLDIR = &1
    SQL> --
    SQL> def USER_TABLESPACE = USERS
    SQL> --
    SQL> def TEMP_TABLESPACE = TEMP
    SQL> --
    SQL> drop user &USERNAME cascade
      2  /
    old   1: drop user &USERNAME cascade
    new   1: drop user CG cascade
    User dropped.
    Elapsed: 00:00:01.72
    SQL> grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSWORD
      2  /
    old   1: grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSWORD
    new   1: grant create any directory, drop any directory, connect, resource, alter session, create view to CG identified by CG
    Grant succeeded.
    Elapsed: 00:00:00.01
    SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
      2  /
    old   1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
    new   1: alter user CG default tablespace USERS temporary tablespace TEMP
    User altered.
    Elapsed: 00:00:00.01
    SQL> connect &USERNAME/&PASSWORD
    Connected.
    SQL> --
    SQL> -- create or replace directory XMLDIR as '&XMLDIR'
    SQL> -- /
    SQL> var SCHEMAURL1    varchar2(256)
    SQL> VAR XMLSCHEMA1    CLOB;
    SQL> VAR INSTANCE1     CLOB;
    SQL> --
    SQL> set define off
    SQL> --
    SQL> alter session set events='31098 trace name context forever'
      2  /
    Session altered.
    Elapsed: 00:00:00.00
    SQL> begin
      2    :SCHEMAURL1:= 'http://xmlns.example.com/testcase.xsd';
      3    :XMLSCHEMA1 :=
      4  '<?xml version="1.0" encoding="UTF-8"?>
      5  <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified" attributeFormDefault="unqualified">
      6     <xsd:element name="Task" xdb:defaultTable="TASK_TABLE">
      7      <xsd:complexType xdb:maintainDOM="false">
      8        <xsd:sequence>
      9          <xsd:element name="Notes" type="xsd:string" minOccurs="0"/>
    10        </xsd:sequence>
    11        <xsd:attribute name="UID"/>
    12        <xsd:attribute name="taskID" type="xsd:string"/>
    13        <xsd:attribute name="baseFinish" type="xsd:NMTOKEN"/>
    14        <xsd:attribute name="baseStart" type="xsd:NMTOKEN"/>
    15        <xsd:attribute name="baseTime" type="xsd:NMTOKEN"/>
    16        <xsd:attribute name="baselineDuration" type="xsd:decimal"/>
    17        <xsd:attribute name="category" type="xsd:string"/>
    18        <xsd:attribute name="critical" type="xsd:string"/>
    19        <xsd:attribute name="earlyFinish" type="xsd:NMTOKEN"/>
    20        <xsd:attribute name="earlyStart" type="xsd:NMTOKEN"/>
    21        <xsd:attribute name="finish" type="xsd:NMTOKEN"/>
    22        <xsd:attribute name="fixed" type="xsd:string"/>
    23        <xsd:attribute name="guidelines" type="xsd:string"/>
    24        <xsd:attribute name="key" type="xsd:string"/>
    25        <xsd:attribute name="lastUpdatedBy" type="xsd:string"/>
    26        <xsd:attribute name="lastUpdatedDate" type="xsd:NMTOKEN"/>
    27        <xsd:attribute name="lateFinish" type="xsd:NMTOKEN"/>
    28        <xsd:attribute name="lateStart" type="xsd:NMTOKEN"/>
    29        <xsd:attribute name="locked" type="xsd:string"/>
    30        <xsd:attribute name="methodID" type="xsd:string"/>
    31        <xsd:attribute name="milestone" type="xsd:string"/>
    32        <xsd:attribute name="name" type="xsd:string"/>
    33        <xsd:attribute name="outlineLevel" type="xsd:integer"/>
    34        <xsd:attribute name="percComp" type="xsd:decimal"/>
    35        <xsd:attribute name="priority" type="xsd:string"/>
    36        <xsd:attribute name="proxy" type="xsd:string"/>
    37        <xsd:attribute name="shortName" type="xsd:string"/>
    38        <xsd:attribute name="start" type="xsd:NMTOKEN"/>
    39        <xsd:attribute name="status" type="xsd:integer"/>
    40        <xsd:attribute name="summary" type="xsd:string"/>
    41        <xsd:attribute name="totalSlack" type="xsd:double"/>
    42        <xsd:attribute name="unplanned" type="xsd:string"/>
    43        <xsd:attribute name="userText1" type="xsd:string"/>
    44        <xsd:attribute name="userText2" type="xsd:string"/>
    45        <xsd:attribute name="userText3" type="xsd:string"/>
    46        <xsd:attribute name="userText4" type="xsd:string"/>
    47        <xsd:attribute name="userText5" type="xsd:string"/>
    48             </xsd:complexType>
    49     </xsd:element>
    50  </xsd:schema>';
    51    :INSTANCE1 :=
    52  '<Task
    53            UID="AJ\&apos;UF`2=_```)O0H;&quot;P!```?P```0" earlyStart="2010-04-20T08:00:00" category="Run"
    54            baseTime="2010-03-26T09:22:00" lateStart="2010-04-20T08:00:00" start="2010-04-20T08:00:00"
    55            proxy="false" earlyFinish="2010-05-12T17:00:00" lateFinish="2010-05-12T17:00:00"
    56            critical="true" status="2" shortName="OASIS 3.2" outlineLevel="4" baseFinish="2010-06-11T17:00:00"
    57            finish="2010-05-12T17:00:00" summary="false" baseStart="2010-05-17T08:00:00" baselineDuration="20.0"
    58            milestone="false" name="OASI 3.2.1 : Association d&apos;un plan A  un PFO" fixed="true"
    59            locked="false" key="false" percComp="1.0" totalSlack="0.0" unplanned="false"/>';
    60  end;
    61  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> set define on
    SQL> --
    SQL> declare
      2    V_XML_SCHEMA xmlType := XMLType(:XMLSCHEMA1);
      3  begin
      4    DBMS_XMLSCHEMA.registerSchema
      5    (
      6      SCHEMAURL        => :SCHEMAURL1,
      7      SCHEMADOC        => V_XML_SCHEMA,
      8      LOCAL            => TRUE,
      9      GENBEAN          => FALSE,
    10      GENTYPES         => TRUE,
    11      GENTABLES        => TRUE,
    12      ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    13    );
    14  end;
    15  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.46
    SQL> desc TASK_TABLE
    Name                                      Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://xmlns.example.com/testcase.xsd" Element "Task") STORAGE Object-relational TYPE "Task3632_T"
    SQL> --
    SQL> insert into TASK_TABLE values ( XMLTYPE(:INSTANCE1))
      2  /
    1 row created.
    Elapsed: 00:00:00.01
    SQL> commit
      2  /
    Commit complete.
    Elapsed: 00:00:00.09and am able to extract the value of the name attribute correct
    SQL> select XMLCAST(XMLQUERY('/Task/@name' passing OBJECT_VALUE returning content) as VARCHAR2(64))
      2    from TASK_TABLE
      3  /
    XMLCAST(XMLQUERY('/TASK/@NAME'PASSINGOBJECT_VALUERETURNINGCONTEN
    OASI 3.2.1 : Association d'un plan A  un PFO
    Elapsed: 00:00:00.00Could you try this simplied test in your database...
    Edited by: mdrake on Nov 30, 2010 8:36 PM

  • How to fix ORA-01658 error message

    Am trying to get a old bit of database code working and am getting the following errors with the following
    REM **********************************************************************
    CREATE TABLE gam_service ( /*gam_ser*/
    service_group_id NUMBER(10) NOT NULL
      CONSTRAINT gam_ser_fk_gam_sergrp REFERENCES gam_service_group (service_group_id)
      ON DELETE CASCADE,
    service_id NUMBER(10) NOT NULL,
    service_name VARCHAR2(127) NOT NULL, /*length from GICS code*/
    service_type CHAR(1) NOT NULL, /* Service type Gulp, socKet mp, Special client*/
    server VARCHAR2(127) NOT NULL, /* Server name, e.g. "gulp" */
    version VARCHAR2(20) NOT NULL, /*Required version number of server binary*/
    parameters VARCHAR2(2000) NULL, /* parameters to start the service - could be binary */
    cpu_power_level NUMBER(3) NULL,     /* NULL for wildcard*/
    os_type CHAR(1) NULL      /* NULL for wildcard (Solaris2.4, winNt)*/
      CONSTRAINT gam_ser_ostype CHECK (os_type IN (NULL, 'S', 'N')),
    hardware_owner_type VARCHAR2(10) NULL  /* NULL for wildcard (company name)*/
    )  TABLESPACE gam_tab STORAGE (INITIAL 25K NEXT 100K PCTINCREASE 100 MINEXTENTS 1 MAXEXTENTS unlimited)
    CREATE UNIQUE INDEX gam_service_pk on gam_service (service_group_id, service_name)
    TABLESPACE gam_ind
    STORAGE (INITIAL 5K NEXT 20K PCTINCREASE 100 MINEXTENTS 1 MAXEXTENTS unlimited)
    CREATE SEQUENCE gam_service_seq
      INCREMENT BY 1
      START WITH 1001
      NOCYCLE
      NOCACHE
      NOORDER
    here the error message
    CREATE UNIQUE INDEX gam_service_pk on gam_service (service_group_id, service_name)
    ERROR at line 1:
    ORA-01658: unable to create INITIAL extent for segment in tablespace GAM_IND
    i really hope some one can help me thanks

    You just ran out of space in gam_ind tablespace. Contiguous space to be precise. Your INTITIAL extend needs 5K of contoguous space. And since you specified PCTINCREASE 100, need for contiguous space will double with each next extent. So most likely you ended up with a case where there is plenty of free space not no contiguous space of required size.
    SY.

  • How to fix ORA-33262: Analytic workspace MY_AW does not exist ?

    Here is my version of : http://download.oracle.com/docs/cd/E11882_01/olap.112/e10795/select.htm#CBBGEGFA
    I don't understand why I get this ORA-33262, it just does not make sense ...
    The API should be doing AW ATTACH MYSCHEMA.MY_AW RO
    Solution 1 : The DBA in my team thinks there is no way for her to create a synonym (or something like that) for the MYSCHEMA.MY_AW so I (the API) can use only MY_AW, anyone knows a way to do it ?
    Maybe the second call to _displayResult() needs to ATTACH the AW while the first does not ...
    Solution 2 : How could I specify to the API to use MYSCHEMA.MY_AW instead of MY_AW ?
    Thanks in advance !
    JP
    DataProvider dp = new DataProvider();
    OracleConnection connection = (OracleConnection)connectionFactory.getConnection(); // LOGGED USING PROXY AUTH WITH THE USER (COULD BE ANY USER) AUTHENTICATED TO THE WEB APP AND ACTUALLY REQUESTING THIS TEST
    UserSession session = dp.createSession(connection);
    MdmRootSchema mdmRootSchema = (MdmRootSchema)dp.getMdmMetadataProvider().getRootSchema();
    MdmDatabaseSchema mdmGlobalSchema = mdmRootSchema.getDatabaseSchema("*MYSCHEMA*");
    MdmPrimaryDimension mdmDim = (MdmPrimaryDimension)mdmGlobalSchema.getTopLevelObject(dimension.getName());
    test.testExample(mdmDim);
    public void testExample(MdmPrimaryDimension mdmProdDim) {
    // Get the Source for the short label attribute of the dimension.
    MdmAttribute labelAttribute = mdmProdDim.getShortValueDescriptionAttribute();
    // prodShortLabel, which is the Source for the short value description attribute of the PRODUCT_AWJ dim
    Source prodShortLabel = labelAttribute.getSource();
    // prodHier, which is the Source for the Product Primary hierarchy.
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy) mdmProdDim.getDefaultHierarchy();
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
    // levelSrc, which is the Source for the Family level of the Product Primary hierarchy of the PRODUCT_AWJ dimension.
    MdmHierarchyLevel mdmHierarchyLevel = mdmProdHier.getHierarchyLevels().iterator().next();
    Source levelSrc = mdmHierarchyLevel.getSource();
    MdmAttribute mdmAncestorAttribute = mdmProdHier.getAncestorsAttribute();
    // prodHierAncsAttr, which is the Source for the ancestors attribute of the hierarchy.
    Source prodHierAncsAttr = mdmAncestorAttribute.getSource();
    MdmAttribute mdmParentAttribute = mdmProdHier.getParentAttribute();
    // prodHierParentAttr, which is the Source for the parent attribute of the hierarchy.
    Source prodHierParentAttr = mdmParentAttribute.getSource();
    int pos = 1;
    // Get the element at the specified position of the level Source.
    Source levelElement = levelSrc.at(pos);
    // Select the element of the hierarchy with the specified value.
    Source levelSel = prodHier.join(prodHier.value(), levelElement);
    // Get ancestors of the level element.
    Source levelElementAncs = prodHierAncsAttr.join(prodHier, levelElement);
    // Get the parent of the level element.
    Source levelElementParent = prodHierParentAttr.join(prodHier, levelElement);
    // Get the children of a parent.
    Source prodHierChildren = prodHier.join(prodHierParentAttr, prodHier.value());
    // Select the children of the level element.
    Source levelElementChildren = prodHierChildren.join(prodHier, levelElement);
    // Get the short value descriptions for the elements of the level.
    Source levelSrcWithShortDescr = prodShortLabel.join(levelSrc);
    // Get the short value descriptions for the children.
    Source levelElementChildrenWithShortDescr =
    prodShortLabel.join(levelElementChildren);
    // Get the short value descriptions for the parents.
    Source levelElementParentWithShortDescr =
    prodShortLabel.join(prodHier, levelElementParent, true);
    // Get the short value descriptions for the ancestors.
    Source levelElementAncsWithShortDescr =
    prodShortLabel.join(prodHier, levelElementAncs, true);
    // Commit the current Transaction.
    commit();
    // Create Cursor objects and display their values.
    System.out.println("Level element values:");
    _displayResult(levelSrcWithShortDescr, false); // WORKS WITH NO PROB, I SEE THE NORMAL OUTPUT AS IN THE EXAMPLE
    System.out.println("\nLevel element at position " + pos + ":");
    _displayResult(levelElement,false); // I GET ORA-33262, SEE BELOW
    System.out.println("\nParent of the level element:");
    _displayResult(levelElementParent,false);
    System.out.println("\nChildren of the level element:");
    _displayResult(levelElementChildrenWithShortDescr,false);
    System.out.println("\nAncestors of the level element:");
    _displayResult(levelElementAncs,false);
    private void _displayResult(Source source, boolean displayLocVal)
    CursorManager cursorManager =
    dp.createCursorManager(source); // Exception for ORA-33262 is thrown here
    Cursor cursor = cursorManager.createCursor();
    cpw.printCursor(cursor, displayLocVal);
    // Close the CursorManager.
    cursorManager.close();
    Error class: Express Failure
    Server error descriptions:
    DPR: cannot create server cursor, Generic at TxsOqDefinitionManager::crtCurMgrs4
    SEL: Unable to generate an execution plan for the query, Generic at TxsOqExecutionPlanGenerator::generate(TxsOqSourceSnapshot*)
    INI: XOQ-00703: error executing OLAP DML command "(AW ATTACH MY_AW RO : ORA-33262: Analytic workspace MY_ AW does not exist.
    )", Generic at TxsOqAWManager::executeCommand
    Edited by: J-P on Jun 29, 2010 9:58 AM

    David Greenfield wrote:
    The error happens when the server is executing the OLAP DML command "AW ATTACH CENSUS RO". This in turn gets an error of the form "ORA-33262: Analytic workspace MY_AW does not exist."
    Oups, sorry when posting, I always try to get ride of names specific to my application/company, I forgot to change CENSUS for MY_AW in the error message
    In particular it is attaching the AW named CENSUS, but is complaining about MY_AW. I have a few questions.
    (1) In which AW does your PRODUCT_AWJ dimension live? CENSUS or MY_AW?
    I don't use PRODUCT_AWJ (I kept the comments from Oracle's example), at line 8, I use dimension.getName() instead
    This dimension lives in the AW named "MY_AW"
    >
    (2) Can you connect CENSUS on the command line (logged in as the same user where the error occurs)?
    Using AWM, I tried to do the command "AW ATTACH MY_AW RO", it does not work, I get the same ORA error, I've to use "AW ATTACH MYSCHEMA.MY_AW RO"
    (3) Is there any kind of AUTOGO or PREMIT_READ program in CENSUS that refers to MY_AW?
    No, sorry again, my mistake
    >
    (4) Have you set up any kind of security on the cubes (via AWM) that may be firing during the attach?
    Not to my knowledge, the DBA knows I've this problem, so she should have tought about it ... I'll ask her just in case
    Thank you,
    JP

  • How to fix ORA-12704: character set mismatch

    I am newish to oracle and am trying to work out why the following doesn't work:
    create table utest(test nvarchar2(100));
    insert into utest values('fish');
    select test from utest union select '' from utest;
    I need to be able to do a union on a table with an nvarchar2 fields, where on union, some of the columns are simply ''.
    Not quite sure how to work out which oracle version exactly this is, we are given remote access via JDBC.

    Hi
    i have a similar issue on a customer. unfortunatly i am not able to modify the commands because i am not the developer. but i see in the logfile, that a ORA-12703 - Character Set Missmatch Occours after a specifiec command. after some investigation i found the command:
    SELECT * FROM (SELECT DISTINCT ATTACHMENTID, FTN.USERID, FTN.MSGID, FTN.TYPEFLD, DS.DOCSERVERID, DOCSERVERPATH, DSTYPE,DSENABLED, DA.DATAARCHIVEID,FILENAME, STARTINGPOS, COMPRESSEDSIZE, UNCOMPRESSEDSIZE, MSGDATEHIGH,     MSGDATELOW, FLAGS, STORAGEMETHOD, SUBJECT, FROMFLD FROM CONTAINSATTACHMENT CA RIGHT JOIN FT_NOTIFY FTN ON CA.MSGID=FTN.MSGID , PROFILE P, PROFILELOCATION PL, DATAARCHIVE DA, DOCUMENTSERVER DS WHERE FTN.MSGID >= 547609 AND FTN.MSGID <= 557609 AND P.MSGID=PL.MSGID AND DS.DOCSERVERID=DA.DOCSERVERID AND DA.DATAARCHIVEID=PL.DATAARCHIVEID AND FTN.MSGID=P.MSGID AND FTN.SEARCH_INDEX_ID=2 AND TYPEFLD='A' UNION SELECT DISTINCT NULL AS ATTACHMENTID, FTN.USERID, FTN.MSGID, FTN.TYPEFLD,0 AS DOCSERVERID,'' AS DOCSERVERPATH,0 AS DSTYPE,0 AS DSENABLED,0 AS DATAARCHIVEID,'' AS FILENAME,0 AS STARTINGPOS,0 AS COMPRESSEDSIZE,0 AS UNCOMPRESSEDSIZE,0 AS MSGDATEHIGH,0 AS MSGDATELOW,-1 AS FLAGS, 0 AS STORAGEMETHOD,'' AS SUBJECT, '' AS FROMFLD FROM FT_NOTIFY FTN WHERE FTN.MSGID >= 547609 AND FTN.MSGID <= 557609 AND FTN.SEARCH_INDEX_ID=2 AND TYPEFLD='R') ORDER BY MSGID
    when i replace the "'' AS..." in the bottom of the script with the "cast( '' as nvarchar(255)) AS..." it works as expected. as i sayd, i cant change the code but we have the system working for ages and after we set up a new server, it stops working - so can it be possible that other versions of Oracle (Server or Client) support this without a cast? Or is there some "Special Setting" what can help here?
    Thank you in advance
    Martin

  • How to fix ora-32411

    Hi All,
    i am creating materialized view and it has been created successfully but at the time of refreshment error ora-32411 is coming my query length is more than 4000 and i can't split this query so please guide me on this, Is there anything that can be done, besides splitting up the query? The scripts are one long query each so it will be hard to split up and i my boss don't want to split or recreate this query. kindly help me on this
    query length is 74k, 104k and more..
    Thanks in advance

    Have a look at MOS
    Bug 5217296 - ORA-32411 reported on materialized view refresh [ID 5217296.8]
    This is a restriction in 10.2 (and above), there is a workaround mentioned; however I wouldn't go for it. As this limit doesn't apply to views why don't you create a view upon your whole select statement and then in your materialized view simply do a
    select a,b,c,d
    from your_viewcheers

  • ORA-01502 error in case of unusable unique index and bulk dml

    Hi, all.
    The db is 11.2.0.3 on a linux machine.
    I made a unique index unusable, and issued a dml on the table.
    Howerver, oracle gave me ORA-01502 error.
    In order to avoid ORA-01502 error, do I have to drop the unique index ,and do bulk dml, and recreate the index?
    Or Is there any other solution without re-creating the unique index?
    create table hoho.abcde as
    select level col1 from dual connect by level <=1000
    10:09:55 HOHO@PD1MGD>create unique index hoho.abcde_dx1 on hoho.abcde (col1);
    Index created.
    10:10:23 HOHO@PD1MGD>alter index hoho.abcde_dx1 unusable;
    Index altered.
    Elapsed: 00:00:00.03
    10:11:27 HOHO@PD1MGD>delete from hoho.abcde where rownum < 11;
    delete from hoho.abcde where rownum < 11
    ERROR at line 1:
    ORA-01502: index 'HOHO.ABCDE_DX1' or partition of such index is in unusable stateThanks in advance.
    Best Regards.

    Hi. all.
    The following is from "http://docs.oracle.com/cd/E14072_01/server.112/e10595/indexes002.htm#CIHJIDJG".
    Is there anyone who can show me a tip to avoid the following without dropping and re-creating an unique index?
    •DML statements terminate with an error if there are any unusable indexes that are used to enforce the UNIQUE constraint.
    Unusable indexes
    An unusable index is ignored by the optimizer and is not maintained by DML. One reason to make an index unusable is if you want to improve the performance of bulk loads. (Bulk loads go more quickly if the database does not need to maintain indexes when inserting rows.) Instead of dropping the index and later recreating it, which requires you to recall the exact parameters of the CREATE INDEX statement, you can make the index unusable, and then just rebuild it. You can create an index in the unusable state, or you can mark an existing index or index partition unusable. The database may mark an index unusable under certain circumstances, such as when there is a failure while building the index. When one partition of a partitioned index is marked unusable, the other partitions of the index remain valid.
    An unusable index or index partition must be rebuilt, or dropped and re-created, before it can be used. Truncating a table makes an unusable index valid.
    Beginning with Oracle Database 11g Release 2, when you make an existing index unusable, its index segment is dropped.
    The functionality of unusable indexes depends on the setting of the SKIP_UNUSABLE_INDEXES initialization parameter.
    When SKIP_UNUSABLE_INDEXES is TRUE (the default), then:
    •DML statements against the table proceed, but unusable indexes are not maintained.
    •DML statements terminate with an error if there are any unusable indexes that are used to enforce the UNIQUE constraint.
    •For non-partitioned indexes, the optimizer does not consider any unusable indexes when creating an access plan for SELECT statements. The only exception is when an index is explicitly specified with the INDEX() hint.
    •For a partitioned index where one or more of the partitions are unusable, the optimizer does not consider the index if it cannot determine at query compilation time if any of the index partitions can be pruned. This is true for both partitioned and non-partitioned tables. The only exception is when an index is explicitly specified with the INDEX() hint.
    When SKIP_UNUSABLE_INDEXES is FALSE, then:
    •If any unusable indexes or index partitions are present, any DML statements that would cause those indexes or index partitions to be updated are terminated with an error.
    •For SELECT statements, if an unusable index or unusable index partition is present but the optimizer does not choose to use it for the access plan, the statement proceeds. However, if the optimizer does choose to use the unusable index or unusable index partition, the statement terminates with an error.Thanks in advance.
    Best Regards.

  • Partition of such index is in unusable state

    Hi,
    We have upgraded the system 3O.B to BI 7.0 after upgrade we are getting following dump in the system for cube while accessing
    Database error text........: "ORA-01502: index 'SAPPRW./BIC/FZUCCA_C1~100' or partition of such index is in unusable state"
    How to rebuild the signal index in BI ?

    Hi,
    I am getting a similar dump for some master data. Have you managed to solve the problem? I have process chain, and everything seems to work correctly, but the system administrator informs us that we are getting system dumps.
    Please inform how to solve the problem.
    Thank you for your help.
    Ravi
    e.g.
    ORA-01502: index 'SAPSR3./BIC/B0000521000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000539000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000546000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000563000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000569000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000689000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000691000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000696000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000697000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000701000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000703001KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000715000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000828001KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000856000KE' or partition of such index is in unusable state
    ORA-01502: index 'SAPSR3./BIC/B0000872000KE' or partition of such index is in unusable state

  • ORA-01502

    I have truncated specifuic partitions of some of the tables of my databse.
    While I was viewing the alert logs,I could see a lot of DBA jobs failing with the error,
    ORA-12012: error on auto execute of job
    ORA-01502: index or partition of such index is in unusable state
    How is it possiblwe to identify all
    index or index partition that has been marked unusable by a direct load or by a DDL operation.
    What should be the workaround now and any potential issues that I should take care of.
    Thanks in advance.

    Kindly check the following links ->
    http://ora-12012.ora-code.com/
    http://www.dbasupport.com/forums/archive/index.php/t-53627.html
    Finally,
    http://www.google.co.in/search?source=ig&hl=en&rlz=1G1GGLQ_ENIN290&=&q=ORA-12012&btnG=Google+Search&meta=lr%3D
    Regards.
    Satyaki De.

  • In what way can an index go in invalid state????????

    I did a lot of activity in my database and i found one of my index is in invalid state...i got an error
    ......Error occured is ORA-01502: index 'MUMBAI.SYS_C0013323' or partition of such index is in unusable state......
    Can anybody tell me what activity (or set of activies) can lead to invalid state of Index????/
    How to check if any other index is is Invalid state????????
    Thanx in Advance
    Gagan

    Hello,
    Following are some reason for index to be marked UNUSED;
    Operations like Import Partition or conventional path SQL*Loader
    that offer an option to bypass local index maintenance. When the
    Import is complete, the affected local index partitions are marked
    IU.
    Partition maintenance operations like ALTER TABLE MOVE PARTITION
    that change rowids. These operations mark the affected local index
    partition and all global index partitions IU.
    Partition maintenance operations like ALTER TABLE SPLIT PARTITION
    that modify the partition definition of local indexes but do not
    automatically rebuild the index data to match the new definitions.
    These operations mark the affected local index partitions IU. ALTER
    TABLE SPLIT PARTITION also marks all global index partitions IU
    because it results in changes to rowids.
    Index maintenance operations like ALTER INDEX SPLIT PARTITION that
    modify the partitioning definition of the index but do not
    automatically rebuild the affected partitions. These operations
    mark the affected index partitions IU. However, if you split a
    USABLE partition of a global index, resulting partitions are created
    USABLE. If the partition that was split was marked IU, then so are
    the partitions resulting from the split. Note that dropping a
    partition of a global index that is either IU or is not empty causes
    the next partition of the index to become IU.
    Above points are mentioned at Metalink.
    Hope that this will help you.....

  • My windows(8.1 64bit) partition is read only from the mac(yosemite) side of things. Anybody have a clue on how to fix this? Also, slightly frustrating as well, windows crashes every time I attempt to open a file from the mac partition.

    my windows(8.1 64bit) partition is read only from the mac(yosemite) side of things. Anybody have a clue on how to fix this? Also, slightly frustrating as well, windows crashes every time I attempt to open a file from the mac partition.

    All Office applications will also try to open a temporary work file in the same location as the source file. This implies the source file directory also needs to be writable for this temporary file. Since the default HFS+ driver provides only read-only access, such temporary files will fail to open, and will cause the application to fail.
    As a test copy the file you want to edit, say an Excel spreadsheet from the OSX file system to the C: drive on the Windows side and try to open it. If you look in this directory, you should see two files, the source and a temporary file. You may have to force the temporary file to be opened on a read-write file system, by manipulating the folder for temporary files.

  • How to fix a faulty partition table, How to fix a faulty partition table

    I have a 400gb partition on my 500gb HD, the remaining 100gb was split up in 3 partitions. I deleted 2 of these partitions, restarted and now Disk Utility claims my 400gb drive is now 53gb, accessing files has become impossible.
    I can still see all the files listed but am unable to open them or copy them, I get a -36 error.
    I have thrown Disk Utility, DiskWarrior, TechTool Pro and some lesser known tools at it but none of them wants to repair the volume.
    Sounds to me like a busted partition table, after all that was all that was altered, in theory I should be able to access my files. Does anyone have any suggestions on how to fix this?

    Problem solved, I used iPartition to resize the partition back to its original size after which I could copy all data off.

  • ORA-00604 ORA-00904 When query partitioned table with partitioned indexes

    Got ORA-00604 ORA-00904 When query partitioned table with partitioned indexes in the data warehouse environment.
    Query runs fine when query the partitioned table without partitioned indexes.
    Here is the query.
    SELECT al2.vdc_name, al7.model_series_name, COUNT (DISTINCT (al1.vin)),
    al27.accessory_code
    FROM vlc.veh_vdc_accessorization_fact al1,
    vlc.vdc_dim al2,
    vlc.model_attribute_dim al7,
    vlc.ppo_list_dim al18,
    vlc.ppo_list_indiv_type_dim al23,
    vlc.accy_type_dim al27
    WHERE ( al2.vdc_id = al1.vdc_location_id
    AND al7.model_attribute_id = al1.model_attribute_id
    AND al18.mydppolist_id = al1.ppo_list_id
    AND al23.mydppolist_id = al18.mydppolist_id
    AND al23.mydaccytyp_id = al27.mydaccytyp_id
    AND ( al7.model_series_name IN ('SCION TC', 'SCION XA', 'SCION XB')
    AND al2.vdc_name IN
    ('PORT OF BALTIMORE',
    'PORT OF JACKSONVILLE - LEXUS',
    'PORT OF LONG BEACH',
    'PORT OF NEWARK',
    'PORT OF PORTLAND'
    AND al27.accessory_code IN ('42', '43', '44', '45')
    GROUP BY al2.vdc_name, al7.model_series_name, al27.accessory_code

    I would recommend that you post this at the following OTN forum:
    Database - General
    General Database Discussions
    and perhaps at:
    Oracle Warehouse Builder
    Warehouse Builder
    The Oracle OLAP forum typically does not cover general data warehousing topics.

Maybe you are looking for