Function-based index error due to fine-grained security

Hi, i'm working on Oracle version 9.2.0.5.
I'm trying to create a function-based index but i'm getting an error due to fine-grained security. I checked resource_view but if i'm not wrong I should have all necessary roles. I also added xdbadmin to this user to be sure.
I tried also to alter my session but it didn't worked.
Connected to Oracle9i Enterprise Edition Release 9.2.0.5.0
Connected as test_ste
SQL>
SQL> create index fbidx_schede_xml
  2  on schede_progetti_xml p
  3  (p.PROGETTO.extract('/Project/Elenco_unita/Unita/Responsabile/Cognome/text()').getStringVal());
create index fbidx_schede_xml
on schede_progetti_xml p
(p.PROGETTO.extract('/Project/Elenco_unita/Unita/Responsabile/Cognome/text()').getStringVal())
ORA-28133: full table access is restricted by fine-grained security
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1
SQL>
SQL> alter session set query_rewrite_enabled = true;
Session altered
SQL> alter session set query_rewrite_integrity = trusted;
Session altered
SQL> create index fbidx_schede_xml
  2  on schede_progetti_xml p
  3  (p.PROGETTO.extract('/Project/Elenco_unita/Unita/Responsabile/Cognome/text()').getStringVal());
create index fbidx_schede_xml
on schede_progetti_xml p
(p.PROGETTO.extract('/Project/Elenco_unita/Unita/Responsabile/Cognome/text()').getStringVal())
ORA-28133: full table access is restricted by fine-grained security
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1
SQL> select * from user_role_privs;
USERNAME                       GRANTED_ROLE                   ADMIN_OPTION DEFAULT_ROLE OS_GRANTED
TEST_STE                      CONNECT                        NO           YES          NO
TEST_STE                      CTXAPP                         NO           YES          NO
TEST_STE                      RESOURCE                       NO           YES          NO
TEST_STE                      XDBADMIN                       NO           YES          NO
SQL> This are ACL on my schema:
  <ACL>
    <acl description="Private:All privileges to OWNER only and not accessible to others" xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:dav="DAV:"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd                           http://xmlns.oracle.com/xdb/acl.xsd">
      <ace>
        <principal>dav:owner</principal>
        <grant>true</grant>
        <privilege>
          <all/>
        </privilege>
      </ace>
    </acl>
  </ACL>I tried to create a similar function-based index on Oracle 10.2.0.3 without any problem and without touching any ACL, is an Oracle 9.2.0.5 problem?
Thanks for your attention.

I didn't really (production wise)work yet with VPD. I know a lot is based on DBMS_RLS and I guess (IF it is VPD related) it should be to hard to find in the doc's how you could check what is beyond your privileges. As a DBA I noticed that even the dba account SYSTEM isn't always allow to export the full content for the tables anymore.
There is a privilege that grants you all access that you need, despite the fact that you are not allowed to read certain rows from a table. Look it up.
In all, as I said, it looks like account is not allowed to see all data from a table. In that respect it sounds logical that you also are, in that case, not allowed to build a function based index on that data

Similar Messages

  • Function Based Indexes Errors

    Hi
    I am trying to create function based indexes based on the examples in the b10826 Spatial Users guide --
    The Create index statement is failing because it says it cannot read the metadata
    create index EMITTER_LOB_WIDX ON EMITTER (OWNER1.WT_GEOMETRY_PACKAGE.LINEOFBEARING(EQUIP_X, EQUIP_Y, LOB_BEARING, LOB_RANGE)) INDEXTYPE IS MDSYS.SPATIAL_INDEX LOCAL;
    create index EMITTER_LOB_WIDX ON EMITTER (EMITTER.WT_GEOMETRY_PACKAGE.LINEOFBEARING(EQUIP_X, EQUIP_Y, LOB_BEARING, LOB_RANGE)) INDEXTYPE IS MDSYS.SPATIAL_INDEX LOCAL
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 10
    Here is the USER_SDO_GEOM_METADATA ENTRY:
    TABLE_NAME
    COLUMN_NAME
    DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
    SRID
    EMITTER
    OWNER1.WT_GEOMETRY_PACKAGE.LINEOFBEARING(EQUIP_X, EQUIP_Y, LOB_BEARING,
    LOB_RANGE)
    SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .00005), SDO_DIM_ELEMENT('Y', -90,
    90, .000005))
    TABLE_NAME
    COLUMN_NAME
    DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
    SRID
    8307
    The package is owned by OWNER1 - the Table is in OWNER2's schema - not that that matters - what are the known issues with Function Based Indexes
    Am I missing something Obvious?

    I think its a bug
    I moved the function to the local schema - I also pulled it out of the package -
    So I look in USER_SDO_GEOM_METADATA no records for select * from USER_SDO_GEOM_METADATA
    Not being satisfied with that I look in ALL_SDO_GEOM_METADATA
    SELECT * FROM ALL_SDO_GEOM_METADATA WHERE OWNER = 'OWNER2';
    no rows selected
    So I should be good for insert
    INSERT INTO USER_SDO_GEOM_METADATA VALUES ('EMITTER','OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.005),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.005)), 8307);
    INSERT INTO USER_SDO_GEOM_METADATA VALUES ('EMITTER','LOCUST2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.005),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.005)), 8307)
    ERROR at line 1:
    ORA-13223: duplicate entry for EMITTER.OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)
    in SDO_GEOM_METADATA
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_GEOM_TRIG_INS1", line 21
    ORA-04088: error during execution of trigger 'MDSYS.SDO_GEOM_TRIG_INS1'
    If I insert to all_sdo_geom_metadata it takes but the index create fails b/c it cannot read user_sdo_geom_metadata
    INSERT INTO ALL_SDO_GEOM_METADATA VALUES (OWNER2','EMITTER','OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.005),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.005)), 8307);
    1 row created.
    SQL> CREATE INDEX EMITTER_EQUIP_WIDX ON EMITTER(OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('layer_gtype=point tablespace=EMITTER_IDX_TBS');
    CREATE INDEX EMITTER_EQUIP_WIDX ON EMITTER(OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('layer_gtype=point tablespace=EMITTER_IDX_TBS')
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 10
    select table_name, column_name from user_sdo_geom_metadata;
    TABLE_NAME
    COLUMN_NAME
    EMITTER
    OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)
    Arghhh!!!
    Anyone else encounter a similar problem?
    I know that I have to be careful regarding owner.packager.function naming convention
    I have followed the oracle examples from here
    http://www.oracle.com/technology/obe/obe10gdb/content/spatial/files/add_metadata_fi.sql
    are they broken? Is this a bug ?

  • Segment Shrinking script erroring out due to Function based indexes, lobs,.

    DB version:10gR2
    Following is a script i made for freeing up(SHRINK ing and resetting HWM) the space in Tables and its indexes. Due to the existence of LOB Segments and Tables with Function based indexes, this script was erroring out. So i was wondering if there is a way to find out the segments which are eligible/not eligible for Shrinking so that i could make necessary changes to the below script.
    create or replace procedure freeup_space
    is
    type v_segment_type is table of varchar2(30) index by binary_integer;
    v_segment v_segment_type;
    begin
    select segment_name bulk collect into v_segment
                   from user_segments
                   where segment_type in ('TABLE')
                     and segment_name not like 'BIN%';
    for i in v_segment.first..v_segment.last loop
    execute immediate 'alter table ' || v_segment(i) ||' enable row movement';
    dbms_output.put_line('Table '||v_segment(i)||'''s row movement enabled');
    execute immediate 'alter table ' || v_segment(i) ||' shrink space cascade';
    execute immediate 'alter table ' || v_segment(i) ||' deallocate unused';
    end loop;
    end;
    /

    You can use USER_LOBS views to look for LOB columns in the segments and ALL_INDEXES.INDEX_TYPE tells if the index is function based index or not.
    Message was edited by:
    Pierre Forstmann

  • Importing error: related to function-based indexes?

    I've come across a strange error. I've got a user that has an export dump file who wants me to import the data into a new database. (Its an Oracle 10G database.)
    When I use the 'imp' command, the table import completes successfully, but I end up receiving the following warnings:
    IMP-00003: oracle error 942 encountered
    ORA-00942: table or view does not exist
    IMP-00017: following statement failed with ORACLE error 942
    "CREATE INDEX "X" on "Y" (TO_CHAR("Z",'yyyymmdd')) P"
    "CTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 3145728 FREELISTS 1 FREEL"
    "IST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TBSPC" LOGGING"
    The table itself seems to have been imported correctly; and all data rows exist. Its just the index that isn't being imported/rebuilt. (Other indexes on the same table were imported properly.)
    The only thing that I could find that seems odd is that this index uses functions (the "TO_CHAR" in the index above). All of the other indexes on the table refer to basic fields. And I can rebuild the index manually.
    Is the 'imp' command able to handle function-based indexes? Is there some parameter than I need to set to allow it to import these indexes?
    (I know the more efficient thing to do would be to do an import with no indexes and rebuild them later...)
    Edited by: user588235 on Dec 9, 2009 5:16 PM

    Function based indexes should be supported. If it is exported, then it should be able to be imported. This just seems like a weird case. Have you tried to create a different table and then create a function based index on that table then see if exp/imp work?Yes, I have tried creating new versions of the tables (both with and without function-based indexes).
    During my tests, I found that I can recreate the problem if I create the table in Oracle 9 and import it into Oracle 10; the problem doesn't occur when importing/exporting between Oracle9->Oracle9 or Oracle10->Oracle10. (However, the user told me that this was an export from Oracle 10.)
    One other thing: I've noticed that if, instead of importing into a user account, I import into the system account, it works with no problems. For example:
    imp userid='sys/xyz as sysdba' file=mydata.dmp fromuser=use1 touser=use2 ->Results in warnings while reading indexes
    imp userid='sys/xyz as sysdba' file=mydata.dmp fromuser=use1 touser=sys ->works with no warning
    This makes me suspect that its a problem with the permissions that have been granted. (I've granted 'create any index' and 'query rewrite' to the user account however.)
    Not to change the issue, but since this is 10g, have you tried using datapump to expdp/impdp the same information?Might be an option; problem is, I'm dealing with a legacy system that was set up to use 'imp/exp', so altering backup and restore methods will require a lot of work.

  • How to define error message for function based index violation?

    Hi,
    I am generating Forms 6i from Designer 6i. I have a function based index to enforce case insensitive name uniqueness. With check constraints I can specify constraint violation error messages that will be displayed in Forms at runtime if needed. How can I do this with function based index constraints?
    Regards,
    Tamas

    OK, problem sorted.
    You need to create a check constraint with the same name as the new index, but don't enable it.

  • Error creating function based index

    i keep getting ORA-13203 errors when creating a function-based index. The function is owned by another schema but the the user creating the function has execute privileges
    [email protected]> create index mpp_nc_sidx on MPP_NONCOMPLETE(GIS.DD832UTM(LON*-1,LAT))
    2 indextype is mdsys.spatial_index
    3 parameters('tablespace=sde4_idx sdo_indx_dims=2');
    create index mpp_nc_sidx on MPP_NONCOMPLETE(GIS.DD832UTM(LON*-1,LAT))
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA table
    ORA-13203: failed to read USER_SDO_GEOM_METADATA table
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_9I", line 7
    ORA-06512: at line 1
    [email protected]> select table_name,column_name from user_sdo_geom_metadata;
    TABLE_NAME COLUMN_NAME
    MPP_NONCOMPLETE GIS.DD832UTM(LON*-1,LAT)
    [email protected]> select GIS.DD832UTM(LON*-1,LAT) from mpp_noncomplete where rownum < 3;
    GIS.DD832UTM(LON*-1,LAT)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    SDO_GEOMETRY(2001, 82212, SDO_POINT_TYPE(864941.804, 3916953.95, NULL), NULL, NULL)
    SDO_GEOMETRY(2001, 82212, SDO_POINT_TYPE(568560.541, 4181497.56, NULL), NULL, NULL)
    [email protected]> select text from all_source where name = 'DD832UTM';
    TEXT
    FUNCTION dd832utm(x number, y number)
    RETURN mdsys.sdo_geometry DETERMINISTIC
    IS
    geom mdsys.sdo_geometry;
    BEGIN
    geom := sdo_cs.transform
    (mdsys.sdo_geometry (2001,8265,mdsys.sdo_point_type
    (x,y, null),null,null),82212);
    return geom;
    END;
    any help appreciated
    --kassim

    Hi, try to use a view:
    create or replace view v_dd832utm as
    select
    mdsys.sdo_geometry(2001,8265,
    mdsys.sdo_point_type((LON*-1),LAT, null),null,null),
    82212)as GEOMETRY
    from
    mpp_noncomplete;
    provide metadata for that view (column: GEOMETRY) and create a spatial index. your way is more sophisticated ;o)
    regards, Andreas

  • Creating function-based indexes

    I'm trying to create a function-based index in one of the user's schemas and am getting an insufficient privilege error. Below are the examples:
    connect scott/tiger ;
    CREATE INDEX emp_ename_idx ON ename( emp ) ;
    Index created.
    CREATE INDEX upper_ename_idx ON ename( upper(ename)) ;
    ERROR at line1:
    ORA-01031: insufficient privileges
    The DBA granted the CREATE ANY INDEX privilege to user scott already. Any ideas???
    Thanks,
    SY

    Hi, all.
    I didn't hear about function-based index before, so I did some testing. Instead of using Oracle predefined functions (upper, lower, substr etc.), I created my own function and tried to create an index on it. I received an error that function is not deterministic. The definition of deterministic from Oracle docs:
    DETERMINISTIC
    This hint helps the optimizer avoid redundant function calls. If a stored function was called previously with the same arguments, the optimizer can elect to use the previous result. The function result should not depend on the state of session variables or schema objects. Otherwise, results might vary across calls. Only DETERMINISTIC functions can be called from a function-based index or a materialized view that has query-rewrite enabled.
    So, I put word deterministic in function declaration and everything works OK. Then I modified function to use some of the tables (I used tables across different schemas), recreated the index and it also worked fine.
    Question - is this statement correct: You can use schema objects in function which is in turn used for indexes as long as you put word deterministic in function declaration and all objects (function, index) will be valid, but ORACLE doesn't guarantee that result produced using that index will be correct?
    Thank you.

  • Problem creating a function based index

    Hi,
    Database: 8.0.6
    OS: win 2000 server
    I want to create a function based index as shown below:
    sql> create index new_index on A_INP_PATIENTS_ADMT(bus_unit, admit_status_flag, nvl(clinical_discharge_yn,'N'), ward_code)
    When i press return its showing error,
    "ORA-00907: missing right parenthesis"
    Please show me how to rewrite this query to build function based index.
    Best Regards,
    Edited by: ateeqrahman on Jun 6, 2010 2:34 PM

    Your sql is fine:
    SQL> CREATE TABLE A_INP_PATIENTS_ADMT(
      2                                   bus_unit number,
      3                                   admit_status_flag varchar2(1),
      4                                   clinical_discharge_yn varchar2(1),
      5                                   ward_code varchar2(10)
      6                                  )
      7  /
    Table created.
    SQL> create index new_index on A_INP_PATIENTS_ADMT(bus_unit, admit_status_flag, nvl(clinical_discharge_yn,'N'), ward_code)
      2  /
    Index created.
    SQL> You did not post Oracle version. Most likely, you are on some older version that does not support FBI. Otherwise, post your version and table description and create index statement execution showing all errors you are getting.
    SY.

  • How to create function based index for TO_CHAR

    i need to create a function based index for the function to_char.when i tried ,i got an error,"only pure function can be indexed".what the error really means, help me in creating the index to reduce my query cost.

    It works fine on my database. version 9iR2
    create index IDX_TO_CHAR on emp(to_char(hiredate,'YYYY-MM-DD HH24:MI:SS'));
    explain plan for
    select hiredate from emp where to_char(hiredate,'YYYY-MM-DD HH24:MI:SS')='1981-05-01 00:00:00';
    | Id  | Operation                   |  Name        | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT            |              |     1 |     8 |     2  (50)|
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP          |     1 |     8 |     2  (50)|
    |*  2 |   INDEX RANGE SCAN          | IDX_TO_CHAR  |     1 |       |     2  (50)|
    Predicate Information (identified by operation id):
       2 - access(TO_CHAR("EMP"."HIREDATE",'YYYY-MM-DD HH24:MI:SS')='1981-05-01 00
                  :00:00')Yours seem like a tuning issue, so why not give us your sql and execution plan and so on.
    maybe there is other ways to tune your sql than creating a function based index?

  • Creation of function based index using escape

    Hello,
    I have the following SQL, sometimes performing bad:
    SELECT DISTINCT UPPER(A.PROCESSIDCODE), UPPER(A.RULENAME), CHARSET
    FROM XIB_DETECT A, XIB_PROCESSIDPROPERTIES B, XIB_RULES C
    WHERE ( A.KEY1 = :P1 OR ( :P1 like REPLACE(REPLACE(REPLACE(REPLACE(KEY1,'%', '\%'),'_', '\_'),'?', '_'),'*','%') escape '\' AND A.REGFLAGS1 = 'Y') OR A.KEY1 = '*' AND A.REGFLAGS1 = 'Y')
    AND (A.KEY2 = :P2 OR ( :P2 like REPLACE(REPLACE(REPLACE(REPLACE(KEY2,'%', '\%'),'_', '\_'),'?', '_'),'*','%') escape '\' AND A.REGFLAGS2 = 'Y') OR (A.KEY2 IS NULL AND A.REGFLAGS2 IS NULL ) )
    AND (A.KEY3 = :P3 OR ( :P3 like REPLACE(REPLACE(REPLACE(REPLACE(KEY3,'%', '\%'),'_', '\_'),'?', '_'),'*','%') escape '\' AND A.REGFLAGS3 = 'Y') OR (A.KEY3 IS NULL AND A.REGFLAGS3 IS NULL ) )
    AND (A.KEY4 = :P4 OR ( :P4 like REPLACE(REPLACE(REPLACE(REPLACE(KEY4,'%', '\%'),'_', '\_'),'?', '_'),'*','%') escape '\' AND A.REGFLAGS4 = 'Y') OR (A.KEY4 IS NULL AND A.REGFLAGS4 IS NULL ) )
    AND (A.KEY5 = :P5 OR ( :P5 like REPLACE(REPLACE(REPLACE(REPLACE(KEY5,'%', '\%'),'_', '\_'),'?', '_'),'*','%') escape '\' AND A.REGFLAGS5 = 'Y') OR (A.KEY5 IS NULL AND A.REGFLAGS5 IS NULL ) )
    AND (A.KEY6 IS NULL OR A.KEY6 = '*' AND REGFLAGS6 = 'Y')
    AND (A.KEY7 IS NULL OR A.KEY7 = '*' AND REGFLAGS7 = 'Y')
    AND (A.KEY8 IS NULL OR A.KEY8 = '*' AND REGFLAGS8 = 'Y')
    AND (A.KEY9 IS NULL OR A.KEY9 = '*' AND REGFLAGS9 = 'Y')
    AND (A.KEY10 IS NULL OR A.KEY10 = '*' AND REGFLAGS10 = 'Y')
    AND ( ( A.PROCESSIDCODE IS NOT NULL AND UPPER(A.PROCESSIDCODE) = UPPER(B.PROCESSIDCODE) AND A.XLEVEL = B.XLEVEL AND B.ACTIVEFLAG = 'Y' )
    OR ( A.RULENAME IS NOT NULL AND UPPER(A.RULENAME) = UPPER(C.RULENAME) AND A.XLEVEL = C.XLEVEL AND C.ACTIVEFLAG = 'Y' ) );
    Now I want to create a function based index on the key1 column:
    CREATE INDEX xib_detect_ix ON xib_detect (REPLACE(REPLACE(REPLACE(REPLACE(KEY1,'%', '\%'),'_', '\_'),'?', '_'),'*','%') escape '\') TABLESPACE ... ONLINE;
    However, this is not working with "escape" '\', throwing: ORA-00907: missing right parenthesis
    Any idea how to create an index on this construct with "escape"?
    Database version is 10.2.0.3.
    Thanks a lot.
    Regards
    Oliver

    Hi,
    You can get the "missing right parenthesis" error for many different syntax errors.
    In this case, you really are missing a right parenthesis.  Your statement has 5 left '('s, but only 4 right ')'s.  It's easy to see this if you format your code:
    CREATE  INDEX xib_detect_ix
    ON  xib_detect ( REPLACE ( REPLACE ( REPLACE ( REPLACE ( KEY1
                     escape '\'
    ESCAPE is an option that you can use with the LIKE operator.  It gives you a mechanism for cancelling the special meaning of symbols like '%'.    You're not using the LIKE operator to create the index.  You're only using REPLACE, and no characters have any special meaning in REPLACE, so there's no way (or reason) to escape them.  Use ESCAPE in queries that use LIKE, when appropriate.

  • Function-Based Indexes for 8.1.6 SE and 9iAS

    I have installed the 9iAS Portal into a 8.1.6 SE database, and I cannot get the Function-Based Index feature to turn on. I have set QUERY_REWRITE_INTEGRITY=trusted, QUERY_REWRITE_ENABLED=true and COMPATIBLE="8.1.0.0.0". The feature will still not enable.
    I have 2 questions:
    1. Is there anything else I can do to turn this feature on.
    2. If not, do I have to upgrade to 8.1.7 or to 8.1.* Enterprise Edition to make use of this feature.

    Could you give the statement for the index you have used, the query you try to do and a description of columns and datatypes of the table? How do you know/check that is doesn't work? Execution plan, errors?...

  • Unable to create function based Index

    Hi All,
    I created a function as below:
    create or replace function eqx_oklb_term_date_nvl(pin_term_date date)
    return date
    deterministic
    is
    l_sub_date date := sysdate+1;
    l_return_value date := l_sub_date;
    begin
    l_return_value := nvl(pin_term_date, l_sub_date);
    return l_return_value;
    exception
    when others
    then
    l_return_value := l_sub_date;
    return l_return_value;
    end eqx_oklb_term_date_nvl;
    Now trying to create a function based index using below code:
    create index EQX_OKC_K_LINES_B_N4 on OKC.OKC_K_LINES_B(EQX_OKLB_TERM_DATE_NVL(DATE_TERMINATED))
    logging
    tablespace EQIXDATA
    noparallel;
    Encountered Error:
    SQL Error: ORA-00904: "EQX_OKLB_TERM_DATE_NVL": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    *Cause:   
    *Action:
    I can successfully query dba_objects for the function.
    Owner Object_name object_id object_type last_ddl_time status
    APPS     EQX_OKLB_TERM_DATE_NVL     11764623     FUNCTION     3/4/2013 9:44:57 PM     VALID
    I can also query the function using dual.
    select eqx_oklb_term_date_nvl(null) nvl_date from dual;
    nvl_date
    3/5/2013 9:53:59 PM
    I have given grants of the function to both schemas APPS/OKC
    grant all on eqx_oklb_term_date_nvl to okc;
    grant all on eqx_oklb_term_date_nvl to apps;
    The column date_terminated in table okc_k_lines_b is a date. I've checked that.
    Stuck here. Please help.
    Thanks in advance,
    Rahul

    Hi,
    To follow up, the below code resolved the issue:
    create index EQX_OKC_K_LINES_B_N4 on okc_k_lines_b(apps.eqx_oklb_term_date_nvl(date_terminated))
    logging
    tablespace eqixdata
    noparallel;
    -- qualifying the custom function name with schema name resolved the issue.
    Thanks,
    Rahul

  • Function Based index getting disabled frequently

    I am facing some error like “ORA-30554: function-based index ORADB1.FUN_INDX1 is disabled” in the development database. I verified that the function which is referred by the index is valid. Once I even got the tedious generic error ORA-600 because of this. I referred the metalink and advised to drop and recreate the index
    Dropping and recreating the index will solve the issue for 2-3 days and again the same will be repeated. So what I did is made the index unusable as it will not affect the other application activities. Can anybody give a clue on this issue?

    I am facing some error like “ORA-30554:
    function-based index ORADB1.FUN_INDX1 is disabled” Cause: An attempt was made to access a function-based index that has been marked disabled because the function on which the index depends has been changed.
    Action: Perform one of the following actions: -- drop the specified index using the DROP INDEX command -- rebuild the specified index using the ALTER INDEX REBUILD command -- enable the specified index using the ALTER INDEX ENABLE command -- make the specified index usable using the ALTER INDEX UNUSABLE command

  • 10.1.3 - Create Table Wizard - function based indexes?

    Is the ability to create function based indexes via the Create Table Wizard planned for the 10.1.3 production release?
    It appears the Wizard under step 7 has the ability to enter "function" expressions. However an error dialog appears if you enter anything but a column name.
    CM.

    Chris,
    Yes, this has been implemented for Production.
    Regards,
    Lisa Sherriff
    JDev QA

  • ORA-00439 while creating function based indexes.

    Hi everybody
    I'm working on Oracle 8.1.7 database, and try to create a function based index on a table.
    Unfortunately I get the ORA-00439 error, that recommends me not to use this feature :-(
    What should I do to activate this feature ?
    Thanx

    Try.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bi
    PL/SQL Release 10.1.0.2.0 - Production
    CORE    10.1.0.2.0      Production
    TNS for Solaris: Version 10.1.0.2.0 - Production
    NLSRTL Version 10.1.0.2.0 - Production

Maybe you are looking for