SQL tuning advisor recommnds to create SYS_OP_C2C function based index

I have a large table and one index on it. I use some tool to populate data, this tool simple submits the sql to Oracle DB and it does NOT use use index for queries. When I run the sql tuning advisor it recommends to create additional index and use SYS_OP_C2C function, which I do not want.
When I run the query via sql plus it picks up the index.
Have any of you come across, why its recommending this additional non-sense?
create index abc.xxxx on this_table(SYS_OP_C2C("this_column"));
Thanks

The internal Oracle function SYS_OP_C2C performs conversion from one character set to another character set - C(haracterSet)2C(haracterSet). There are situations when one will see this conversion going on without explicit command as in this case what should be a sign that the data types are not the same and implicit conversion is taking place and this might be also a problem from performance perspective as it may disable index usage.
Make sure you the characterset and nls defined of any of the database and tool are same.
Make sure the data type of the column on the index is same as database.
Confirm with ETL vendor for your database support and any patches etc.
Optimizer will only advise to use that function when characterset or data type does not match.
Thanks,
TaraChand

Similar Messages

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

  • Fail to create a function-based index

    Hello,
    I'm trying to create a function-based index using the following syntax :
    CREATE INDEX fb_name_idx on employees (UPPER(name));
    And i've got an ORA-00439 error (function not enabled).
    I'm running on Oracle 9.2 Standard edition.
    Is this functionality really disabled on standard edition ?
    Thanks in advance for your answer,
    Guillaume Basilico

    No.
    According to this document http://otn.oracle.com/products/database/oracle10g/pdf/twp_general_10gdb_product_family_0104.pdf in the 3rd row on page 12 you can see that Function-Based Indexes are available on Standard Edition.
    According to metalink note 69492.1 FBI are available on standard edition.
    As for me, I'm too using Oracle 9.2 SE and in my version they are available.
    SQL> CREATE INDEX fb_name_idx on tt(trunc(dt));
    Index created
    SQL> select * from v$version;
    BANNER
    ----------------------------------------------------------Oracle9i Release 9.2.0.4.0 - Production
    PL/SQL Release 9.2.0.4.0 - Production
    CORE     9.2.0.3.0     Production
    TNS for Linux: Version 9.2.0.4.0 - Production
    NLSRTL Version 9.2.0.4.0 - Production
    Please check exect version number of database and contact your DBA.

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

  • 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

  • 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

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

  • 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

  • Function based indexes on object tables

    Hi,
    I am trying to create a function based index on an object table. I am getting the following error:
    SQL> create index cell1_indx on cell1(create_cell1(id)) indextype is mdsys.spatial_index;
    create index cell1_indx on cell1(create_cell1(id)) indextype is mdsys.spatial_index
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13249: internal error in Spatial index: [mdidxrbd]
    ORA-13249: Error in Spatial index: index build failed
    ORA-13249: Stmt-Execute Failure: SELECT num_rows from all_tables where owner='ASHE' and table_name=
    'CELL1'
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_9I", line 7
    ORA-06512: at line 1
    Here cell1 is an object table.
    Is the procedure for creating function based indexes on object tables different from relational tables?
    Chinni

    One of the many new features in Oracle 8i is the Function-Based Index (we will refrain from using FBI, but only just). This allows the DBA to create indexes on functions or expressions; these functions can be user generated pl/sql functions, standard SQL functions (non-aggregate only) or even a C callout.
    A classic problem the DBA faces in SQL Tuning is how to tune those queries that use function calls in the where clause, and result in indexes created on these columns not to be used.
    Example
    Standard B-Tree index on SURNAME with cost based optimizer
    create index non_fbi on sale_contacts (surname);
    analyze index non_fbi compute statistics;
    analyze table sale_contacts compute statistics;
    SELECT count(*) FROM sale_contacts
    WHERE UPPER(surname) = 'ELLISON';
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3 Card=1 Bytes=17)
    1 0 SORT (AGGREGATE)
    2 1 TABLE ACCESS (FULL) OF 'SALES_CONTACTS' (Cost=3 Card=16 Bytes=272)
    Now we use a function based index
    create index fbi on sale_contacts (UPPER(surname));
    analyze index fbi compute statistics;
    analyze table sale_contacts compute statistics;
    SELECT count(*) FROM sale_contacts WHERE UPPER(surname) = 'ELLISON';
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=17)
    1 0 SORT (AGGREGATE)
    2 1 INDEX (RANGE SCAN) OF 'FBI' (NON-UNIQUE) (Cost=2 Card=381 Bytes=6477)
    The function-based index has forced the optimizer to use index range scans (retuning zero or more rowids) on the surname column rather than doing a full table scan (non-index lookup). Optimal performance does vary depending on table size, uniqueness and selectivity of columns, use of fast full table scans etc. Therefore try both methods to gain optimal performance in your database.
    It is important to remember that the function-based B*Tree index does not store the expression results in the index but uses an "expression tree". The optimizer performs expression matching by parsing the expression used in the SQL statement and comparing the results against the expression-tree values in the function-based index. This comparison IS case sensitive (ignores spaces) and therefore your function-based index expressions should match expressions used in the SQL statement where clauses.
    Init.ora Parameters
    The following parameter must be set in your parameter file: QUERY_REWRITE_INTEGRITY = TRUSTED
    QUERY_REWRITE_ENABLED = TRUE
    COMPATIBLE = 8.1.0.0.0 (or higher)
    Grants
    Grants To create function-based indexes the user must be granted CREATE INDEX and QUERY REWRITE, or alternatively be granted CREATE ANY INDEX and GLOBAL QUERY REWRITE. The index owner must have EXECUTE access on the function used for the index. If execute access is revoked then the function-based index will be "disabled" (see dba_indexes).
    Disabled Indexes
    If your function-based index has a status of "disabled" the DBA can do one of the following:
    a) drop and create the index (take note of its current settings)
    b) alter index enable, function-based indexes only, also use disable keyword as required
    c) alter index unusable.
    Queries on a DISABLED index fail if the optimizer chooses to use the index.Here is an example ORA error:
    ERROR at line 1: ORA-30554: function-based index MYUSER.FBI is disabled.
    All DML operations on a DISABLED index also fail unless the index is also marked UNUSABLE and the initialization parameter SKIP_UNUSABLE_INDEXES is set to true.
    Some more Examples
    CREATE INDEX expression_ndx
    ON mytable ((mycola + mycolc) * mycolb);
    SELECT mycolc FROM mytable
    WHERE (mycola + mycolc) * mycolb <= 256;
    ..or a composite index..
    CREATE INDEX example_ndx
    ON myexample (mycola, UPPER(mycolb), mycolc);
    SELECT mycolc FROM myexample
    WHERE mycola = 55 AND UPPER(mycolb) = 'JONES';
    Restriction & Rule Summary
    The following restrictions apply to function based indexes. You may not index:
    a) LOB columns
    b) REF
    c) Nested table column
    d) Objects types with any of the above data types.
    Function-based indexes must always follow these rules:
    a) Cost Based optimizer only, must generate statistics after the index is created
    b) Can not store NULL values (function can not return NULL under any circumstance)
    c) If a user defined pl/sql routine is used for the function-based index, and is invalidated, the index will become "disabled"
    d) Functions must be deterministic (always return the same value for a known input)
    e) The index owner must have "execute" access on function used in the function-based index. Revocation of the privilege will render the index "disabled"
    f) May have a B-Tree and Bitmap index type only
    g) Can not use expressions that are based on aggregate functions, ie. SUM, AVG etc.
    h) To alter a function-based index as enabled, the function used must be valid, deterministic and the signature of the function matches the signature of the function when it was created.
    Joel P�rez

  • 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

    Oracle documentation on "How Function-Based Indexes Work" states that for the creation of a function-based index in the user's own schema, the user must be granted the QUERY REWRITE system privileges. And MUST have the following initialization parameters defined to create a function-based index:
    QUERY_REWRITE_INTEGRITY set to TRUSTED
    QUERY_REWRITE_ENABLED set to TRUE.
    I have created a function-based unique index, which uses the SQL function DECODE(). But the user doesn't have the QUERY REWRITE sytem privilege. The user has the following privileges:
    CREATE PROCEDURE
    CREATE SEQUENCE
    CREATE SESSION
    CREATE TABLE
    CREATE TRIGGER
    CREATE VIEW
    And also the initialization parameters for QUERY_REWRITE_INTEGRITY and QUERY_REWRITE_ENABLED are set to their DEFAULT values as follows:
    QUERY_REWRITE_INTEGRITY set to ENCFORCED
    QUERY_REWRITE_ENABLED set to FALSE.
    Note: The index is an unique index for data integrity purpose. I am using Oracle 9.2.0.6 version.
    Kindly explain me the reason how the function-based index is created without the system privilege and the initialization parmaters defined as stated in the Oracle9i Database Administrator's Guide Release 2 (9.2).

    You can change those parameter at session level as well.
    Following link would be helpful:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:2552324147195810457::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:667694821129
    Jaffar

  • 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

  • Question on Function-based Indexes

    hi
    I have created one function based index on EMP table as follows
    SQL> CREATE INDEX UPP_ENAME ON EMP UPPER(ENAME);
    Index created.
    as well enable two parameters and analyze the table
    SQL> ALTER SESSION SET QUERY_REWRITE_ENABLED =TRUE;
    Session altered.
    SQL> ALTER SESSION SET QUERY_REWRITE_INTEGRITY =TRUSTED;
    Session altered.
    SQL> EXECUTE DBMS_STATS.GATHER_TABLE_STATS ('MYTEST','EMP');
    PL/SQL procedure successfully completed.
    and when I run the following query system is still not using this index.
    SQL> SELECT ENAME,EMPNO,JOB FROM EMP WHERE UPPER(ENAME) LIKE 'JAMES';
    ENAME EMPNO JOB
    JAMES 7900 CLERK
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=18)
    1 0 TABLE ACCESS (FULL) OF 'EMP' (Cost=2 Card=1 Bytes=18)
    Can anyone explain me why it is not being used.
    Thanks

    SQL> select count(*) "Rows" from acledger;
    Rows
    1444280
    SQL> set timing on
    SQL> select * from acledger where nserial like '1';
    NSERIAL DTRNDATE DDATEIN CACTCODE NTRNAMT NNARRATION NDOCUMENT
    NSOURCE NBRANCH NCURRENCY NEXCHANGE NFCYAMT
    1 24-OCT-96 24-OCT-96 650A10001 126876.5 1 200
    0 1 6 1 126876.5
    Elapsed: 00:00:14.85
    SQL> select * from acledger where nserial = '1';
    NSERIAL DTRNDATE DDATEIN CACTCODE NTRNAMT NNARRATION NDOCUMENT
    NSOURCE NBRANCH NCURRENCY NEXCHANGE NFCYAMT
    1 24-OCT-96 24-OCT-96 650A10001 126876.5 1 200
    0 1 6 1 126876.5
    Elapsed: 00:00:00.29
    SQL>
    Always "=" faster than "like" operator.
    Listen to all other members.
    Message was edited by:
    user526020
    Message was edited by:
    user526020

  • Function Based Index - Query Performance

    HI,
    Good Day to All..
    I'd like to use function based indexes on following column(to_char(ps.user_pc_id)).
    Whereas this column is part of PRIMARY KEY.
    Is it possible to create a function based index on PRIMARY KEY Column?
    Attached below is the query with the explain plan ...
    TO_CHAR Expression - Performance
    Thanks for your reply.

    DTYLER_APP@pssdev2> create table dt_fbi_pk(id varchar2(20));
    Table created.
    DTYLER_APP@pssdev2> drop table dt_fbi_pk;
    Table dropped.
    DTYLER_APP@pssdev2> create table dt_fbi(id number);
    Table created.
    DTYLER_APP@pssdev2> create index dt_fbi_idx on dt_fbi(to_char(id));
    Index created.
    DTYLER_APP@pssdev2> alter table dt_fbi add constraint dt_fbi_pk primary key (id);
    Table altered.
    DTYLER_APP@pssdev2> select constraint_name,constraint_type, index_name from user_constraints where table_name='DT_FBI';
    CONSTRAINT_NAME                C INDEX_NAME
    DT_FBI_PK                      P DT_FBI_PK
    1 row selected.When we created the primary key constraint, Oracle created a new index rather than using the existing one because....
    DTYLER_APP@pssdev2> alter table dt_fbi drop primary key;
    Table altered.
    DTYLER_APP@pssdev2> select index_name from user_indexes where table_name ='DT_FBI';
    INDEX_NAME
    DT_FBI_IDX
    1 row selected.
    DTYLER_APP@pssdev2> alter table dt_fbi add constraint dt_fbi_pk primary key (id) using index dt_fbi_idx;
    alter table dt_fbi add constraint dt_fbi_pk primary key (id) using index dt_fbi_idx
    ERROR at line 1:
    ORA-14196: Specified index cannot be used to enforce the constraint.
    DTYLER_APP@pssdev2> alter table dt_fbi add constraint dt_fbi_uk unique(id) using index dt_fbi_idx;
    alter table dt_fbi add constraint dt_fbi_uk unique(id) using index dt_fbi_idx
    ERROR at line 1:
    ORA-14196: Specified index cannot be used to enforce the constraint.We can't use a function based index to enforce a unique or primary key constraint. Changing the syntax does not help..
    DTYLER_APP@pssdev2> alter table dt_fbi add constraint dt_fbi_uk unique(TO_CHAR(id)) using index dt_fbi_idx;
    alter table dt_fbi add constraint dt_fbi_uk unique(TO_CHAR(id)) using index dt_fbi_idx
    ERROR at line 1:
    ORA-00904: : invalid identifierWe can create a unique index however
    DTYLER_APP@pssdev2> drop index dt_fbi_idx;
    Index dropped.
    DTYLER_APP@pssdev2> create unique index dt_fbi_idx on dt_fbi(to_char(id));
    Index created.but we still can't use it to enforce a unique or primary key constraint
    DTYLER_APP@pssdev2> alter table dt_fbi add constraint dt_fbi_pk primary key (id) using index dt_fbi_idx;
    alter table dt_fbi add constraint dt_fbi_pk primary key (id) using index dt_fbi_idx
    ERROR at line 1:
    ORA-14196: Specified index cannot be used to enforce the constraint.
    DTYLER_APP@pssdev2> alter table dt_fbi add constraint dt_fbi_uk unique(id) using index dt_fbi_idx;
    alter table dt_fbi add constraint dt_fbi_uk unique(id) using index dt_fbi_idx
    ERROR at line 1:
    ORA-14196: Specified index cannot be used to enforce the constraint.So no, you can't use it for a primary key. If you just want to enforce uniqueness then yes, you can do it with a unique index, but not a constraint.
    DTYLER_APP@pssdev2> select * from v$version;
    BANNER
    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 Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    5 rows selected.HTH
    Daviid

  • Function-Based Index enabling.

    Hi...
    I'm trying to create a function-based index along the lines of:
    CREATE INDEX x_ssn4
    ON table_y(SUBSTR(ssn,6,4))
    UNRECOVERABLE;
    ...so as to be able to query the final 4 digits of social security numbers. Problem is that the above elicits an ORA-00439 "feature not enabled" message. I'm running 8.1.6 and have tried setting the Oracle parameter QUERY_REWRITE_ENABLED to 'TRUE' via an ALTER SESSION command, but to no avail.
    Anyone know how to 'turn the feature on'?
    Thanks, Rob

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Rick Post:
    I've always done it by logging on as SYS and executing a 'grant query rewrite to myuser'.
    <HR></BLOCKQUOTE>
    Thanks... but turns out that the privilege is not really the issue, as the ALTER SESSION command works. I figured out that the problem was the setting for COMPATIBLE. It pointed to 8.0.0 instead of 8.1.x which is what was needed to permit function-based indexing.
    ~Rob
    null

Maybe you are looking for

  • Adding Drives to a RAID 5

    I have a XSERVE RAID with 4 250GB drives configured as a RAID 5. We're starting to get low on space so I'd like to expand the capacity by adding some drives. Is there a specific number of drives I need to add or can I add 1, 2 or 3 drives as long as

  • Form calling Report with web.show_document caught by SSO

    A 10g form button calls a 10g report via web.show_document. In the dev environment it works, but in the full app server SSO is enabled and stops & prompts for a login/password. I'm trying to include the SSOCONN parameter in the URL. I've tried the db

  • FCC..how to remove first row

    Hello experts, I have configured a end to end sccenario fo csv files, Im using fcc for the sender file adapter The first row has all the field names such as name,number and the rest of the rows have the values. when I run the scenario the xml being f

  • Org.apache.soap.rpc.Call is hanging on invoke()...

    Hi. What do you do when you're making a call to a webservice with org.apache.soap.rpc.Calland it just plain hangs on the Call.Invoke() method? -pfv

  • Determinng how many times an index was used

    DB Version:10gR2 Is there a way i could determine how many times an index was used? i couldn't find any related columns in user_indexes.